Claude Code SEO: Run an SEO Pass From Your Coding Agent (With Hard Limits)
Claude Code SEO done safely: a run that reads Search Console, plans a capped worklist of new pages, merges and noindexes, and ships one pull request.
Claude Code SEO works when the agent gets two things it does not have by default: real Search Console data, and hard limits on what it may change. Give Claude Code a skill that reads your site's search data through a CLI, works a worklist with fixed quotas, lets code (not the model) decide which pages qualify for a merge or a noindex, and ships everything as one pull request. Then the agent does the SEO chores and you review one diff.
This page walks through that setup using the rules of the SEO run that PageSeeds Hosted runs on customer sites each week, from a skill file that Claude Code, Kimi or Grok can run. If you want the general idea of a terminal SEO agent first, read what an SEO CLI is. This post is about the Claude Code side: what the agent does in a run and what it is not allowed to do.
Why a coding agent needs rails before it touches SEO
Ask Claude Code to "improve the SEO of this blog" with no data and no limits, and you get confident guesses. It rewrites titles that were already earning clicks, invents keywords, and touches forty files at once. Each edit can look reasonable. Together they are an unreviewable change set with no baseline to measure against.
Three things fix that:
- Ground truth. The agent reads Google Search Console impressions, clicks and position through CLI tools that print JSON. The skill's first rule is that the agent never invents numbers.
- A budget. A small, fixed number of changes per run, so the pull request stays reviewable.
- Code decides the risky moves. Which pages qualify for a merge or a noindex is computed from Search Console data by the CLI, not chosen by the model.
The hard limits
| Rail | What the agent may do | Why |
|------|----------------------|-----|
| Quotas | By default at most 3 new articles, 2 merges and 5 noindexes per run (your run.yaml) | A reviewable pull request |
| Fresh data | The run refuses to start on a stale or short Search Console tape | An unknown is never treated as zero |
| Site-drop gate | A scheduled run is skipped while Search Console shows an impressions cliff or missing data | Don't make changes on top of an outage |
| Merges | Only a pair of pages that share real queries on both pages, where the page being redirected does not out-earn the one kept | Earlier merges chosen on a shared keyword alone lost traffic |
| Noindex | Applied by code at the end of the run, only to old pages with no clicks in 90 days and little visibility (under 100 impressions, or ranking below position 30); skipped if a click arrived since the plan | Pages that earn clicks are never noindexed |
| Fact check | Every new or merged page passes a truth review before it ships; a blocked page is left out of the pull request | The agent cannot make up numbers or claims |
| Workspace | All writes go into a separate git worktree; the run closes with a pull request that holds only the files the rows own | Nothing reaches the live checkout without review |
| Product code | No edits to the tool's own source mid-run | The agent operates the tool, it doesn't patch it |
What one run looks like
A run is a fixed sequence. Claude Code works it from the skill, and a weekly scheduler starts it.
- Start. The run refreshes Search Console data, checks it is fresh and complete, classifies every published page (earning, growing, merge, prune), and plans a worklist inside a fresh git worktree.
- Create rows. For each planned keyword the agent gets a writing brief, writes the article, and submits it. Submission validates structure and registers a draft; publishing is a separate explicit step that runs the fact check.
- Merge rows. For each planned pair the agent folds the source page's unique content into the page being kept. The CLI re-checks the Search Console evidence and refuses the merge if it does not hold.
- Prune rows. No agent work: the CLI marks the planned pages noindex when the run finishes.
- Finish. The finish step ships one pull request. Its description reports what shipped, what was skipped and why, and last week's clicks and impressions.
The agent does not wait for approval between steps. You approve once, by merging the pull request.
Worked example on a small site
Say Search Console shows this for a 40-page blog (illustrative numbers):
| Page | Impressions (90d) | Clicks (28d) | What the run does | |------|-------------------|--------------|-------------------| | /blog/setup-tutorial | 310 | 4 | Nothing: it earns clicks, so it is protected | | /blog/old-comparison | 15 | 0 | Noindex (old, no clicks, almost no impressions) | | /blog/pricing-a + pricing-b | 90 / 60 | 0 | Merge only if both pages show the same queries with enough impressions | | (new) keyword from your research | n/a | n/a | Write one article if it is in scope for your site |
The worklist is capped by the quotas, so even a large backlog yields a small pull request.
Building the same setup yourself
- Give the agent data. A script or CLI that pulls Search Console impressions, clicks and position per page and query, and prints JSON the agent can read.
- Write the skill. A Markdown file the agent loads: the run sequence, the rules above, and what it must never touch.
- Put the limits in a config you own. Goal, topics you want and don't want, brand terms and quotas, in a file in the repo, so the code that plans the run enforces them rather than the model.
- Run it in a worktree. The agent writes on a separate branch, and the run ends with one pull request.
- Review the PR. The description should list every row with the numbers behind it.
If you would rather not build and maintain this, PageSeeds Hosted runs this pass on your site every week and sends the pull request to your repo. No setup and no API keys on your side.
Claude Code SEO vs a dashboard tool
| | Coding agent + SEO run skill | SEO dashboard | |---|---|---| | Output | Pull request with MDX changes + report | Charts and a to-do list | | Data | Your Search Console, read through a CLI | The vendor's crawl and keyword index | | Who executes | The agent, within fixed quotas | You, later | | Risky moves | Evidence-gated by code | Up to you | | Measurement | Last week's Search Console numbers in every PR | Rank tracking |
A dashboard is still useful for broad keyword research. For the recurring "what do we change this week" loop, the agent plus rails is faster. See the 120-minute weekly SEO workflow for the manual version of the same loop, and what an AI SEO agent ships for where dashboards still win.
When this setup is the wrong call
- No Search Console data yet. Without Search Console history covering most of the last 90 days there is nothing reliable to plan from, and the run refuses to start. Write pages first; the run becomes useful once the site has data.
- A large site with an SEO team. Small quotas are a deliberate ceiling. A team shipping dozens of changes a week needs a different process.
- You won't review PRs. The pull request is the review step. If nobody reads it, the rails can't protect you.
FAQ
Can Claude Code do SEO?
Yes, if you give it real data and a bounded job. On its own a coding agent can edit MDX and metadata, but it has no Search Console data and no limits. Run it with a skill that reads Search Console through a CLI, works a capped worklist, and ships the result as a pull request you review.
What should a coding agent never do on its own for SEO?
Anything that is hard to undo without evidence. In the PageSeeds run, a merge is only offered when two pages share real Search Console queries, a page that earns clicks is never noindexed, and slugs of published pages never change. The agent works the rows the CLI planned; it does not invent its own.
How many changes should one AI SEO pass make?
Few. The PageSeeds run plans at most 3 new articles, 2 merges and 5 noindexes per run by default, set in a small config file you own.
Does the agent edit my live site directly?
No. Writes happen in a separate git worktree and land as a pull request. Nothing reaches the live checkout until you merge it.
Does this only work with Claude Code?
No. The same skill file runs in Claude Code, Kimi or Grok. The limits live in the skill and the CLI, not in the model.
Want this run on your site every week? PageSeeds Hosted reads your Search Console and sends the work to your repo as one pull request. Get started — $99/month → More tools for this workflow are in the SEO tools hub.
$99/month per site
Frequently Asked Questions
Can Claude Code do SEO?
Yes, if you give it real data and a bounded job. On its own a coding agent can edit MDX and metadata, but it has no Search Console data and no limits. Run it with a skill that reads Search Console through a CLI, works a capped worklist, and ships the result as a pull request you review.
What should a coding agent never do on its own for SEO?
Anything that is hard to undo without evidence. In the PageSeeds run, a merge is only offered when two pages share real Search Console queries, a page that earns clicks is never noindexed, and the page you keep keeps its URL. The agent works the rows the CLI planned; it does not invent its own.
How many changes should one AI SEO pass make?
Few. The PageSeeds run plans at most 3 new articles, 2 merges and 5 noindexes per run by default, set in a small config file you own.
Does the agent edit my live site directly?
No. Writes happen in a separate git worktree and land as a pull request. Nothing reaches the live checkout until you merge it.
Does this only work with Claude Code?
No. The same skill file runs in Claude Code, Kimi or Grok. The limits live in the skill and the CLI, not in the model.