article

Claude Code for AEO: Authoritative content workflows for B2B SaaS

Claude Code for AEO turns AI visibility from manual editing into programmatic workflows using MCP servers and the CITABLE framework. B2B SaaS teams can now run citation audits, map buyer queries, generate structured schema, and track AI attribution without dedicated developer resources.

Liam Dunne
Growth marketer and B2B demand specialist with expertise in AI search optimisation - I've worked with 50+ firms, scaled some to 8-figure ARR, and managed $400k+/mo budgets.
June 16, 2026
15 mins

TL;DR:

  • Claude Code is Anthropic's agentic CLI: it reads files, runs terminal commands, queries live APIs via MCP servers, and writes output back to your codebase, making it the right tool for programmatic AEO at scale.
  • Connecting Claude Code to Ahrefs and Google Search Console via MCP takes one to two days of setup and removes the manual handoff between SEO analyst, content editor, and developer.
  • The CITABLE framework (7 components: Clear entity and structure, Intent architecture, Third-party validation, Answer grounding, Block-structured for RAG, Latest and consistent, Entity graph and schema) is the content standard that makes Claude Code outputs citation-ready.
  • The core workflow runs in five stages: baseline AI visibility audit, priority query mapping, CITABLE content production, schema generation, and monthly attribution reporting, each stage feeding directly into the next.
  • Measurement requires three metrics: citation rate (percentage of tested queries where your brand appears), mention rate (total brand appearances), and share of voice (your citations as a percentage of the competitive set).

In 2025, traditional top-10 Google rankers accounted for 76% of AI Overview citations. By early 2026, that number dropped to roughly 38%. If your team is still optimizing solely for blue-link rankings, a significant share of AI-driven buyer research is reaching conclusions without ever surfacing your brand.

This playbook is for B2B SaaS marketing leaders who understand that AI search matters and now want the operational infrastructure to do something about it. It covers how Claude Code works as an agentic command-line tool, how to wire it to Ahrefs and Google Search Console via MCP servers, and how to apply our CITABLE framework to produce content that LLMs actually retrieve.

Defining AEO for B2B SaaS growth

Answer Engine Optimization (AEO) is the practice of structuring content so that LLMs can extract, verify, and cite it in AI-generated answers. It shares the same foundational activities as traditional SEO: technical work, on-page structure, and off-page consistency. The underlying retrieval mechanism, however, is different enough to shift tactical priorities in content structure, entity definition, and information architecture.

How AEO differs from traditional SEO

Traditional SEO optimizes for document ranking: Google scores pages by authority signals, keyword relevance, and backlink profiles, then returns a ranked list. AEO optimizes for passage retrieval: LLMs use dense retrieval (Karpukhin et al.), matching query embeddings to semantically similar content blocks regardless of exact keyword overlap. A document about "incident response platforms" can retrieve for "alerting tools" because the embeddings are proximate, even without the exact phrase present.

Keyword density and backlink count don't drive passage selection. Extractability does: whether a section independently answers one specific question with the answer in the first sentence. The strategic implications are covered in detail in our SEO vs AEO comparison video.

Where AI engines source your content

Organic search now operates across three surfaces, not one. Web search is where classic SEO plays. Citations are where LLMs retrieve passages to construct answers, the surface where the CITABLE framework applies. Training data is where LLMs build brand associations before any real-time query occurs. Our research on what drives AI citations confirms that performance across all three surfaces compounds.

Google's AI Overview system reportedly fans out a single query into multiple sub-queries, pulling from sources that rank well for each independently rather than the original search term alone. That fan-out mechanism may explain the 38% overlap we tracked in 2026, down from 76% in mid-2025.

Why B2B SaaS teams need AEO now

Zero-click behavior means a buyer can form a vendor shortlist inside ChatGPT, Claude, or Perplexity without ever landing on your site. That consideration phase is invisible to GA4 and HubSpot without explicit attribution capture. Run your first AI visibility audit using this guide to see where you currently stand.

Claude Code as your primary AEO engine

Claude Code is Anthropic's agentic command-line interface (CLI). Unlike the chat interface, it can read files, run terminal commands, query APIs, and write output back to your codebase. That capability set makes it the right tool for AEO automation, where the work involves auditing content structure, validating schema markup, querying search data, and generating structured output at scale.

Integrating tools for AEO workflows

An agentic workflow is one where the AI tool executes a sequence of actions without manual intervention: querying external data, making decisions based on the output, and writing results to files. Claude Code achieves this through the Model Context Protocol (MCP), a standard that lets the tool connect to external data sources via configured server endpoints.

In AEO terms, this means Claude Code can pull live keyword data from Ahrefs, query Google Search Console for impression trends, scan your content directory for structural issues, and return a prioritized audit report, all from a single terminal session. That's the operational difference between using Claude as a writing assistant and using Claude Code as an AEO engine.

Embedding Claude Code in marketing ops

Instead of drafting against a static keyword list, Claude Code can pull the current search term report, identify the 10 queries with highest commercial intent, and generate CITABLE-structured outlines for each, all from a single terminal session with a well-written prompt. This removes the manual handoff between SEO analyst and content editor, which is typically where brief quality degrades.

Using ad search reports to find buyer language

Claude Code can also analyze search term reports from Google Ads or Meta Ads Manager to surface the natural language buyers use when describing their problems. Structuring content around the phrases buyers use inside paid search delivers a citation advantage over content built around keyword volume alone. The 2026 SEO approach video demonstrates this technique step by step.

Infrastructure needs for Claude Code integration

Getting Claude Code running for AEO workflows typically takes one to two days of setup. The sections below cover installation, directory structure, and MCP configuration. If you're a marketing leader rather than a hands-on developer, pass this block to the technical specialist on your team and use it as a checklist for the handoff conversation.

Installation and API key setup

Installation typically requires Node.js 18 or higher. If your current version is below 18, update it using nvm first, then install Claude Code globally:

npm install -g @anthropic-ai/claude-code

After installation, generate your API key at console.anthropic.com and set ANTHROPIC_API_KEY in your shell profile so it persists across sessions.

Organizing your local directory structure

Organize your local directory so Claude Code can access content files, schema templates, and audit scripts without path confusion. Consistent naming conventions matter: if you reference a schema template in an audit script, the path must resolve correctly from the terminal session's root. Keep drafts, schema templates, audit scripts, and monthly reports in clearly named subdirectories.

Configuring MCP servers for Ahrefs data

The Model Context Protocol (MCP) lets Claude Code connect to external data sources via a JSON configuration block. For Ahrefs, the configuration looks like this:

{
  "mcpServers": {
    "ahrefs": {
      "command": "npx",
      "args": [
        "--prefix=<your-global-node-modules-path>",
        "@ahrefs/mcp"
      ],
      "env": {
        "API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

Replace YOUR_API_KEY_HERE with your actual Ahrefs API key. Full setup documentation is available in the Ahrefs MCP server repository. For a full walkthrough of configuring multiple MCP servers into a working AEO stack, see our MCP server setup guide for AEO teams.

Staffing requirements for AEO projects

Running Claude Code for AEO requires a technical specialist to own configuration and MCP setup, an SEO manager to define the query map and audit priorities, and a content editor to work from the CITABLE-structured briefs Claude Code produces. We provide a Starter retainer at €6,995/month, plus proprietary AI visibility tracking, structured data implementation, and up to 20 CITABLE articles per month. Our guide covering the skills each role needs to run AEO with Claude Code breaks down hiring criteria and onboarding sequence for each position.

Applying the CITABLE framework for AEO

The CITABLE framework is the content standard we use to structure material for LLM passage retrieval. Each letter maps to a specific engineering principle derived from how RAG systems select and validate source passages:

  • C (Clear entity and structure): 2-3 sentence BLUF opening that states the answer
  • I (Intent architecture): answer the main question plus adjacent questions readers will have
  • T (Third-party validation): Wikipedia, reviews, news, community signals LLMs trust
  • A (Answer grounding): verifiable facts with sources, not unsourced claims
  • B (Block-structured for RAG): 200-400 word sections, tables, FAQs, ordered lists
  • L (Latest and consistent): timestamps and unified facts across all content
  • E (Entity graph and schema): explicit relationships in copy, not just schema markup

For a detailed walkthrough of applying each CITABLE component using Claude Code prompts and scripts, see optimizing content for citations with Claude Code.

Scaling content to meet AI needs

Scaling citation-ready content is the primary production challenge for most B2B SaaS marketing teams. New content enters AI citation pools within days of publication, based on what we observe across client engagements. That speed advantage only materializes if the content meets the structural requirements on day one.

Verifiable evidence for AI citations

The "A" (Answer grounding) and "T" (Third-party validation) components address how LLMs establish consensus. RAG-based systems (Lewis et al.) reduce hallucination by pulling from external sources, and they weigh sources that appear consistently across independent sources more heavily than single-source claims. Our research on LLM citation mechanics shows that semantic relevance, structural clarity, and entity validation influence citation selection. Every factual claim in your content should link to a primary source, an academic paper, or your own original research.

Positioning content for AI citations

Generative Engine Optimization (GEO) structures content to appear in AI responses across ChatGPT, Perplexity, Gemini, and Claude. It overlaps with AEO almost entirely: both prioritize entity clarity, verifiable facts, and structured formatting. For B2B SaaS, the actionable work is identical: clear entity definitions, answer-first sections, and consistent off-page mentions across Reddit, G2, and industry publications.

Mapping queries to buying stages

The "I" (Intent architecture) component means mapping every piece of content to a specific buyer query at a specific funnel stage. Analyzing your content library against a query map can identify gaps by funnel stage, producing a prioritized content calendar aligned to pipeline potential rather than search volume alone.

Optimizing content for passage retrieval

The "B" (Block-structured for RAG) component is the most frequently violated in legacy content. Dense retrievers perform best on blocks of 200 to 400 words that answer one question independently, with the answer in the first sentence. Sections that drift across multiple topics, or bury the answer in paragraph three, fail the extractability test regardless of how well the overall page ranks.

Structuring data for AI retrieval

The "E" (Entity graph and schema) component makes relationships explicit for AI crawlers. JSON-LD schema for Organization, Product, FAQ, and HowTo markup can be generated programmatically from structured content and templates. This automates the most technically demanding step in AEO content production.

End-to-end AEO workflow in Claude Code

The workflow below is the operational sequence we run for new clients, which can be adapted with Claude Code and the MCP configuration above.

End-to-end AEO workflow

[Audit via Claude Code]
        |
        v
[Query Mapping via Ahrefs MCP]
        |
        v
[CITABLE Content Production]
        |
        v
[Schema Generation via Claude Code]
        |
        v
[AI Visibility Tracker Monitoring]
        |
        v
[Monthly Attribution Report]

Each stage feeds the next: the audit surfaces citation gaps, query mapping prioritizes content to close those gaps, CITABLE production structures content for retrieval, schema makes it readable by AI crawlers, and the tracker measures what changed.

Step 1: Baseline AI visibility audit

Query ChatGPT, Claude, Perplexity, and Gemini with your 20 highest-value buyer queries and record which brands appear. Scripting this process using each platform's API stores output in a structured JSON file for week-on-week comparison. Our AI visibility tracker does this at scale. For a step-by-step walkthrough of running this audit natively inside Claude Code, see the Claude Code AI visibility audit guide.

Step 2: Mapping priority buyer queries

Connect Claude Code to Ahrefs via MCP and pull keyword data for your target queries: volume, keyword difficulty, current rank, and estimated traffic. Cross-reference that against your baseline audit output to identify queries where competitors are cited and you are not. Sort by estimated pipeline value (traffic times conversion rate times average contract value) to build a prioritized content calendar.

Step 3: Structuring data for AI answers

For each priority query, generate both the content brief and the corresponding JSON-LD schema in the same Claude Code session. A working prompt: "Using the query map in audits/query-map.json, generate a CITABLE brief for the query incident response workflow including FAQ schema, HowTo schema, and entity relationships." The output is a brief a content editor can execute and schema a developer can deploy without a separate briefing round.

Step 4: Measuring AI citation lift

Track citation rate (the percentage of tested queries where your brand appears in an AI-generated answer), mention rate (the percentage of relevant queries where your brand appears), and share of voice (your citations as a percentage of all citations in your competitive set). Run the baseline audit, publish the content batch, and rerun 30 days later. The incident.io case study shows what measurable lift looks like: AI visibility moved from 38% to 64%, with a corresponding 22% increase in organic meetings booked. The Claude Code citation tracking workflow covers how to automate this measurement process end to end.

Step 5: Standardizing your entity signals

Off-page consistency is the new link building. Our Reddit and ChatGPT research analyzing AI citations found Reddit appeared in only 0.35% of visible citations but occupied roughly 27% of ChatGPT's internal search slots during query processing. Backlinks remain important for indexing, but a links-only off-page strategy misses the consensus signals that drive AI citation selection. Claude Code can audit your off-page presence by querying Reddit, G2, and Capterra for brand mentions and comparing those claims against facts stated on your own site.

Deploying MCP servers for AEO workflow scaling

Scaling the workflow above requires persistent MCP connections to your data sources. The configuration is a one-time setup that then runs on every Claude Code session. This section is a reference for your technical specialist, the marketing leader's job here is to confirm the data sources are connected before the first audit runs.

Connecting Ahrefs MCP for keyword data

The Ahrefs MCP server exposes keyword volume, keyword difficulty, SERP positions, and backlink data directly to Claude Code. With this connection active, you can prompt Claude Code to pull the top 50 keywords where competitors rank in positions 1 through 10 while your brand doesn't rank in the top 20, returning a structured data file that feeds directly into Step 2 of the workflow.

GSC MCP data for pipeline attribution

The community-built GSC MCP server connects Google Search Console to Claude Code via a Google service account credentials file. With both MCP servers active, you can combine GSC impression and click data with Ahrefs ranking data to diagnose whether traffic drops came from ranking loss, CTR collapse from a competitor earning a featured snippet, or declining search demand. Each cause requires a different response.

Automated citation audit procedures

Write a script that Claude Code runs weekly: query each LLM for your top 20 buyer queries, record which brands appear, compare to the prior week's output, and flag any query where your citation status changed. This replaces a manual process most teams skip because it's time-consuming, converting it into a repeatable terminal command.

Monthly reporting for AI attribution

Structure the monthly board report around three numbers: AI-referred sessions from UTM-tagged links in cited content, self-reported attribution from the "how did you hear about us" field on your demo form, and pipeline value from AI-sourced MQLs. These are probabilistic estimates, not hard counts, and stating that honestly is what makes the board slide defensible.

Measuring citation impact via Claude Code audits

Measurement is where most AEO programs stall. Connecting citation rate to pipeline requires both technical setup and honest communication about what the data can and cannot confirm.

Standardizing AI audit workflows

Make the baseline audit a monthly process using a consistent Claude Code script and query set. Consistency matters more than precision: a slightly imperfect measure run every month is more useful than a perfect measure run once. Different LLMs also retrieve from different source sets. According to OpenAI's documentation, ChatGPT draws from training data plus real-time Bing search. Perplexity cites sources explicitly and weights recency. According to Google's Gemini grounding documentation, Gemini has direct access to Google's index. Running priority queries across platforms in each audit cycle shows where you're strong and where gaps remain.

Measuring AI citation performance

The three core metrics are citation rate (percentage of priority queries where you appear), mention rate (total brand appearances across all queries and platforms), and share of voice (your citations as a percentage of all citations in your competitive set). Our citation research methodology covers how to score these consistently across platforms.

Mapping gaps to revenue potential

For each query gap, calculate the pipeline value: estimated monthly query volume multiplied by AI-referred conversion rate multiplied by average contract value. Even conservative inputs produce significant numbers for high-intent queries in competitive B2B SaaS categories. That calculation gives marketing leadership a business case to present alongside the citation metrics.

Beyond basic SEO: the Claude Code advantage

The difference between passive SEO and programmatic AEO is operational, not philosophical. Both start with the same foundations. Claude Code makes the AEO-specific work fast enough to scale.

Replacing passive keyword strategies

Traditional keyword strategies fail in the era of semantic passage retrieval because they optimize for the wrong signal. Dense retrieval systems match query embeddings to passage embeddings, so a block that clearly answers one question in 150 words outperforms a 2,000-word article that mentions the topic repeatedly without isolating an answer. The 2026 SEO starting guide covers how to audit legacy content for this pattern specifically.

Where programmatic AEO delivers the most value

Claude Code delivers the most value in three specific use cases:

  • Auditing legacy blog posts for extractability failures: buried answers, topic-drifting sections, and missing schema
  • Restructuring technical documentation so product features appear in CITABLE-formatted blocks that LLMs retrieve for comparison queries
  • Building trust signals for LLM training sets by ensuring consistent, verifiable claims appear across Reddit, G2, and industry publications alongside your own site

When to use Claude Code vs dedicated platforms

Approach

Cost

Speed

Technical Depth

Citation Optimization

Manual SEO/AEO

Low per hour

Slow

Limited

Limited

Generic AI writing tools

Low

High volume

None

None

Enterprise AEO platforms

High (custom pricing)

Moderate

High

Comprehensive

Claude Code + Discovered Labs

Transparent, month-to-month

Programmatic

Full-stack with AI/ML team

CITABLE-optimized

The differentiation for Claude Code combined with a dedicated AEO team is codebase-level access and proprietary retrieval research. Enterprise platforms provide dashboards and reporting. Claude Code connects to live search data inside your content operations. Those are different levels of integration. For a direct feature and workflow comparison, see Claude Code vs Cursor for marketing teams.

Overcoming barriers to AI search success

Most Claude Code AEO setups encounter the same handful of issues. None require deep debugging once you know what to look for.

Troubleshooting MCP server auth errors

Forward this section to your technical specialist if MCP connections fail during setup. The most common auth failure typically comes from an API key lacking correct permissions or not being exported as an environment variable. Check three things: that API_KEY is exported in your shell profile rather than set only in the terminal session, that the key has the required scope in your Ahrefs or GSC account, and that the path in the MCP JSON config is absolute and resolves from the working directory.

Benchmarking your AI citation impact

There is no single universal benchmark for citation rate because it varies by category, competition, and query set design. The better practice is to measure your own baseline, then track improvement over time. The pattern we observe across the book of work: initial citation frequency lift can appear within days to weeks post-optimization, with business impact becoming measurable over time.

Making AEO workflows accessible to non-technical editors

Non-technical content editors can run Claude Code workflows using pre-written prompt templates without writing code. The technical setup is owned by a specialist during initial configuration. After that, recurring workflows (citation audits, CITABLE structure checks, schema generation prompts) can run via terminal commands that content professionals can operate from documented scripts.

Syncing AI workflows with existing tech

Add UTM parameters to content you expect to be cited and add a "how did you hear about us" free-text field to your demo request form. Create a HubSpot workflow that segments any contact mentioning "ChatGPT," "Claude," or "Perplexity" into an AI-sourced MQL bucket. Map that bucket to closed-won revenue in Salesforce on a 90-day attribution window. This won't capture zero-click behavior where buyers never visit your site, but it gives you a defensible pipeline number that grows as citation rate grows, enough to build a board-ready attribution story.

Strategic answers to your Claude Code adoption queries

What is the realistic timeline for initial Claude Code setup?

Technical setup typically takes one to two days and includes Node.js installation, API key configuration, MCP server JSON setup for Ahrefs and GSC, and directory organization. Initial citations can appear within days to weeks of publishing structured content, based on what we observe across client work.

Can we use Claude Code without MCP servers?

Yes, but it limits Claude Code to static data in your local directory, removing the real-time search insights that drive active AEO. Without Ahrefs MCP, you lose the ability to pull live query volume or competitor ranking data directly into your workflow, and without GSC MCP, mapping organic click trends to content decisions requires manual export and analysis.

Can non-technical teams run AEO workflows with Claude Code?

Yes. Non-technical editors can run pre-built Claude Code prompt templates and audit scripts without writing any code. The technical setup is a one-time configuration task owned by one specialist, after which recurring workflows run via terminal commands that any content professional can execute.

How do we measure ROI from AI search with Claude Code?

Track UTM-tagged AI-referred sessions in GA4, self-reported attribution from demo forms, HubSpot MQL segmentation, and closed-won revenue in Salesforce on a 90-day window. The incident.io case study shows the benchmark: a 22% lift in organic meetings and AI visibility from 38% to 64%.

How does Claude Code AEO compare to our current agency retainer?

Many traditional SEO agencies deliver blog posts optimized for Google rankings. Our Starter tier at €6,995/month includes up to 20 CITABLE articles, proprietary visibility tracking, structured data, backlinks, and Reddit engagement, optimizing for pipeline-attributed citations rather than traffic vanity metrics.

If your current situation matches what we described above and you want to map your specific citation gaps, book a call with us and we'll tell you honestly whether we're a fit. To go deeper on the content framework before that call, read our canonical CITABLE guide.

Key terms glossary

Dense Retrieval: A semantic search method where AI systems match query embeddings to passage embeddings based on meaning rather than exact keyword overlap. Dense retrievers can outperform keyword-based systems (BM25) on passage retrieval tasks, particularly for queries where exact terms don't appear in the source document.

Model Context Protocol (MCP): A standard that allows Claude Code to connect to external data sources like Ahrefs and Google Search Console via configured server endpoints. MCP enables agentic workflows where Claude Code can query live data and act on it programmatically without manual steps between each action.

Citation Rate: The percentage of tested queries where your brand appears in an AI-generated answer across ChatGPT, Claude, Perplexity, or Gemini. Benchmarks vary by category and competitive set, so establish your own baseline first, then track improvement over time.

Passage Retrieval: The process LLMs use to select content blocks that independently answer one specific question. Retrieval systems prioritize extractability (answer-first formatting, 200 to 400 word blocks) over keyword density.

Entity Graph: The explicit network of relationships between people, products, organizations, and concepts that AI systems use to validate claims and build context. Schema markup and consistent off-page mentions both strengthen entity graphs.

RAG (Retrieval-Augmented Generation): A system architecture where LLMs pull external passages to construct answers rather than relying solely on training data. RAG reduces hallucination and enables real-time citations from the web, and it's the primary mechanism through which AEO-optimized content wins citations.

GEO (Generative Engine Optimization): The practice of structuring content to appear in AI-generated responses across ChatGPT, Perplexity, Gemini, and Claude. It overlaps with AEO almost entirely, prioritizing entity clarity, verifiable facts, and structured formatting.

Continue Reading

Discover more insights on AI search optimization

Jan 23, 2026

How Google AI Overviews works

Google AI Overviews does not use top-ranking organic results. Our analysis reveals a completely separate retrieval system that extracts individual passages, scores them for relevance & decides whether to cite them.

Read article