This guide explains how to use Claude Code for SEO the way we use it on katama.io. Every one of this site’s changes since 27 August 2026 has been made in a Claude Code session, including the keyword research behind this blog and the article you are reading. Most guides on the subject list what the tool could do. This one shows the files, the rules and the costs from a live site, and the mistakes caught on the way.
The same setup serves both SEO and AI search visibility, and this guide is as plain about what the tool gets wrong as about what it does well.
What Claude Code is, and why it is not a chatbot
Claude Code is Anthropic’s coding agent. It runs in a terminal, a desktop app or a code editor, opens the files in a folder, runs commands, and makes changes you approve. A chat window answers questions about your site. Claude Code works on the site itself: it can read every page, write a script against your Search Console data, edit the markup and run the build to check that nothing broke.
Anthropic’s own data shows the difference. In its June 2026 Economic Index report, the median chat or Cowork conversation that produced a blog post or article took 13 rounds of back and forth. The median Claude Code session that produced one contained a single human prompt. It is built to carry a task through on its own, which is exactly why the checks later in this guide matter.
Rounds of human input in the median session that produced a blog post or article
| A chat assistant | Claude Code | |
|---|---|---|
| What it works on | Whatever you paste into the conversation | The files in your project, your data exports and any service you connect |
| What it remembers | The conversation, until it ends | A rulebook it reads at the start of every session, plus notes it keeps |
| What it can do | Suggest | Run commands, write and run scripts, edit pages, build the site |
| What it can break | Nothing, until you copy its output somewhere | Anything it can edit, which is why every change goes through review and version control |
| Best SEO use | Ideas, outlines, a second opinion | Research at volume, audits, sitewide edits, checks you run every time |
Marketing teams are already using it for work shaped like SEO. In July 2025 Anthropic described a workflow its own growth marketing team built: it reads CSV files of hundreds of ads, finds the ones underperforming and writes new variations within strict character limits, producing hundreds of ads in minutes instead of hours. Title tags, meta descriptions and internal links are the same kind of problem.
What you need before you start
- A paid Claude plan. Claude Code needs a Pro, Max, Team or Enterprise plan, or an API account. The free plan does not include it.
- A project it can open. For a hand-built or static site, the folder of files. For WordPress, Shopify or Webflow, an API key or application password, so it can read and update content through the CMS.
- Version control. Git, or at the very least a backup you have tested. Every change Claude Code makes should be one you can see and undo.
- Your data. Search Console access, your analytics, and an account with a keyword data provider if you want search volumes and live results.
- An hour for the rulebook. More on this below. It is the step most guides skip, and the one that decides whether your fortieth session behaves like your first.
Installing takes a minute. On a Mac or a Linux machine, Anthropic’s recommended installer is one line in the terminal:
curl -fsSL https://claude.ai/install.sh | bash
On Windows, run irm https://claude.ai/install.ps1 | iex in PowerShell. Then open a terminal in your project’s folder and type claude. If you would rather avoid the terminal altogether, Anthropic’s desktop app runs Claude Code too. Once it is running, the /init command writes a first CLAUDE.md from what it finds in your project, which is a head start on the rulebook below.
What it costs
| What | Price | Notes |
|---|---|---|
| Claude Pro | $20 a month, or $17 a month billed annually | Includes Claude Code, within the plan’s usage limits. Enough to start |
| Claude Max | From $100 a month | More usage than Pro, for long research runs and sitewide edits |
| Claude Team, standard seat | $25 a seat a month, or $20 billed annually | Includes Claude Code, for a team sharing one setup |
| Keyword and search data | Pay as you go | Our research run of 8,102 keywords and 65 live results pages cost $1.98 through DataForSEO’s API |
| Paying through the API instead | About $13 per person per active day | Anthropic’s average across enterprise deployments, and under $30 a day for 90% of users |
Those are Anthropic’s published prices in October 2026. Check them before you buy, because they change. The cost that matters more is the time a person spends reviewing the output, which no plan includes.
Write the rulebook first
Every Claude Code session starts with a fresh context window: nothing from the last conversation is in front of it. What carries over is a plain text file called CLAUDE.md in the root of your project, which it reads at the start of every session, along with any notes it has saved for itself. Anthropic’s documentation recommends keeping each one under 200 lines, because longer files take up more of the model’s working memory and get followed less consistently.
Ours is 76 lines. It is an orientation, not an encyclopedia: what the site is, the handful of rules that break things when ignored, the commands, and where the longer documents live. It points to a 215 line operating manual and eleven topic documents covering design, content, deployment, the sitemap and the blog’s keyword plan. Here is an excerpt, trimmed:
# CLAUDE.md (excerpt)
- A new page must be added to vite.config.js or it will not ship,
and to public/sitemap.xml and public/llms.txt or search and answer
engines will not hear about it.
- The Google Analytics inline script is allowed by a sha256 hash in
the CSP in vercel.json: edit a single byte of it on any page and
GA stops on that page.
- The nav and footer are duplicated in every page. Change one,
change them all.
- Verify with npm run build plus an actual look at the page.
# docs/BLOG.md (excerpt)
- No invented numbers. Every figure must be read on the primary
source page, not a blog quoting it, and the newest version of a
study wins.
- Every post links up to its parent service inside its first
150 words.
Notice what the rules are about. Not “write great SEO content”, which tells a model nothing, but the specific ways this site breaks: a page that never ships because it was left out of the build, a sitemap that forgets a page, an analytics tag that stops silently because one character changed. Many of the rules are there because the mistake happened once.
One detail worth copying correctly. A line that tells Claude to read another file works only if Claude decides to open it. An import, written as @path/to/file, loads that file into every session. Use imports for anything that must always apply, and remember that imported files count against the same budget as the CLAUDE.md itself.
Keep a decision log
The second file is a decision log: every choice a future session would otherwise have to work out again, with the date and the reason. Ours passed 3,700 lines in under six weeks. When a new session wonders whether an old URL should redirect, or why the sitemap carries no dates, the answer and the reasoning are already written down.
Claude Code can also keep notes of its own, which Anthropic calls auto memory: corrections and preferences it saves as it works and reloads next time. Useful, but treat it as a supplement. The rules you write yourself are the ones you can read, review and keep under version control.
Rules are advice, hooks are enforcement
Anthropic’s documentation is explicit that Claude treats these files as context, not as configuration it must obey. Most of the time that is enough. For the few rules that must never break, Claude Code has hooks: commands that run automatically at fixed points, such as before a file is edited, and can block the action outright. A check that refuses to save a page without a canonical tag belongs in a hook, not in a sentence.
One loop for every change
With the rulebook in place, every SEO task on this site runs through the same loop. The rest of this guide takes the stages in turn.
The loop every SEO change on this site goes through
- CLAUDE.mdRulesThe session opens by reading the rulebook and the decision log.
- APIs and exportsDataKeywords, live results, Search Console, and the pages themselves.
- Claude CodeDraftA brief, an article, a script, or an edit to the markup.
- Primary sourcesCheckEvery figure read where it came from. Every change built and looked at.
- git commitShipOne change per commit, with a message saying what and why.
- Search ConsoleMeasureWhat moved. Each lesson goes back into the rules.
Keyword research and SERP analysis with Claude Code
Keyword research is where Claude Code saves the most time, because the work is mostly fetching, merging and sorting, and it can write the scripts for all three. Here is the run behind this blog’s plan, from 1 October 2026.
- The data. Claude Code called DataForSEO’s API directly, pulling keyword ideas, suggestions and difficulty scores for each of the eight topics this site covers: 8,102 unique keywords, plus the live top ten results for 65 of them. Total cost: $1.98.
- The scoring. For a young domain with little authority, it favoured low difficulty and a high cost per click, since advertisers pay most where buyers are, and checked who holds the top results today.
- The output. A ranked plan of 32 articles, each tied to the service it supports, and a list of keywords not to target yet, with the reason for each.
The “do not target” list turned out to be the most valuable part. It stopped us chasing generative engine optimization, a head term held by Coursera, Google, Semrush and Moz, and pointed us at the comparison and how-to questions a new site can win.
Two traps in keyword data
- Close variants share one number. The provider reports the same volume for every variant in a group. Add them together and a keyword looks several times bigger than it is. Our plan says so in bold.
- Check the numbers that drive decisions. We spot checked the headline volumes against a second call before trusting them.
A prompt in that spirit, to adapt:
Pull keyword ideas for [service] from the keyword API, US English.
Keep keywords with difficulty under 30. For the top 20 by volume,
fetch the live top ten results and tell me who ranks: big brands,
agency blogs, forums. Rank what is left by how winnable it is for a
site with little authority, and give me a do not target list with a
one line reason for each. Never add volumes for close variants.
Briefs and drafts that beat the top results
A draft is only as good as the brief behind it, and a brief is only as good as its reading of the current results. Claude Code can read the top pages for a keyword, list every heading, estimate their depth, score each one and name the gaps, in about the time it takes you to read one of them. We do this before every article, this one included.
It works on published pages too. When we scored our GEO article against the top results for its keyword, it came out at 29 out of 40, three points behind HubSpot’s guide. The gaps it named were research cited without saying whose it was, and an anonymous byline. Both were fixed the same day: every study is now named in the sentence, and the article carries its author.
Draft with it, but never publish its first draft
Ahrefs found that 74.2% of the 900,000 new English pages it checked in April 2025 contained AI-generated text. A competent first draft is now the default, which also makes it the thing that makes a page interchangeable. What lifts a page above the rest is what a model cannot produce: your data, your examples, your decisions, and someone who knows the subject cutting whatever is generic.
Google’s position has not moved since February 2023, when Danny Sullivan and Chris Nelson, writing for its Search Quality team, put it plainly: “Appropriate use of AI or automation is not against our guidelines.” What its spam policies do forbid is scaled content abuse, which they say includes “using generative AI tools or other similar tools to generate many pages without adding value for users.”
Ahrefs’ July 2026 study of 331,000 ranking pages shows how that plays out. Pages that were less than half AI-generated earned two to three times the impressions of pages that were mostly AI, and in a separate sample of about 100,000 pages, they were more likely to be indexed at all.
Share of pages Google indexed, by how much of the text was AI-generated
Ahrefs’ own reading is the useful one: Google is not punishing AI content, it is rewarding quality the way it always has, and AI-generated content is usually lower quality than human writing. Use Claude Code to reach a strong draft faster, then spend the hours you saved on the parts only you can add.
Stop it inventing statistics
This is the failure that matters most in SEO, because a made-up number does damage twice: once with the reader who checks it, and again with every AI tool that repeats it. Language models produce plausible figures and plausible sources with the same confidence as real ones.
The Tow Center for Digital Journalism at Columbia measured how often. In a study published in March 2025, it gave eight AI search tools excerpts from real news articles and asked each to identify the source, 1,600 queries in all. Together they answered more than 60% of them incorrectly, and rarely hedged. More than half of the responses from Gemini and Grok 3 cited links that were fabricated or broken.
Share of queries AI search tools answered incorrectly
Claude Code is a different tool doing a different job, but the lesson carries over: never publish a figure a model gave you until you have read it where it came from. Google says the same. Its guidance on generative AI content, updated on 1 October 2026, is direct: “It is critical to manually factcheck and review all AI-generated content for accuracy and trustworthiness before publishing.” The review, it adds, covers titles, meta descriptions, structured data and image alt text as well as the article.
Our rule for the blog is short.
● The rule
No invented numbers. Every figure is read on the primary source page, not a blog quoting it, and the newest version of a study wins. The article names the organisation in the sentence and describes the study: who was asked, how many, and when.
The rule costs us figures. While researching our GEO article, four widely repeated statistics could not be traced to a primary source: an “83% zero click” figure, AI conversion rates attributed to Similarweb, a “54% better” claim attributed to Adobe, and a pair of traffic ratios. All four were left out. Every number in this article went through the same check, and the sources sit in our records rather than in a footnote.
In practice the check is one more prompt, run before anything ships:
For every number, date, quote and named study in this draft, list
the claim, where it came from, and the URL of the original research.
Open each URL and confirm the figure appears there with the same
meaning. Mark anything you cannot confirm on the original page.
Do not suggest a replacement figure.
The last line matters. It stops the check from swapping one unverified number for another.
Technical SEO, edited in the source
Most Claude Code guides assume WordPress or Shopify, with the agent working through the CMS’s API. That works, and the same principles apply. But if your site is files in a folder, as ours is, Claude Code edits the source directly: the markup, the structured data, the sitemap, the redirect rules. Every change is a commit you can read and reverse.
One audit session on 1 October 2026 shows what that looks like. The site already passed the basics: unique titles and descriptions, one H1 and a canonical tag on every page, valid structured data, and a Lighthouse SEO score of 100. What the session found was underneath.
| What it found | Before | After |
|---|---|---|
| Pages from the old WordPress site, still in search indexes | Every one returned a 404 | The 14 that match a current page redirect permanently |
| Six older redirect rules | Never worked: the host added a trailing slash before matching them | Found, and a rule recorded: every redirect source needs its trailing slash |
| Page headings fading in on load | Largest paint 3.5 seconds on the mobile home page | 1.6 to 1.8 seconds across three runs |
| An oversized logo image | 115 KB for a 46 pixel image | 8 KB |
| Home page weight | 364 KiB | 264 KiB |
| Links to the first blog article | One, from the blog index | Linked from two service page FAQs as well |
The trailing slash is the kind of bug no checklist catches. The redirect rules looked right and had sat in the configuration for weeks; they never fired, because the host rewrote every address before checking them. It showed up only when the session requested the live URLs; the file itself looked fine. That is the habit to insist on. The fix is one character per rule. One of the fourteen, as it sits in the configuration:
{
"source": "/about-us/",
"destination": "/about/",
"permanent": true
}
Structured data, sitemaps and llms.txt
Sitewide markup is where an agent shines, because the same change has to land identically on every page. Our posts carry breadcrumb, article and FAQ structured data. The FAQ markup no longer earns anything special in Google, which stopped showing FAQ rich results on 7 May 2026; we keep it because it describes the page accurately. Claude Code also adds each new page to the sitemap and to llms.txt, a plain summary of the site for language models.
Be clear about what that last file does. Google’s guide to its AI features, updated in July 2026, lists AI text files such as llms.txt among the tactics you can ignore for Google Search, and its changelog adds that they will neither help nor hurt your visibility or rankings. We keep ours for other services that may read it, at almost no cost. Treat any promise that it lifts rankings as false.
The traps that live in configuration
Every site has a few. One of ours: the Google Analytics snippet is allowed by a fingerprint of its exact text in the site’s security policy, so editing a single character of it on any page stops analytics on that page, without an error anyone would see. Nothing on the page tells a new session that. One line in the rulebook does.
If your site runs on a CMS
WordPress, Shopify and Webflow all have APIs, so Claude Code can read and update content there too. Create the narrowest access key the platform allows, have Claude Code save its changes as drafts for a person to publish, and export every page it will touch before it starts, because there is no git history to fall back on.
Search Console beyond the export button
Search Console is the most underused SEO data source there is, partly because the interface limits what you can take out of it. Google’s documentation is specific: the interface exports at most 1,000 rows, while the Search Analytics API returns up to 50,000 rows a day for each site and search type. It hands them over at most 25,000 rows at a time, so a script has to page through them.
Rows of Search Console performance data you can take out
For a small site the export is enough. For anything larger, the long tail lives past row 1,000, and that is where the cheap wins are. Claude Code can write the script that pulls the full data through the API, then do the analysis you would otherwise do in a spreadsheet. Two are worth running every month:
Pull our Search Console data for the last 90 days through the
API, paging until no rows come back. List queries where we rank
in positions 8 to 20 with at least 100 impressions.
Group them by page. For each page, say which queries it already
answers well, which it never mentions, and the smallest change that
would cover them: a heading, a paragraph or an internal link.
Compare the last 28 days with the 28 days before. List the pages
that lost the most clicks, how many they lost, and whether the cause
was fewer impressions, a lower position or a lower click-through
rate. Check the git log for changes to those pages in that period.
There are also ready-made Search Console connectors for Claude Code that let it query the data directly. They are convenient. Read what one does with your credentials before you install it, for the reason in the next section.
More workflows worth running
Four more jobs suit Claude Code well, because each one is mostly reading, comparing and listing, with a person making the final call.
Internal links at scale
Ask it to map every internal link on the site, then find the pages nothing links to and the anchors that repeat the same words for different targets. Our own rules are simple enough to check by script: every blog post links up to its parent service in its first 150 words, every service page links back to the posts that expand on it, and posts on the same topic link to each other once both are live.
Read every page in this project and build a table of internal
links: source, target and anchor text. List pages with no links
pointing to them, posts with no link from their parent service
page, and anchors used for more than one target. Suggest the
smallest set of new links that fixes each problem, placed in
sentences that already exist.
Refreshing a page that has slipped
Point it at a published page and the current top results for its keyword, and ask for the same scored comparison you would run before writing. When our GEO vs SEO guide first scored 29 out of 40 against the field, the brief named two fixes and both went in the same day. Scored the same way four days later, it came out at 33, one point ahead of the strongest competitor. A refresh is simply a brief run on a page that already exists.
Pages competing for the same query
When two of your pages get impressions for the same search, they can split the clicks between them. Search Console data shows it directly.
From the Search Console API, pull the last 90 days by query and
page. List every query where two or more of our pages received
impressions, with each page's impressions, clicks and average
position. For each, say which page should own the query and what
to change on the other: a link to the owner, a narrower focus,
or a merge.
Titles rewritten from real searches
The words people actually type are in Search Console, and pages with plenty of impressions but few clicks often have a title that does not match them. Google’s guidance asks for a human check on titles and meta descriptions too, so review each proposal before it goes live.
List pages with at least 500 impressions in the last 90 days and a
click-through rate below the site average. For each, show the top
five queries, the current title and the meta description. Propose
a title under 60 characters that uses the words searchers use,
without promising anything the page does not deliver.
Skills, hooks, MCP servers and plugins, in plain words
Claude Code can be extended in four ways, and most of the SEO toolkits shared online are one of them, or a bundle of several.
| What it is | An SEO use | |
|---|---|---|
| Skill | A file of instructions, SKILL.md, that Claude loads when the task calls for it or when you type its name | Your content brief procedure, a check before publishing, your house style |
| Hook | A command that runs automatically at a fixed point, such as before every edit, and can block the action | Refuse to save a page that has no canonical tag or meta description |
| MCP server | A connector that gives Claude Code tools from another service | Live keyword data, Search Console, a browser for checking rendered pages |
| Plugin | A bundle of skills, subagents, hooks and MCP servers installed as one unit, usually from a marketplace | A ready-made SEO toolkit |
Anthropic suggests turning a section of your rulebook into a skill once it has grown from a fact into a procedure, because a skill’s instructions load only when they are used. On this machine that means two open-source plugins: claude-seo, a collection of SEO skills and subagents, which produced the brief behind this article, and marketingskills, a library of marketing skills.
Treat third-party skills, plugins and servers as software, because that is what they are. A skill can tell Claude to run commands, and a server can see whatever you connect it to. Read what one does before installing it, prefer the ones published by the data provider itself, and keep API keys out of your project files. Ours stay out of the repository entirely. Anthropic’s documentation is direct about connectors: “Verify you trust each server before connecting it. Servers that fetch external content can expose you to prompt injection risk.”
Guardrails and scheduling
Git is the main safety net, but Claude Code has three more worth using on a live site.
- Plan mode. Press Shift+Tab until the status bar shows plan mode, and Claude reads files and proposes a plan but makes no edits until you approve it. Use it for anything sitewide.
- Checkpoints. Claude Code snapshots the files it edits before each prompt, and
/rewind, or Esc pressed twice, takes you back. It does not track files changed by shell commands, which is why it sits alongside git rather than replacing it. - Permission rules. Deny rules in the settings file block matching commands, such as a deploy or a push, so those stay with a person.
For the monthly Search Console and ranking checks, a schedule beats remembering. Claude Code runs without a conversation when you call claude -p with a prompt, which suits a scheduled job or a GitHub Action, and Anthropic’s Routines, in research preview, run a saved prompt on a schedule in the cloud with the laptop closed. A recurring task started inside a session expires after seven days, so use one of these for anything permanent.
Measure what changed
An agent that makes ten changes a day makes it harder to say which one moved a ranking. Version control solves this almost for free. Every change to this site is its own commit, with a message saying what changed and why, so when a page gains or loses traffic, the history shows exactly what happened to it and when. Here is part of ours, filtered to SEO changes:
d3bb22c Publish the third blog post: how to use Claude Code for SEO
95acdc7 Publish the second blog post: GEO vs SEO vs AEO
8d34ba9 Log the SEO audit fixes and count the privacy page
864ba3d Redirect the old site's URLs that match a current page
c599a9a Drop lastmod and priority from the sitemap
f3ae1f0 Add llms.txt and make the site readable to answer engines
- Search Console, monthly, through the API, with the two prompts above.
- Rankings, quarterly. We re-pull the plan’s primary keywords every quarter, along with the keywords the site has started to rank for. A pull that size costs well under a dollar.
- AI answers, monthly. Rankings no longer tell you whether AI tools name you. Our guide to GEO vs SEO sets out how to build a question set and track AI referrals in Google Analytics.
- Pipeline, always. Traffic that never becomes a qualified conversation is a vanity metric, however efficiently it was produced.
It is too early to report what this setup has done for our own rankings. The blog is days old, and we will not guess. What we can show is the process and what it costs, and we will add results here when there are some worth reporting.
Where Claude Code goes wrong
- Publishing without a review. The draft reads well, which is the problem. Fluent text with a wrong figure or a generic paragraph is still wrong, and still generic.
- Mass-producing pages. Many pages that add nothing for the reader is the definition of scaled content abuse in Google’s spam policies, however good each one looks.
- Trusting one data pull. Volumes, difficulty and rankings vary between calls and between providers. Check the numbers that drive a decision.
- Checking by reading instead of testing. Fetch the live URL, run the build, look at the page. Our redirect bug passed every reading of the file.
- Asking for a fix and getting a redesign. Agents like to improve things. Say exactly what should change and what should not, then review the diff.
- Installing toolkits unread. Third-party skills and servers run with whatever access you give them.
- Letting the rulebook rot. When a mistake happens twice, a rule was missing or unclear. Fix the file, not just the page.
What we do not use it for
Mass-produced pages. Claude Code makes it easy to generate a page for every town, keyword variant or competitor name, and that is exactly the pattern Google’s spam policies call scaled content abuse. We build one page per real service and one article per real question, and use the agent to make each one better, not more numerous.
When Claude Code is enough, and when it is not
It is enough if someone on your team understands SEO, can read a diff, and has a few hours a week to own the rulebook and the review. Claude Code will take the mechanical hours off that person’s week. It will not supply the judgment, and it will not notice that the keywords you are winning bring no buyers.
It is not enough if nobody owns search today, if the site is your main source of pipeline and a mistake would be expensive, or if the real gap sits upstream, in knowing which buyers to win and what they ask. That last one is ideal customer profile work, and no tool does it for you. Search visibility also depends on demand generation creating the searches in the first place.
● About the author
Hamza Hashim is the marketing strategist at Katama. He owns the channel mix and the order it gets built in: what ships first, what waits for evidence, and what gets stopped when the evidence says stop. Meet the team.