seo on autopilot: +56% impressions, +26% clicks

dec 2026

i built an seo agent for one of my products. these are my notes on how it works, with the numbers, including the parts that didn't work.

the short version: google search console data lands in postgres every day. a claude agent reads it on a schedule, looks for what's missing, decaying, or underperforming, and opens a draft pr with new posts, retitles, and prunes. i review and merge.

since the pipeline started, organic clicks are up 26% and impressions 56%. blog clicks are up about 8× since spring. how much of that is the agent? some, not all. i'll get to that.

before: csv exports

i started by opening search console, exporting a csv, pasting it into a chat, and asking “what should i write next?”

it worked once. it didn't work every week. the export caps rows. the ui only shows 16 months. every session started from zero, with no memory of what i tried last time or whether it helped.

seo is slow. a change today shows up in two to six weeks. i forget, and so does a chat. so i moved the data and the memory somewhere that doesn't forget: a database and a ledger file in the repo.

the pipe: search console → postgres

one cron service is the only thing that talks to google. it uses a service account with read-only search console access. agents never call google directly. they read the database.

flowchart LR
    GSC[Search Console API
analytics + url inspection] Cron[Daily cron
service account] DB[(Postgres
gsc_* tables)] RO[Read-only
query endpoint] Agent[SEO agent
scheduled] PR[Draft PR
posts, retitles, prunes] Me[Me
review + merge] Bing[IndexNow
weekly ping] GSC --> Cron --> DB --> RO --> Agent --> PR --> Me Cron --> Bing style Agent fill:#6366f1 style DB fill:#22c55e style Me fill:#f59e0b

what gets stored, one table per grain:

table key used for
page daily date, url real traffic totals, decay, striking distance
query daily date, query gap finding, intent
page × query date, type, url, query which page google picks for which question
device / country / appearance date, type, dimension mobile vs desktop ctr, rich results
url inspection url, checked at is it indexed, which canonical google chose
sitemap snapshot date, path errors and warnings per sitemap

a few details that took more than one try:

overlap on purpose. every run re-pulls the last 14 days. google revises the most recent ~3 days after the fact. every write is an upsert, so re-pulling is free, and the overlap also absorbs a missed run.

backfill once, to the floor. google keeps about 16 months. the first run reached all the way back, so the history was there before i needed it.

url inspection is a budget. the quota is 2,000 calls a day. the cron spends 1,500 and leaves 500 for manual checks. it inspects in priority order: every blog and static page, then pages in striking distance, then pages whose impressions halved, then top pages, then a rotation through the long tail, oldest-checked first. it stops on a quota error instead of retrying.

the service account has to be a user on the property. if it isn't, google returns zero rows, not an error.

indexnow for bing. once a week the same cron pings indexnow with new posts and striking-distance pages. chatgpt search reads bing's index, so this helps with ai answers too.

it started weekly. i moved it to daily so the data is never more than 1–3 days old when the agent wakes up.

the agent: one skill, one routine

i tried several shapes. a weekly “seo role” that posted to a ledger issue. cursor automations. sub-agents. what stuck was the simplest: one skill file in the repo, one scheduled claude routine, one line of prompt.

the prompt is literally: read the skill file and follow it exactly. if a tool asks for approval or a hook blocks a call, do not retry it another way. say so and stop.

all the judgment lives in the skill file, which sits in the repo with the code. changing how the agent thinks is a pr like anything else.

the agent reads data through a read-only query endpoint backed by a select-only postgres role. max 500 rows per call. it never gets a connection string, so it has no way to write even if it tried.

flowchart TB
    S[Load ledger
last run, cooldowns, verdicts] F{New data
since last run?} Stop[Stop] Inv[Inventory
coverage of existing posts] Short[Short-term lane
gaps, striking distance,
ctr mismatch, decay, rising] Long[Long-term lane
data assets that earn links] Mix[Plan the mix
max 4 posts, never pad] Ship[Write + validate + render
open draft PR] Led[Update ledger
what changed, judge after] S --> F F -->|no| Stop F -->|yes| Inv --> Short Inv --> Long Short --> Mix Long --> Mix Mix --> Ship --> Led style Ship fill:#22c55e style Led fill:#6366f1

what it looks for

the short-term lane has five lenses. each is a sql query plus a rule for what to do about it:

gap. queries earning impressions where no post targets them. keep the ones with 15+ impressions and cluster them. one long-tail query isn't worth a post. a cluster of 120 related queries is.

striking distance. pages at position 11–20. the fix is depth and internal links on the page that already ranks, not a new page that competes with it.

ctr mismatch. position under 10, ctr under 1%. google already likes the page, but people don't click. this is the one case where a retitle is the whole fix.

decay. last 28 days vs the 8 weeks before, position worse by more than 3. judged by cluster, not page, because google often just moved the traffic to a sibling.

rising. impressions doubled in 28 days. write the follow-up while the topic is warm.

the long-term lane is different. it builds data assets: trackers, benchmarks, cohort studies, myth checks. things people link to and ai assistants cite. every run must ship at least one of these, so the agent doesn't spend all its time chasing long-tail queries.

posts are also written for ai search: each section opens with a ~40-word direct answer, then original numbers, tables, and an faq. no llms.txt tricks. this mattered more than i expected: visitors who arrive from ai assistants sign up at about 5× the rate of blog visitors.

guardrails

scope. the agent writes to the blog folder only. no app routes, no page templates, no schema. if the real fix is a template change, it goes in the pr description for me.

draft prs, never merges. hooks block gh pr merge, pushes to main, and deploy clis. the pr body lists the inventory, both lanes, what it picked and why, what it rejected and why, and what it could not verify.

proof before review. every post must pass a validator, render with a 200, link only to pages that exist in production, and come with a screenshot.

the database wins. every number in a post comes from our own data, with a “data as of” date. web sources are context, not truth. old posts never get their numbers refreshed in place; that is a new post.

never pad. if a lane has no real candidate, ship fewer posts and say why. this turned out to be the most important rule. without it, the agent would fill its quota with weak posts.

the ledger: memory between runs

this is the piece i'd build first next time. a json file in the repo records every post created, every retitle with its date and before-numbers, every prune with its reason, and the last data date seen.

it turns the agent from “writes content” into “runs experiments.” a retitled page can't be retitled again for 6 weeks. on the next run after that, the agent compares ctr before and after and writes a verdict: keep or revert. new posts get a check-back date before more of the same kind get written.

it also makes runs skip themselves. if google has no new data since the last run, the agent stops.

what the data taught me

most clicks have no query. about 69% of clicks in the last 4 weeks don't show up in query rows. google hides rare queries. so the agent is told: never sum query rows and call it traffic. use page totals for traffic, queries only for intent.

intent beats position. “review / legit / scam” queries get 4.3× the ctr of “price / cost” queries. part of that is position, but not all of it. people searching price want a number in the snippet, not a click.

impressions are not opportunity. 11 of the top 20 product pages by impressions are about things that earn nothing. the agent's first scoring picked them anyway: lots of impressions, nothing worth writing. now every candidate is cross-checked against business data before it gets a post.

prune what google ignores. a post gets cut only if google declined it, or still doesn't know about it after 3 months, and it had zero clicks in 90 days. cut posts redirect to the closest live page. one run pruned 15 posts and the indexed share went from 74% to 86%. most of that is arithmetic, i know, but fewer dead pages is also a quality signal.

results, honestly

metric change
site organic clicks (4 wks before pipeline vs last 4 wks) +26%
site impressions, same window +56%
site ctr, same window −19%
blog clicks, same window +32%
blog clicks, spring vs now ~8×
blog share of site clicks, 3 months 8.4% → 10.7%
blog posts indexed 74% → 86%
publish → first impression (median) 10 days

ctr fell because impressions grew faster than clicks. more pages show up for more long-tail queries at worse positions. i'm fine with that for now. more pages are getting seen.

since i collapsed everything into one agent, it has opened 4 prs: 10 new posts, 6 retitles, 15 prunes. all 4 merged. none rejected. zero human-written commits in them; two got follow-up fixes from the agent itself after review or ci. time from pr open to merge was hours to a week, so i'm the slow part, not the agent.

now the parts that aren't a win:

causation is fuzzy. lots of other changes landed near each milestone: sitemap splits, caching, product page rewrites, noindexing thin pages. the before/after numbers say what changed, not why.

gap posts have a weak record. one early batch of three did okay. a later batch of six got almost nothing, and four of them were later pruned as never indexed. “people search for this and we have no page” turned out not to be enough on its own. the newest gap posts are too young to judge.

retitles are a wash. of six judged, two got better (one more than doubled ctr), two got worse by more than half, the rest flat or mixed. median change is about zero. the cooldown and verdict system is the only reason i know this instead of believing every retitle helped.

what i learned

the data mattered more than the agent. the agent is only as good as the history it can query. so the daily pull came first, and the agent came after.

the ledger is what made it useful. without memory, every run found the same opportunities again and never learned from the last change.

the judgment works better in a file than in a prompt. the routine prompt is one line. the skill file gets reviewed and changed like code.

letting it do less helped the most. “never pad” and “prune what google ignores” did more for quality than any writing instruction.

i still merge. it writes, measures, and explains itself. i still decide what goes live under the product's name.

next i'll judge the latest retitle batch when its cooldown ends, see whether the newest gap posts do better than the old ones, and lean more on the long-term lane, since ai assistants cite those posts and those visitors sign up the most.


related: an org chart for ai agents (where this agent sits in the bigger setup) · i made an ai agent to replace me for $8 (one agent, one bounded job)