Claude · Automation

Turn Your Instagram Saves Into a Content Idea Machine

The complete pipeline that pulls your saved posts into Notion twice a day, then turns them into ready-to-shoot content ideas with Claude Code. Copy-paste prompts included.

QQuentin Megevand
August 31, 2026 · 10 min read

You save Instagram posts for inspiration. Then you swipe to the next reel and never open them again. Every "I'll come back to this later" becomes dead weight at the bottom of a collection you never check.

This guide turns that dead weight into a pipeline: your saves flow into Notion on their own twice a day, and one Claude Code command converts them into content ideas in your voice, with hooks, an outline, and platform breakdowns.

You change nothing about your habit. You keep saving what inspires you, and the system does the rest.

Every step produces a working file. Zero lines of Python to write yourself: Claude Code generates everything. Verified with Claude Code 2.1.251 on August 31, 2026.

Claude AI Lab

The Claude AI Lab is my Skool community where I share my Claude systems and the more advanced modules. Access is $67/month.

Join the Lab →
What you need
1
Access to Claude Code. Included with Claude Pro, or via API billing.
2
A Mac with Python 3.9 or newer. The scheduler uses launchd, native to macOS. On Linux, swap it for cron, everything else is identical. Check with python3 --version.
3
A Notion account. We'll create a free internal integration.
4
An Instagram account with saved posts. Ideally sorted into collections, you'll see why.
1

Understand the system

🧠 3-piece architecture

The pipeline is three pieces:

🐍
sync.py
A Python script that pulls your saved posts and writes new ones to Notion, twice a day. The dumb layer: it collects, dedupes, files away.
🗄️
Two Notion databases
"Instagram Saves" receives the raw saves. "Content Ideas" receives the ready-to-shoot ideas. Two separate databases, so your calendar stays clean.
/instagram-sync
A Claude Code command that reads unprocessed saves and reframes them into content ideas for your audience. The smart layer: it reads, reframes, adapts.

The full flow: launchd fires sync.py at 9 AM and 9 PM. New saves land in Notion with a "New" status. Once a week, you open Claude Code, type /instagram-sync ideate, approve the ideas you like, and they land in your "Content Ideas" database with hooks, an outline, and platform breakdowns.

One honest point before we build: Instagram exposes no official API for your saved posts, not even through the Graph API. So the script replays the same calls your browser makes, on your own account, with your own session cookies, twice a day. That's low-key and quiet, but automated collection still goes against Meta's terms of use: the risk is low at this frequency, not zero. You build with your eyes open.

The key principle
The dumb layer runs on its own in the background. The smart layer only runs when you are ready to think about content. That separation is what makes the system sustainable.
2

Set up Notion

🗄️ notion.so/profile/integrations
5
Create an internal integration. In Notion's settings, integrations section (or directly at notion.so/profile/integrations), create a new integration, check the Read, Insert, and Update capabilities, then copy the token. It starts with ntn_.
6
Create the "Instagram Saves" database. This is your raw research feed.
Name (title)          Status (select: New, Reviewed, Used)
URL (URL)             Type (select: Post, Reel, Carousel)
Author (text)         Collection (select)
Caption (text)        Media ID (text)
Saved (date)
7
Create the "Content Ideas" database. This is where ready-to-shoot ideas live.
Name (title)          Pillar (select: your content pillars)
Platform (multi-select: Instagram, TikTok, YouTube)
Format (select: Carousel, Reel, Short, Long-form)
Hook Options (text)   Priority (select: High, Medium, Low)
Angle (text)          Week Of (date)
Status (select: Not started, In progress, Done)
8
Connect the integration to both databases and note their IDs. On each database: three-dot menu, "Connections", pick your integration. The ID is the 32-character string in the database URL, right before the ?v=.
Why two databases
Saves pile up in the background without ever polluting your content calendar. You process in batches, and your production plan stays sharp.
3

Grab your Instagram cookies

🔑 Chrome DevTools

The script authenticates with the session cookies your browser already sends with every request.

9
Open DevTools on Instagram. Sign in at instagram.com in Chrome, then Cmd+Option+I, "Application" tab, expand "Cookies" in the left sidebar and click https://www.instagram.com.
10
Copy three values. sessionid, csrftoken, and ds_user_id (your numeric Instagram ID). Keep them handy for the next step.
Treat these cookies like a password
Anyone holding your sessionid can access your account. They never leave your machine: they live in a local config.json, excluded from git. Instagram rotates its cookies every few weeks: when the sync starts failing, come back here for fresh values.
4

Generate the sync script

🐍 sync.py, generated by Claude Code
11
Paste this prompt into Claude Code, opened in a dedicated project folder.
Build a Python script `sync.py` that pulls my saved Instagram posts
and writes new ones to a Notion database.

## Inputs (from config.json in the same folder)
ig_session_id, ig_csrftoken, ig_user_id (Instagram web cookies),
notion_token (ntn_ token), notion_database_id (Instagram Saves DB),
collections_filter (optional list of collections to sync).

## Instagram calls (mimic the web client, not the mobile app)
Headers: desktop Chrome User-Agent, X-IG-App-ID: 936619743392459.
Cookies: sessionid, csrftoken, ds_user_id.
Validate the session: GET /api/v1/accounts/edit/web_form_data/
Fetch saves: GET /api/v1/feed/saved/posts/?count=50,
paginate with next_max_id, sleep 1 second between pages.
List collections: GET /api/v1/collections/list/

## Deduplication
state.json holds the media IDs already synced. Skip any post
already present. Only add an ID after a successful Notion write.

## Notion writes (official notion-client SDK)
One page per new post: Name (@author/code), URL, Type (select
based on media_type), Author, Status = "New", Media ID, Saved
(today's date), Caption (truncated to 1900 chars), Collection
when the filter is active.
URL: https://instagram.com/reel/CODE/ for reels, /p/CODE/ otherwise.

## Logs and errors
Log to stdout and sync.log. Final line:
"Sync complete: N new | N skipped | N total | N errors".
Error on one post: log it and keep looping, never crash the run.
A failed ID does NOT go into state.json (retried next run).
Invalid session: exit immediately with a clear message.

## Also generate
requirements.txt (requests, notion-client>=3.0),
config.example.json (placeholders), .gitignore (config.json,
state.json, sync.log, .venv/).
12
Install the environment. python3 -m venv .venv, then source .venv/bin/activate, then pip install -r requirements.txt.
13
Fill in your config. cp config.example.json config.json, then replace each placeholder: the three cookies from step 10, your ntn_ token, your "Instagram Saves" database ID. The collections_filter is optional: list only the collections that feed your content, nothing else gets in.
14
Run your first sync. .venv/bin/python3 sync.py. A successful run ends with the summary line, and your Notion database fills up with rows in "New" status.
At this point
The infrastructure is done. Everything from here is configuration. Back up your state.json from time to time: it is what prevents duplicates, and if it disappears, the next run recreates every save as a duplicate row.
5

Schedule it with launchd

9 AM and 9 PM, hands off

launchd is the Mac's native scheduler: it starts at boot and restarts your job after a reboot, with nothing to maintain.

15
Paste this prompt into Claude Code.
Generate a launchd file `com.myname.instagram-saves-sync.plist` that
runs `.venv/bin/python3 sync.py` from my project folder at 9:00 AM
and 9:00 PM every day. Absolute paths throughout. stdout to
launchd-stdout.log and stderr to launchd-stderr.log in the project
folder. My project folder: [YOUR_ABSOLUTE_PATH]

Then give me the two commands to install it:
copy to ~/Library/LaunchAgents/ then load with launchctl.
16
Install and verify. Run the two commands it gives you, then launchctl list | grep instagram-saves. If an entry shows up, the scheduler is running.
After a macOS update
If the job stops firing, reload it: launchctl load ~/Library/LaunchAgents/com.myname.instagram-saves-sync.plist.
6

Run your first ideation batch

/instagram-sync ideate

The command is the creative layer of the system. It lives in a markdown file that Claude Code loads as a slash command.

17
Paste this prompt into Claude Code, replacing the placeholders with your niche and pillars.
Create a slash command `.claude/commands/instagram-sync.md` that
handles six actions depending on what I ask:

1. Sync now: run `.venv/bin/python3 sync.py`, then move on to
ideation if any saves have Status = "New".

2. Ideation (the core):
- Read the Instagram Saves database (ID: [SAVES_DB_ID]) filtered
  on Status = "New". Past 10 saves, process in batches of 10.
- For each save, generate 1 idea: reframe the concept for my
  audience ([YOUR_NICHE]), assign a pillar based on the source
  collection (my mapping: [COLLECTION to PILLAR]), write 3 hooks
  (curiosity, value, emotion), an outline HOOK then 3-4 key points
  then CTA, and the breakdowns: Instagram (carousel or reel),
  TikTok (30-60s script), YouTube only if the topic has long-form
  depth. Priority: High for core collections or timely topics,
  Medium for strong audience overlap, Low for inspiration.
- Present all ideas and ask: approve all, pick by number, skip
  all, or modify.
- For each approved idea, create a page in Content Ideas
  (ID: [IDEAS_DB_ID]) with every property filled and the full
  outline in the page body.
- Flip each processed save to "Used" (approved) or "Reviewed"
  (skipped).
- End with a summary: saves processed, ideas generated, ideas
  saved, titles.

3. Sync status: read state.json and the last 20 lines of sync.log,
report the last run and recent errors.
4. Scheduler status: `launchctl list | grep instagram-saves`.
5. Refresh session: walk me through grabbing fresh cookies in
DevTools then updating config.json and testing.
6. View recent saves: read the database sorted by date, newest first.
18
Run the ideation. Open Claude Code in your project folder and type /instagram-sync ideate. Claude reads your "New" saves, presents the ideas, writes the ones you approve to "Content Ideas", and marks the processed saves.

Open your "Content Ideas" database: every approved idea is there, with its angle, its outline, and its platform breakdowns, ready to shoot.

The routine that keeps it alive
Weekly, not daily. One session a week, one full batch of saves, sharper ideas and less mental load. The sync itself runs every day without you.

Three settings that change everything

Save with intention. Create one Instagram collection per content pillar before you launch the system. Organized saves become organized ideas: the collection-to-pillar mapping is exactly where the engine picks up your voice. Ten minutes of customization in the step 17 prompt is the best effort-to-result ratio in the whole pipeline.

Process in batches. Resist the urge to run ideation every day. A weekly review of a full week of saves produces sharper ideas, because you see the patterns repeating in what made you stop scrolling.

Extend the pattern. The same architecture works for your X bookmarks, your YouTube watch-later list, or your TikTok favorites: same collection script, same databases, only the API calls change. Start with Instagram, that's where your best backlog is sleeping.

Every post you save becomes a content idea in your voice, with its hooks and its outline. Your saves are no longer dead weight: they are your production pipeline filling itself.

Want to go further?

And day-to-day, I post one reel a day on Instagram: @quentin_iamarketing