Every Monday I used to open Search Console and do the same manual scan: which pages lost clicks, where impressions climbed but CTR fell, which queries were drifting in position. Roughly two hours, every week, doing pattern-matching a script could do faster than me.
So I built the script. Here’s exactly what it does and how it’s wired, because the how is the part most “I use AI” posts skip.
The job I was actually trying to remove
The valuable signal in Search Console isn’t the top-line number. It’s the divergence — pages where impressions are rising but CTR is falling. That gap is almost always a positioning or intent mismatch: you’re surfacing for a query you don’t quite answer. Those are the highest-leverage fixes, and they’re tedious to find by eye across hundreds of rows.
I didn’t want a prettier dashboard. I wanted the prioritised fix list, delivered, without me opening anything.
What I built
I used Claude Code — Anthropic’s terminal-based agent that reads files, writes code, and runs commands in your local environment — to build a small pipeline. Not a chat window; an agent that actually executes.
The flow:
- Pull. A script hits the Search Console API and pulls the last 7 days and the prior 28 days of query- and page-level data into a local CSV.
- Diff. It computes the change in clicks, impressions, CTR and average position per page, week over week.
- Flag. It isolates the specific pattern I care about: impressions up, CTR down. Those rows get tagged as optimisation priorities. Pages dropping position past a threshold get a second tag.
- Reason. The flagged rows get passed to Claude with my niche context loaded, and it writes a one-line diagnosis per page — likely intent mismatch, title not matching the surfacing query, that kind of read — plus a suggested fix.
- Deliver. The output lands as a ranked Markdown list in a Slack channel every Monday at 7am.
I built it in an afternoon. Claude Code wrote most of the API handling and the diff logic while I described the rules. The part that took thought wasn’t the code — it was defining which divergence actually matters, because that’s the marketing judgement the script can’t have on its own.
Why this isn’t just “Claude wrote me a script”
Two things make it hold up.
First, the reasoning step is loaded with context the tool keeps reusing. I’m not re-explaining my niche or my intent framework every run. The rules live in the system once and apply every Monday — which is the difference between automation and just having an AI handy.
First-pass code is rarely the bottleneck anyway. The leverage is in encoding the judgement: what counts as a problem, in my niche, for my goals. That’s the asset. The script is just the delivery mechanism.
Second — and this is the part people building these underrate — it’s a rules-validate-then-reason architecture, not a “let the AI look at everything” one. The deterministic diff does the heavy filtering first. The model only reasons over the rows that already passed a hard rule. That keeps it cheap, fast, and honest: the AI isn’t hallucinating which pages dropped, because a plain script decided that. The AI only explains why and suggests what next.
That ordering — rules filter, AI reasons, human approves the edge cases — is the pattern that actually scales. The reverse, where you hand a model the raw data and hope, is the one that quietly breaks.
The result
Two hours of Monday-morning manual work, gone. More usefully: I now catch CTR-divergence on pages within a week instead of whenever I happened to scroll far enough to notice. The fixes get made while the drift is small.
The honest caveat: it surfaces priorities, it doesn’t fix them. The judgement on whether to rewrite a title or restructure a page is still mine. I wouldn’t want it any other way — that’s the part worth a marketer’s time. The scan was never worth my time. Now it isn’t anyone’s.
If you want to build your own
You don’t need a developer background, but you do need to be able to state your rules precisely. Start by writing down, in plain language, the one divergence in your data that you currently hunt for by hand. That sentence is the spec. Hand it to the agent and let it build the plumbing around it.
The tool is the easy part. Knowing what to look for is the job.



