Cindy Zhu.
Free guides
Content creation Claude

Build a viral idea detector with Claude

Hey, it's Cindy ๐ŸŒฑ You commented outlier, so here is the whole build. It pulls the recent posts from the accounts you watch, works out each post's outlier score against that account's own normal.
btw the waitlist for AI System Club is now open! If you're keen on using AI to automate your content, video editing, job search, business or build AI agents, feel free to sign up (only if you want to hehe). Ps. the waitlist gets first dibs:)
the problem

Why the view count lies to you

Instagram counts a view the moment a reel starts to play or replay, which is the platform's own wording in the reel insights help article. So a nine-second loop that one person watched six times contributes six views. Stack that behaviour across a big account and a mediocre post can carry a very impressive-looking number.

Then add the second distortion: you cannot tell from the outside whether a post was boosted with ad spend. Paid reach lands in the same view counter as organic reach. Both of these mean the raw number on a post tells you close to nothing about whether the idea was good, which matters a lot when you are about to spend a week rebuilding it.

โš ๏ธ This is the actual cost of getting it wrong. You do not lose a scroll session, you lose a production cycle. Filming, editing and posting a copy of a post that never really overperformed is a week you cannot get back, and the flat result teaches you the wrong lesson about your audience.

the fix

The two numbers that actually mean something

๐Ÿ“ˆ Outlier score A post's views divided by that account's normal views. It is the same idea vidIQ uses on YouTube, where the score is a video's performance "relative to the average performance of other videos on the same channel" and anything above 10x sits in their top tier. It works at any follower count because it is always self-relative.
๐ŸŒฑ Engagement per view Likes plus comments, divided by views. This is the lie detector. Views can be inflated by replays and by ads, but a like is one per person and a comment costs real effort. When views run away from engagement, the reach was not earned by the idea.

Run them together and the logic is simple: the outlier score finds the posts that broke out, and the engagement check confirms the breakout was real. A post has to pass both before it earns a place in your idea bank.

๐Ÿ’ก Use the median, not the average. One old monster post drags an average up so hard that nothing new ever looks like an outlier again. The median (the middle value when you line the posts up) ignores freak results and gives you a much more honest picture of what normal looks like for that account.

worked example

What the maths looks like on real posts

  1. ๐Ÿ“Š Find the account's normal. Pull that account's last 20 posts and take the median view count. Say it comes out at 5,000. That is the baseline everything gets measured against.
  2. ๐Ÿ” Score each post. A post with 50,000 views scores 50,000 รท 5,000 = 10x. A post with 8,000 views scores 1.6x, which is noise, not a signal.
  3. ๐ŸŒฑ Check the engagement ratio. Work out (likes + comments) รท views for every post, then take that account's median ratio too. Say their normal is 4 likes and comments per 100 views, so 0.04.
  4. ๐Ÿšฉ Compare the outlier's ratio to that normal. The 50,000-view post has 900 likes and 60 comments, so its ratio is 0.019, less than half the account's usual. Ten times the views, half the engagement quality. That is the shape of replay-inflated or boosted reach, and it gets dropped.
  5. โœ… Keep the ones that pass both. A 12x post that also holds its normal engagement ratio is a genuine breakout. That is an idea worth your week.
๐ŸŒฑ Set the pass mark at 0.8. A post keeps its place if its engagement ratio is at least 80% of that account's median ratio. Real outliers often dip a little because they reached beyond the account's regular audience, so demanding 100% throws out good posts. Below 0.8 the gap is too wide to be organic curiosity.

before you build

What you need and what it costs

๐Ÿค– Claude The brain. Claude Code needs a paid plan (Pro, Max, Team or Enterprise) per the official setup docs. There is a no-terminal route below that runs in normal Claude instead.
๐Ÿ•ท๏ธ Apify The data. The Instagram Scraper returns views, likes, comments, captions and timestamps for public posts. Its free plan gives you $5 of monthly credit, and the scraper runs about $2.70 per 1,000 results on that plan.
๐Ÿ“ A watchlist 10 to 20 accounts in your niche. Tighter beats bigger: accounts roughly your size teach you more than accounts a hundred times bigger, because their outliers are reachable.
๐Ÿ“Š Somewhere to read it A CSV opened in a spreadsheet is honestly fine to start. Move it into Notion or a dashboard later, once you know you actually open it every day.
๐Ÿ’ก Do the credit maths before you scrape. $5 of free credit is roughly 1,850 results a month. Fifteen accounts at 20 recent posts each is 300 results per run, so a weekly run fits comfortably inside the free tier and a daily run does not. Start weekly.

setup

Wire it up, about 30 minutes

  1. ๐Ÿ”‘ Make an Apify account. Sign up at console.apify.com, then open Settings and go to Integrations to find your personal API token. Copy it somewhere safe. That token is what lets Claude run the scraper on your behalf.
  2. ๐Ÿ’ป Install Claude Code. On Mac or Linux, open Terminal and paste curl -fsSL https://claude.ai/install.sh | bash. On Windows PowerShell it is irm https://claude.ai/install.ps1 | iex. Both are straight from the setup docs. Then type claude to start it and sign in through your browser.
  3. ๐Ÿ“ Make a project folder. Create a folder called idea-detector on your desktop, then in Terminal run cd ~/Desktop/idea-detector followed by claude. Everything the detector writes stays inside that one folder.
  4. ๐Ÿ“ Write your watchlist. Make a plain text file called watchlist.txt in that folder with one Instagram handle per line, no @ symbol. This is the only file you will ever edit by hand.
  5. ๐Ÿ” Store the token safely. Make a file called .env in the folder containing APIFY_TOKEN=your_token_here, and tell Claude to read the token from there. Never paste an API token into a chat message or into a file you might share.
  6. ๐Ÿ—๏ธ Build the detector. Paste the build prompt below. Claude writes the script, runs it once on a couple of accounts to prove it works, then you point it at the full watchlist.
๐ŸŒฑ No terminal? There is a second route. Apify publishes a hosted connector so any Claude can run its scrapers directly. In the Claude app go to Customize, then Connectors, and add a custom connector pointing at the Apify MCP server (the URL and the walkthrough are in Apify's MCP docs). Sign in through the browser when it asks. You lose the saved script and the scheduled runs, but you can ask Claude in plain English to pull the accounts and score them, and the prompts below still work.

prompt one

The build prompt

This is the whole spec. It is long on purpose, because every rule you leave out is a rule Claude invents for itself, and the whole point of this build is that the maths is not up for interpretation.

๐Ÿ—๏ธ build the outlier detector
Build me an Instagram outlier detector in this folder. Read the Apify API token from the .env file in this folder, and read the account handles from watchlist.txt, one per line.

Write a script that calls the Apify actor apify/instagram-scraper to pull the 20 most recent posts for each handle in the watchlist, capturing at minimum: shortCode, url, ownerUsername, caption, timestamp, likesCount, commentsCount, videoPlayCount and videoViewCount. Cache each raw response to disk in a raw/ folder so re-running the scoring never costs me another scrape.

Then score every post with these exact rules. For each account, calculate the MEDIAN views of its 20 posts and the MEDIAN engagement ratio, where engagement ratio is (likesCount + commentsCount) divided by views. Exclude posts published in the last 48 hours from both medians and from the results, because they are still accumulating. Outlier score is a post's views divided by that account's median views. Keep only posts scoring 3.0 or higher. Then apply the engagement filter: drop any surviving post whose own engagement ratio is below 0.8 times its account's median ratio, because views count replays and can be paid for while likes and comments cannot, so a big gap means the reach was not earned by the idea.

Output the survivors to outliers.csv sorted by outlier score, highest first, with these columns: rank, account, outlier_score, engagement_health (the post's ratio divided by its account's median ratio), views, likes, comments, posted_date, url, and the first 150 characters of the caption. Print a one-line summary to the terminal telling me how many posts were scanned, how many cleared 3x, and how many were then dropped by the engagement filter.

Before you write any of this, tell me your plan in plain English and flag anything in my spec that will not work with the real Apify output schema. Then run it on the first two handles only so I can check the numbers before we spend credit on the full list.
โš ๏ธ Check the first run by hand. Open two of the posts it scored and sanity-check the numbers against what you can see on Instagram. Scrapers drift when platforms change their pages, and a detector quietly returning nonsense is worse than no detector, because you will trust it.

prompt two

Turn the CSV into an idea bank

A ranked spreadsheet is data, not ideas. This second prompt is where it becomes something you can actually film. Run it on the fresh CSV each time.

๐Ÿง  read the board
Read outliers.csv and turn the top 10 rows into an idea bank I can actually shoot from this week.

For each one, give me: the account and its outlier score, what the post is actually about in one sentence, and my read on WHY it broke out, choosing from a specific hook shape, a format, a timely topic, or a strong opinion, and say which. Then give me the transferable pattern in one line, meaning the part that would still work if the topic were completely different.

Then group the ten into themes and tell me if the same underlying pattern shows up more than once this week, because a pattern repeating across several accounts is a much stronger signal than one big post. Rank the themes by how well they fit my niche, which is [YOUR NICHE], and my audience, which is [WHO THEY ARE].

Finally, pick the three I should make and write me a hook line for each in my own angle, not a rewrite of theirs. If any of the ten are only interesting because of who posted them and would not work coming from a smaller account, say so plainly and leave them out of the three.

keep it running

Make it a habit, not a project

  1. ๐Ÿ“… Run it weekly to start. Same morning each week. Weekly fits inside the free Apify credit and gives posts time to finish accumulating views, which makes the scores more stable than a daily run does.
  2. ๐Ÿ—‚๏ธ Keep every CSV. Save each run dated, for example outliers-2026-08-18.csv. After a month you can ask Claude which patterns keep reappearing, which is a far better signal than any single week.
  3. โœ‚๏ธ Prune the watchlist monthly. If an account has produced no outliers in six weeks, it is not teaching you anything. Swap it out for someone closer to your size who is clearly growing.
  4. ๐ŸŽฌ Rebuild the structure, never the script. Take the hook shape and the format, put your own topic, example and opinion inside it. A line-for-line copy reads as a knock-off and almost never performs like the original did.

good to know

4 honest limitations

Scraped views are approximate The scraper returns videoPlayCount and videoViewCount and neither maps exactly onto the Views number you see in the app. That is fine here, because you are comparing posts against each other on the same measure, not quoting absolute figures.
Private and small accounts break it The scraper only sees public posts, and an account with fewer than about 10 recent posts gives you a median too shaky to score against. Set a minimum and skip them.
It cannot see the ad spend The engagement filter catches most boosted posts because paid reach converts worse, but a well-targeted campaign can slip through. Treat a suspiciously round, sudden number with a raised eyebrow.
Old posts keep accruing A four-month-old post has had four months to collect views, so it can look like an outlier against fresher ones. Restrict your runs to the last 30 to 60 days and the comparison stays fair.

the honest bit

Why I stopped trusting my saved folder

I built this because half the reels I had saved as inspiration turned out not to be outliers at all. They were big accounts having a normal day, or replays doing the heavy lifting, and copying them went precisely nowhere. The detector did not make me more creative. It changed which posts I was willing to spend a week studying, and that turned out to be the decision that actually mattered.

the waitlist is now open

AI System Club is launching soon

Build AI systems with me through recorded lessons you can follow at your own pace. Join the waitlist for first access and the founding price.

btw this list gets first dibs
the moment doors open :)