Oleg MelnikovYouTube
free resource

Claude Code for Instagram reels that earn attention

Study the reels actually winning in your niche, then turn what you learn into ready-to-film scripts with sharp hooks, retention analysis, and clear visual direction. Craft over guesswork.

Jump to the setup steps or read the whole thing in writing.

122K views16:26 longPublished Mar 2026

Setup guide

Download and install VS Code from code.visualstudio.com. It auto-detects your OS.

Run the installer and verify VS Code launches properly.

The idea: stop guessing what to post

It reads the reels already winning in your niche, works out why each one held attention, and writes you new scripts that use the same mechanism on your own topic.

8
Creators tracked in a normal run
~70
Scripts out of a single run
Minutes
Time that run takes
$0
Marginal cost on the free tiers

Most advice about going viral is somebody describing what worked for them once. This replaces that with the actual data: it reads the reels that are winning in your niche right now, works out why, and writes scripts that use the same mechanism for your own topic.

I built the first version in under thirty minutes with Claude Code, and the point of the video was never the app. It is that this shape of thing, scrape, analyse, generate, is now something you can build in an afternoon for whatever you happen to need.

The honest framing

This does not make you go viral. It removes the blank page and replaces guesswork with evidence, so the judgement you already have is pointed at something real. That is a big edge and it is not the same as a guarantee.

What the system does, in order

  1. Tracks creators. You add Instagram accounts in your niche. It records followers, posting frequency and average views, so you can see who is worth studying.
  2. Scrapes their best recent reels. Top three from the last thirty days per creator, by default, through Apify.
  3. Watches each video. The actual video goes to Gemini, not the caption. It comes back with the hook, the retention mechanism, the reward and the script structure.
  4. Writes concepts for you. Claude takes each pattern and your own context and writes about three new concepts, with full scripts, in your niche.

Eight creators, three videos each, three concepts each: roughly 70 scripts from one run that takes minutes and costs close to nothing.

One run, start to finish. You pick a config, press go, and come back to scripts.

What it costs to run

Claude plan
Pro, $20 a month. Required, the free plan will not sign you in.
Apify, for scraping
$5 of credit free every month, which covers normal use
Google Gemini, for watching the videos
Free tier in Google AI studio, with a daily request cap
Anthropic API, for the scripts
Optional. The project can use your Claude plan instead.
Realistic monthly bill
$20, unless you run pipelines daily

The thing that runs out first is the Gemini free tier, because watching video is the expensive step.

How to pick the creators to study

Pick accounts in your exact niche whose average views are far above their follower count, not the biggest accounts you can find.

Every account you track shows three numbers: followers, reels a month, average views. The third divided by the first is the only one that matters.

This decides more than the prompts do, and it is the step people rush. What I look for, in order:

  • Same niche, not same size. A real estate broker should study real estate accounts, not general marketing accounts with better numbers.
  • High average views relative to followers. This is the tell for a creator whose content works, rather than one coasting on an audience they built years ago.
  • Posting often. More than a few reels a month means the recent-window filter has something to find.
  • Five to ten of them. Fewer and you are copying one person. More and you are paying to rediscover the same patterns.

The two prompts that decide everything

One prompt tells Gemini how to watch a reel, the other tells Claude how to turn what it saw into your scripts. Everything else in the project is plumbing.

A config is a name, a creator category, and the two prompts. You can keep several and run a different one per client.
  1. 1Add the creators you want to learn from

    Paste an Instagram username, tag it with a category, press add. The app records the follower count, how many reels they post a month, and their average views.

    Those three numbers are the point. They tell you whether an account is worth studying before you spend anything analysing it. An account averaging 40,000 views on daily posting is a teacher. An account with 400,000 followers and 3,000 views a reel is a cautionary tale.

  2. 2Write the analysis instruction

    This is a config, written once per niche, and it decides the quality of everything downstream. Mine asks for five things from every video:

    • The concept. What is this video actually about, in one line.
    • The hook. The first three seconds, verbatim, and why they work.
    • The retention mechanism. What stops you scrolling at second eight. An open loop, a visual change, a promise not yet paid.
    • The reward. What the viewer leaves with. An insight, a laugh, a number they did not know.
    • The script structure. How the thing is built, beat by beat.

    Start smaller than that if you want. "analyse the hook and the script" is a legitimate first version, and you can ask Claude to expand it once you have seen what comes back.

  3. 3Write the concepts instruction

    The second config is where your own context goes: who you are, what you sell, who you are talking to, what your videos should feel like.

    Without it you get a summary of somebody else's video. With it you get a video you could film tomorrow. This is the difference between the system being interesting and the system being useful, and it is the step people skimp on.

  4. 4Run the pipeline

    Pick the config, then how many videos per creator and over what window. My default is the top 3 videos from the last 30 days per creator, so eight creators gives about 24 videos.

    The recency window matters more than the count. A reel from eighteen months ago won a different feed than the one you are posting into tomorrow.

  5. 5Read the results, sorted by views

    You get a table sorted from most-viewed down. Each row has the analysis and about three concepts written for you, so 24 videos is somewhere near 70 candidate ideas.

    Most of them will not be good. That is fine and expected. The job the system does is not producing 70 good ideas, it is removing the blank page so your judgement has something to work on.

  6. 6Change the system by asking

    This part surprises people. The app is a Claude Code project, so changing it is a sentence, not a code change. "change the theme from dark to light" works. So does "switch the scraping from Instagram to TikTok", which is how The TikTok version exists.

    You do not need to read the code. You need to be able to say what you want.

The exact configs I use

These are the two configs from the video, not a cleaned-up version. The first one goes in the analysis field, the second in the concepts field. The second has the client-specific lines swapped for capitals, and those capitals are the only part you have to write.

Analysis instruction

# CONCEPT
Overall description of the concept of this video, and what makes it valuable and interesting (1-3 sentences).
-> Clarify the core tension: what belief is challenged, what mistake is exposed, or what outcome is promised.
-> One clear idea only. No subtopics.

# HOOK
Detailed description of the first 5 seconds of the video, what makes it scroll-stopping and attention-grabbing, why a viewer needs to stop to watch it (1-3 sentences).
-> Break it down into:
- VISUAL (what is seen in the first 1-2 seconds: movement, facial expression, contrast, pattern break)
- TEXT (short on-screen statement: danger, promise, or contradiction, max 6-8 words)
- AUDIO (first spoken words: confident, direct, no intro, no context)
-> The hook must create either fear of loss, strong curiosity, or identity relevance.

# RETENTION MECHANISMS
Detailed description of how the creator manages to retain viewers throughout the video (1-7 sentences).
-> Open loops ("In a second I'll show you why...", "Most people miss this part...")
-> Delayed payoff (main insight is intentionally held back)
-> Micro-escalations every 3-5 seconds (new angle, sharper wording, visual or tonal shift)
-> Pattern interrupts (pauses, emphasis, cut, zoom, gesture)
-> Clear forward momentum: the viewer feels the video is going somewhere.

# REWARD
Describe the ultimate value that the viewer gets by watching this video (1-3 sentences).
-> Be explicit: what does the viewer now understand, feel, or see differently?
-> Define whether the reward is Education (clarity), Entertainment (emotional release), or Inspiration (self-belief / action).
-> The reward should feel proportional to the time invested.

# SCRIPT
Describe the full script of the video (1-20 sentences, as many as needed).
-> Structure:
1. Immediate hook (no greeting)
2. Problem framing / tension escalation
3. Why this matters (stakes)
4. Main insight or shift in perspective (this comes AFTER retention is established)
5. Clean close (no rambling; optional CTA only if natural)
-> Include: scenes, actions, voiceover, exact wording if possible.
-> Keep sentences short. Spoken language only.

OVERALL RULE:
THE SHORTER THE ANALYSIS, THE BETTER.
If it can be said in fewer words, it should be.
Clarity > cleverness.
Retention > information.

The last four lines do more work than the rest. Without them the analysis comes back as an essay per video, and twenty-four essays is a thing you will not read.

New concepts instruction

Adapt this video for WHO YOU ARE: WHAT YOU DO, WHO YOU SERVE, WHAT MAKES YOU DIFFERENT IN ONE OR TWO SENTENCES.

Task:
Give us 3 NEW video concepts inspired by the ORIGINAL reference.
Do not copy the original.
Translate the core idea into the CONTEXT OF YOUR NICHE AND YOUR AUDIENCE.
MAINLY iterate and sharpen the HOOKS.

Focus:
- First 3 seconds must stop YOUR BUYER from scrolling
- Hooks should challenge a belief, fear, or misconception they have
- Calm authority > hype
- Emotional credibility > performance
- No shouting, no buzzwords, no exaggeration

The output should have this format:

# CONCEPT 1
Text description (1-3 sentences)

## HOOK
Detailed hook description (1-3 sentences)
Describe:
- What is seen in the first 2 seconds
- What is said in the first line
- Why this hook works specifically for YOUR AUDIENCE

## SCRIPT
Detailed script description (1-20 sentences, as many as needed)
Include:
- Scene flow
- Spoken text / voiceover
- Clear but understated payoff
- Subtle authority, not selling

# CONCEPT 2
...

# CONCEPT 3
...

"do not copy the original" and "translate the core idea" are the two lines that keep this from being plagiarism with extra steps. The mechanism transfers, the subject does not.

Reading the output without fooling yourself

Read the hooks column first and the view counts last. The top row is the most viewed idea, which is not the same as the best one.

One row of the output: what the original did, why it held attention, and a script that does the same thing for your topic.

You get a table sorted by views, each row carrying the analysis and the concepts. The trap is treating the top row as the best idea. It is the most viewed idea, which is a different thing: a 3.5 million view reel may have worked because of who posted it.

What I actually do with a run:

  1. Read the hooks column top to bottom first, ignoring everything else. Patterns show up fast, and they are the transferable part.
  2. Mark the three or four concepts I could film this week without needing anything I do not have.
  3. Throw away anything that only works because of the original creator's audience or face.
  4. Rewrite the hook in my own words before filming. Always. The generated one is a starting shape, not a line to read.
The view worth having open: the hooks that worked next to the hooks that did not, taken from the transcripts rather than the captions.

What it gets wrong

  • Most concepts are mediocre. Expect three or four usable ideas from seventy, and be pleased with that.
  • It cannot see why something worked off-platform. A reel that went viral because of a news cycle looks like a mechanism, and is not.
  • Hooks come back generic if your context is generic. The concepts instruction is the fix, and it is the config people write in one line.
  • The Gemini free tier runs out. Video analysis is the expensive call, and a big run hits the daily cap. The fix is fewer creators per run, not a bigger plan.
  • It will happily analyse a dead niche. If the accounts you picked are not winning, the system faithfully teaches you how to not win.

The same pipeline pointed at other platforms is on The TikTok guide; the version that writes and packages the posts rather than researching them is on The content guide; and if you want to edit the video too, reel studio is on The Instagram editor guide. New to Claude Code entirely? Start with The setup guide.

If you get stuck

The things that actually go wrong, taken from the questions people ask under the video.

The terminal says “command not found: claude”

Installing the Claude Code extension in VS Code does not give you the Claude terminal command. The extension keeps a private copy for its own chat panel. That catches almost everyone, and it is not a broken setup.

To get the command, install Claude Code itself:

# macOS or Linux
curl -fsSL https://claude.ai/install.sh | bash

# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

Then close the terminal window completely and open a new one. Skipping that is the second most common reason it still says not found. Check it worked with Claude --version.

Still not found on a Mac? Your PATH is missing the folder, so run these two lines:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Claude doctor prints a full health report if you are still stuck. And if you would rather never touch a terminal, the Claude Code desktop app does the same job with buttons.

One thing worth knowing before you install anything: Claude Code needs a paid Claude plan (Pro or higher) or an API account. The free claude.ai plan does not include it, so it can install perfectly and still refuse to sign you in.

I typed “cr” and nothing happened, or it says command not found

cr is not a Claude command. It is a shortcut for a longer one, and three things go wrong with it.

It is lowercase. Terminals are case sensitive, so CR is a different word and will never be found.

A shortcut typed straight into a terminal dies when you close that window. To keep it, put the two lines in ~/.zshrc on a Mac, then run source ~/.zshrc.

On Windows, alias does not define anything. In PowerShell alias means Get-Alias, which is why you get ItemNotFoundException. Use functions instead:

function cs { claude "/prime" }
function cr { claude --dangerously-skip-permissions "/prime" }

To keep those permanently on Windows, run notepad $PROFILE and paste them in.

You never need the shortcut at all. Just run the thing it stands for:

claude --dangerously-skip-permissions "/prime"

And read which error you get, because it tells you which piece is missing. command not found: cr means the shortcut is not saved. command not found: Claude after typing cr means the shortcut is fine and Claude Code itself is not installed.

There is no .env file in the folder I downloaded

Correct, and on purpose. .env is where your private keys live, so it is deliberately kept out of the repo. A public folder with someone else's API keys in it would be a gift to whoever found it.

You create it yourself, once. The projects now ship a .env.example to copy:

# macOS or Linux
cp .env.example .env

# Windows PowerShell
Copy-Item .env.example .env

Or just make it by hand in VS Code: click the new file icon in the left panel and name it exactly .env, dot and all. Then paste your keys in, one per line, no quotes and no spaces around the =.

Put it in the project root, the folder that has CLAUDE.md in it, not inside app.

If you cannot see the file after making it, some setups hide files that start with a dot. It is there.

The pipeline fails with “429” or a quota error from Gemini

A 429 means you hit a quota on your Google AI key: too many requests per minute, or the daily cap. It is not a bug in the project, and no, this does not require a paid Gemini plan. The claim going round that the paid tier has a $200 minimum is wrong: that number is a spend limit in Google's docs, not an entry price.

Free ways to get under the limit:

  • Analyse fewer items per run, lower the top-k and max videos
  • Wait and try again: the daily quota resets at midnight Pacific, not 24 hours after your run

Check your own limits at aistudio.google.com/rate-limit. Google stopped publishing the free numbers in its docs, so that dashboard is the only accurate source.

If you get a 404 saying the model does not exist, that is different: Google retires models. List what your key can reach and set GEMINI_MODEL in your .env to one of them:

curl "https://generativelanguage.googleapis.com/v1/models?key=YOUR_KEY"

One warning: Google's pricing page says free tier content is used to improve their products. Do not push client material through a free key.

It says “credit balance too low, add funds”

That message is about the Anthropic API, which is prepaid pay per token. It is not about your Claude subscription, and a Pro or Max subscription never funds an API key. They are two different products with two different bills.

If you meant to use the API, add credit at platform.claude.com under Billing, and switch on auto reload so a long run cannot die halfway.

If you did not mean to use an API key, you probably have one sitting in your environment, and a key set there overrides your subscription login. Check with echo $ANTHROPIC_API_KEY on a Mac. If it prints something, remove it and run /login inside Claude Code to sign in with your subscription instead.

What does this actually cost to run?

Claude Code comes with a Claude subscription: Pro at $20/month, or Max from $100/month for five or twenty times the usage. Usage is included, there is no per-run charge. The free plan does not include Claude Code at all.

Inside Claude Code, /status tells you whether you are on a subscription or an API key, and /usage shows how close you are to your plan limit.

Prices and free tiers move. These were checked in August 2026.

Do I also need to pay for the API keys?

Yes, and it is a separate bill. Mixing the two up is what causes most of the confusion.

The API keys the pipelines use are pay per token, prepaid, and completely separate. A Claude subscription does not fund an API key.

The free tiers genuinely cover trying this out: Apify's free plan includes $5 of usage a month, and a scrape of a few dozen profiles costs cents. Google AI Studio has a free tier for the analysis.

Prices and free tiers move. These were checked in August 2026.

Is --dangerously-skip-permissions safe?

It does exactly what the name says: it turns off the ask-before-acting prompt, so Claude can edit files and run commands on your machine without checking with you each time. That is why it is fast, and that is the whole risk.

The honest version: in a project folder like this one, where you know what is inside and nothing valuable is nearby, it is a reasonable trade. Pointed at your whole home folder, or at a repo you have not read, it is not.

The safer default is to drop the flag. Claude "/prime" does the same work and asks first. You approve a few things at the start, then it stops asking about the same kinds of actions.

Is scraping competitors going to get my account banned?

This reads public posts through a third party scraper. It never logs in as you, never posts, never follows and never messages, so your own account is not the thing making the requests. That is a different risk profile from automating your own logged-in account, and it is the reason it is built this way.

Worth being straight about the rest: Meta's and TikTok's terms restrict automated collection of data from their platforms, whoever is doing it. The practical exposure here sits with the scraping service, not with your profile.

Questions people ask

Do I need to know how to code to use this
No. You download a folder, paste three API keys into a text file, and type one command. Everything after that is plain English in a terminal: to change how the app looks or what it scrapes, you say so and Claude Code makes the change. The only genuinely new skill is being willing to use a terminal.
How much does this cost to run
A paid Claude plan at $20 a month, plus scraping and analysis. Apify gives $5 of credit free every month, Google AI Studio has a free Gemini tier, and the script writing runs through your Claude plan. In a normal month of a few pipeline runs the marginal cost is close to zero. Heavy use pushes you past the free Apify credit first.
How many creators should I track
Between five and ten to start, all in one niche. Fewer than five and you are copying one person's style rather than learning what the niche rewards. More than ten mostly costs you scraping credit for patterns you already saw. Add more once you know which ones are actually teaching you something.
Is scraping Instagram allowed
You are reading public posts, which is the same thing you do by opening the app, and Apify is a mainstream service built for it. Two limits worth knowing anyway: do not scrape private accounts, and do not republish someone else's video. What this system takes is the pattern, the hook shape, the retention mechanism, and those are not anyone's property.
Will the scripts sound like me
Only if you tell it who you are. That is what the concepts instruction is for: your niche, your offer, your audience, the way your videos should feel. Skip it and you get a competent summary of someone else's video. The system produces the structure. The voice is still your job, and the point is that you now have your judgement pointed at the right thing.
Why analyse the video instead of just the caption
Because the caption is not why the reel worked. The hook is the first three seconds of footage, and the retention mechanism is a visual or structural choice you cannot see in the text. That is why the pipeline sends the actual video to Gemini rather than reading the post: the analysis is of what was on screen.
Can I use this for TikTok or YouTube instead
Yes, and that is the real lesson of the project. The pipeline is scrape, analyse, generate, and only the first step is platform-specific. Ask Claude Code to point the scraper at TikTok and it will. There is a TikTok version of this guide on the site that was built exactly that way.