0:00
/
Preview

Stop Paying $199 a Month for SEO + AEO Tools. Build This Claude Code Agent Instead.

Build a Claude Code SEO and AEO research agent that replaces $199/month Ahrefs and SEMrush plans, complete with the full 4-layer blueprint and setup steps.

Table of Contents

  1. Why Does AEO Matter More Than SEO Right Now?

  2. Why I Stopped Paying for Ahrefs and SEMrush

  3. What Is the 4-Layer Blueprint Behind Every Claude Code Agent?

  4. Why First-Hand Experience Is the Real AEO Signal

  5. How Do You Set Up the Integration Layer With Tavily?

  6. How Do You Build the Memory Layer So the Agent Stops Repeating Mistakes?

  7. Why Do the Context-Profile Files Matter More Than the Prompt Itself?

  8. What Does the Agent File Itself Look Like?

  9. Frequently Asked Questions

  10. Key Takeaways

Google is no longer the finish line for content research.

Every SEO tool I’ve ever paid for answers the wrong question. Ahrefs and SEMrush will tell you a keyword gets 2,400 searches a month and has a difficulty score of 34.

What they won’t tell you is what to actually write, or whether an AI answer engine will ever cite it.

In the Episode 18 of our One Shot Show, I sat down with Wyndo to build a Claude Code agent that fixes that gap: a research agent that replaces most of what I used to pay $199 to $299 a month for, and hands back a structured content brief instead of a spreadsheet of numbers.

By the end of this article, you’ll have the full blueprint:

  • the four layers every good Claude Code agent needs,

  • the exact files to create, and

  • a working SEO/AEO research agent you can run on your own topics today.

If you have followed my content research agent build, this is the same no-code approach pointed at ranking and getting cited.

👋 Julley, I’m Dheeraj, an AI systems builder.

I build production-grade AI systems at work by day and ship my own products by night, 9 and counting, including SubflowAI and the Content OS Agents Toolkit. This newsletter is the bridge between those two worlds. Every system, every build, documented step by step.


Join 1,800+ builders getting the exact AI setups, prompts, and workflows that actually work in your business.

SUBSCRIBE


Why Does AEO Matter More Than SEO Right Now?

Answer Engine Optimization (AEO) is the practice of structuring content so AI systems (ChatGPT, Perplexity, Google AI Overviews, Claude) can extract it and cite it as a direct answer, not just rank it as a link. It matters now because search itself is splitting into two different destinations.

Google is pushing AI Mode toward becoming the default experience, and a growing share of queries now get answered directly inside ChatGPT, Perplexity, and Claude instead of a list of blue links.

This is not a fringe idea.

Researchers formalized it as Generative Engine Optimization in a 2024 paper, and Google’s own documentation now describes how its AI features pick sources: the same index and E-E-A-T signals as organic search, favoring pages that are clear, trustworthy, and easy for a model to parse.

If your content only optimizes for the old destination, you’re optimizing for a shrinking share of the traffic.

I showed this live with a simple comparison. I ran “Ladakh stories how to travel” through classic Google search and then through Google AI Mode. Classic search returned a page of links competing for a click.

AI Mode returned a synthesized answer with citations, some of which were reasonably obscure sites that happened to have specific, structured information.

That’s the shift in one screenshot. SEO fundamentals like headings and meta descriptions still matter for how content gets structured. But the game has changed from winning a click to earning a citation, and those require different signals.

Infographic: SEO wins clicks, AEO wins citations. The same query "Ladakh stories how to travel" returns a page of competing blue links in classic Google search, versus one synthesized answer citing structured sites in Google AI Mode. AEO means structuring content so ChatGPT, Perplexity, and Claude can extract and cite it.

SEO cranks on Google to win a click. AEO gets you cited in ChatGPT, Perplexity, Claude, wherever people are asking AI. The tools that only chase the first one are optimizing for a search behavior that’s already shrinking.

Why I Stopped Paying for Ahrefs and SEMrush

Ahrefs and SEMrush are good at one thing: telling you keyword volume and difficulty. Neither tool tells you what to write, what gap to fill, or what format an AI answer engine actually wants to cite.

At $199 to $299 a month for SEMrush’s AEO-capable tier, you’re paying a lot for data with no direction attached.

The agent I built runs on Tavily’s free tier, which gives you 1,000 research credits a month. Each run is capped at about 10 credits, so that free tier covers roughly 100 research runs before you pay a cent.

For a large site doing heavier research, I’m looking at roughly $10 a month.

That’s the cost delta: hundreds of dollars for raw data versus about $10 for data plus a written content brief.

Ahrefs / SEMrush

  • Best for: Keyword volume and difficulty scores

  • Cost: $199 to $299/month for AEO-capable tiers

  • Output: Raw data, no content direction

  • Setup: Instant, but you do all the interpretation

Claude Code SEO/AEO Agent

  • Best for: Structured content briefs with citation gaps

  • Cost: Free (1,000 Tavily credits/month, about 100 runs) to ~$10/month

  • Output: Keyword opportunity, SERP intel, AEO gaps, competitor gaps, recommended format

  • Setup: 30-45 minutes once, reusable forever

Infographic: Ditch $249 a month SEO tools for a $10 agent. Ahrefs and SEMrush cost $249 to $299 a month and hand back raw keyword volume and difficulty you have to interpret. The Claude Code SEO/AEO agent runs on Tavily's free tier (1,000 credits, about 100 runs) and returns a finished content brief, roughly a 96% cost gap.

What Is the 4-Layer Blueprint Behind Every Claude Code Agent?

The 4-layer blueprint is the reusable structure I use for every agent I build in Claude Code, not just this one.

Every agent has the same four layers: a Tool (the data source), a Lens (context that makes the output yours), a Memory (so it stops repeating mistakes), and a Brain (the agent file itself). Tool, Lens, Memory, Brain.

The same structure powers my competitor-analysis agent and the earlier build log of this SEO/AEO agent, and it will power whatever I build next.

Here’s the breakdown:

  1. Integration/data layer - the external tool that feeds the agent real-world information. In this build, that’s Tavily connected via MCP (Model Context Protocol, a standard way for Claude to talk to outside tools).

  2. Memory layer - a memory.md file that captures your preferences and corrections over time, so the agent stops making the same mistake twice.

  3. Context-profile layer - three files (business-context, content-strategy, competitor-watchlist) that turn generic AI output into something that’s specifically yours.

  4. Agent brain - the actual agent file: YAML frontmatter plus a system prompt that tells Claude exactly how to behave.

I put it this way during the session: the context-profile layer is the one most likely to change if you’re building an agent for a different domain. Swap those three files and the same agent points at a new niche. The other three layers barely change shape.

Infographic: Every Claude Code agent has four layers, stacked from the bottom up. Tool (Tavily via MCP, the external data source), Memory (memory.md, which logs corrections so mistakes are not repeated), Lens (three context files: business-context, content-strategy, competitor-watchlist), and Brain (the agent file itself, YAML frontmatter plus the system prompt). Only the Lens changes per domain.

Why First-Hand Experience Is the Real AEO Signal

EEAT (Experience, Expertise, Authority, Trust) is the actual lever behind AI citations, not keyword stuffing. Generic information gets ignored because five other sites already said the same thing in the same way.

Specific, first-hand experience is what an AI model can’t find anywhere else, so it becomes the thing worth citing.

I used this example live: if I say I drove a bike and found a particular place to drink tea in a remote corner of the Himalayas, that’s what AI is going to prefer, because now I’m sharing my experience, which nobody else would have.

Nobody can generate that sentence except someone who was actually there.

This is also why the agent needs to know your authority. I feed mine specific numbers: 185 Ladakh posts, 102 Spiti Valley posts. That count tells the agent (and eventually the AI answer engine reading your content) that you’re not a generic travel blog guessing at a topic.


Learn with me: Claude Code Builder cohort

The founding batch of my Claude Code cohort starts in July on Maven. Four weeks, six sessions. Learn to build the AI system with me.

Only 9 Seats left now. When they’re gone, the founding price ($797) closes and Cohort 2 opens at $1,597.

Use code GENAI20 for 20% off. Expires July 25. Check the Syllabus →


How Do You Set Up the Integration Layer With Tavily?

Tavily connects to Claude Code as an MCP server in about five minutes, giving your agent live web research instead of the model’s static training data. You sign up at tavily.com, copy the MCP connect command, and paste it into Claude Code with the /mcp command, then authenticate via SSO.

Claude Code walks you through the rest of the connection interactively. That’s genuinely all it takes. I’ll admit the setup is simple enough that Claude itself can walk a first-time user through it without me writing a tutorial.

One detail worth knowing: Tavily doesn’t scrape Google’s AI Overview panel directly. Wyndo asked me about this on the show, and I clarified that Tavily researches what AI models are already answering for a topic. That’s still useful.

It reveals citation gaps and opportunities even without a direct feed into Google’s AI Overview.

For my own setup, I actually prefer the Tavily CLI over the MCP connection, because it works system-wide instead of being scoped to one project. For a first build though, MCP is the faster path and the one I’d recommend starting with.

Can You Make an AI Agent Behave Deterministically?

No, not fully, and that’s worth saying plainly before you build anything. Agents are inherently probabilistic. An audience member, Ahad, asked exactly this during the Q&A, and my answer was direct: you don’t get true determinism, you push the probability toward reliable, repeatable behavior.

Three things move that needle: explicit numeric rules in the system prompt (exact call counts, credit caps), requiring source citations for every claim the agent makes, and correcting the agent’s memory when it gets something wrong so the correction sticks.

I’d estimate this setup, done well, gets you to something close to 99.9% reliable, not 100%.


How Do You Build the Memory Layer So the Agent Stops Repeating Mistakes?

The memory layer is a single memory.md file that accumulates your preferences and corrections so the agent doesn’t make the same mistake in every new session. Without it, you’re re-explaining the same rule to your agent every single time you run it, which defeats the entire purpose of automation.

(I went deeper on giving agents memory in this earlier build.)

Here’s what mine actually looks like in practice:

## Preferences
- Prioritize AEO signals over raw SEO volume
- Skip keywords under 50 monthly searches

## Corrections
- Never recommend a listicle format for route guides
- Always ask for a post ID before starting research

## Learned Patterns
- Auto-include format-specific AEO detail (tables, FAQs) for comparison topics

Every correction I’ve ever given this agent lives in that file permanently. If I told it once not to use listicles for route guides, it never suggests one again. That’s the difference between an agent you babysit forever and one that actually gets better over time.


Why Do the Context-Profile Files Matter More Than the Prompt Itself?

The context-profile layer is three files, business-context, content-strategy, and competitor-watchlist, that turn generic AI output into content that’s specifically yours. Without them, your agent produces the same research brief anyone else’s agent would produce on the same topic. With them, it produces research grounded in your actual authority and voice.

business-context.md

  • Identity and ICP (ideal customer profile)

  • Content authority counts (185 Ladakh posts, 102 Spiti Valley posts)

  • Named competitors

content-strategy.md

  • Voice and format preferences

  • EEAT signals to lean on

  • What never to publish

competitor-watchlist.md

  • Specific domains fed directly into Tavily’s include_domains parameter

  • Keeps research scoped to your actual competitive set, not the whole internet

I said this plainly in the session, and I’ll say it again here: if you are not building this context, or spending time to build the context layer for yourself, you are going to continuously babysit your agents over a period of time.

The 30 to 45 minutes it takes to write these three files is the entire difference between a demo and a tool you actually trust.


What Does the Agent File Itself Look Like?

The agent file is a single markdown file with YAML frontmatter (name, description, tools, model) followed by a system prompt built on the RTF framework (Role, Task, Format) combined with few-shot examples and chain-of-thought instructions. This is the “brain” layer, and it’s what actually executes the research.

If you want the formal spec for how these files work, Anthropic documents it under Claude Code subagents.

---
name: seo-aeo-researcher
description: Researches SEO keyword opportunity and AEO citation gaps for a given topic. 
Use when the user wants keyword research, competitor gap analysis, or AI-citation-format recommendations.
tools: Read, Glob, Grep, Write, mcp__tavily__tavily_search, mcp__tavily__tavily_extract, mcp__tavily__tavily_research
model: sonnet
---

The description field carries more weight than people expect. It’s what lets Claude match a plain-language request to the right agent automatically, without you having to name the agent out loud.

Wyndo and I both watched this work live: I typed a research request in plain English, and Claude picked the SEO/AEO agent on its own.

The system prompt itself doesn’t need exotic prompt engineering. RTF plus few-shot plus chain-of-thought covers nearly every agent I build. What actually separates a real agent from a toy is hard numeric constraints: exact call counts (3 Tavily calls, not “a few”), capped credit usage, explicit output structure.

That’s what separates a demo from a real agent.

Infographic: One markdown file is the whole agent. The file seo-aeo-researcher.md holds a YAML frontmatter block (name: seo-aeo-researcher, description: SEO + AEO research via Tavily, tools: Read, Glob, Grep, Write plus the Tavily search/extract/research tools, model: sonnet) and a system prompt built from RTF, few-shot examples, and chain-of-thought, capped at a maximum of 3 Tavily calls per run.

What Happened When I Ran the Agent Live

I ran the finished agent live on “Spiti Valley bike trip 2026,” and it returned structured output covering keyword opportunity, SERP intelligence, AEO citation gaps, competitor gaps, and recommended content formats, in both JSON and Markdown.

The agent ran as a background subagent, which kept the heavy research work out of my main context window.

The output pinpointed real gaps: no featured snippet currently answers the “cost per day” query for that trip, and several People Also Ask questions had no strong answer anywhere in the top results. That’s the kind of direction Ahrefs never gives you.

A keyword score can’t point at that. A specific hole in the existing content is exactly what a well-written article fills, and that is the whole reason to build this.

I’ve pasted the full, unedited output further down, in “See Exactly What One Run Produces,” so you can judge it for yourself.


Frequently Asked Questions

A few questions came up during the live build, and these are the ones people search most when they start on AEO.

What’s the real difference between SEO and AEO?

SEO optimizes to win a click on a traditional Google results page. AEO optimizes to get your content cited as a source inside AI-generated answers across ChatGPT, Claude, Perplexity, and Google AI Mode. Traditional SEO structure still helps, but AEO rewards answer quality and citation-worthiness over keyword targeting alone.

What is generative engine optimization (GEO), and how is it different from AEO?

GEO (Generative Engine Optimization) and AEO describe nearly the same goal from two angles: making your content the source an AI answer is built from. GEO is the term from the 2024 research paper that measures how content gets pulled into generated answers.

AEO is the marketer’s framing of the same outcome. In practice you optimize for both the same way: clear structure, first-hand specifics, and easy-to-extract answers.

How do I get my content cited by ChatGPT and other AI search engines?

Publish specific, first-hand information that does not already exist five other places, then structure it so a model can extract it cleanly: a direct answer in the first sentence, precise entities and numbers, and a clear heading over each answer. Recency helps on engines like Perplexity, so date your facts.

Vague, generic content never earns a citation because the model has ten identical sources to choose from.

How does Google AI Overviews choose which sources to cite?

Google AI Overviews draw from the same index and E-E-A-T signals as regular organic search. There is no separate “AI index.” Google’s own documentation says it favors pages that are clear, trustworthy, and fully answer the query, using precise language a model can parse without guessing.

Satisfy the intent directly and state the answer plainly, and you become eligible.

Do I need Ahrefs or SEMrush to do AEO research?

No. Those tools cost $249 to $299 a month for their AEO-capable tier and only give you raw keyword data.

A Claude Code agent connected to Tavily runs on a free tier of 1,000 credits a month, roughly 100 research runs, or about $10 a month for a large site, and outputs actual content direction instead of just numbers.

Can an AI agent be made fully deterministic?

No. Agent behavior is inherently probabilistic. You increase reliability, close to 99.9% in my experience, through explicit numeric rules, required source citations, and correcting the agent’s memory file over time rather than expecting guaranteed repeatability.

Do I still need FAQs on my articles for AEO?

Yes, but reset your expectations on why. Google dropped the FAQ rich-results dropdown in May 2026, so FAQ schema no longer wins you that visual snippet in the SERP.

FAQPage is still a valid Schema.org type, and a clean question-and-answer block is still one of the most extractable formats for ChatGPT, Perplexity, and AI Overviews. The catch: it only earns a citation if the answers are genuinely specific and first-hand.

Generic FAQ filler that just repeats the article earns nothing.

What are the four layers of a Claude Code research agent?

An integration/data layer (Tavily or another external tool), a memory layer (your preferences and corrections), a context-profile layer (business context, content strategy, competitor watchlist), and the agent brain (YAML frontmatter plus a system prompt). This structure is domain-agnostic and reusable for any agent, not just SEO.

When should I use an agent versus a skill in Claude Code?

Agents run in their own context window, which makes them good for long or background tasks and keeps your main session’s token budget clean. Skills are typically invoked on demand inside your current session. I think of agents as employees and skills as things those employees know how to do.

If you want the full breakdown, I mapped out commands, skills, hooks, and agents here.


See Exactly What One Run Produces

This is the whole point, so look closely. I ran the agent on “Spiti Valley bike trip 2026” and here is the complete brief it wrote, unedited. Not a keyword dump: a writer-ready strategy with the AEO citation gaps, the exact tables to add, and every competitor gap sourced.

One run, about ten Tavily credits.

# SEO / AEO Research Brief: Spiti Valley bike trip 2026

- **Topic:** Spiti Valley bike trip 2026
- **Generated:** 2026-07-08
- **Tavily calls:** 3
- **Source JSON:** `seo-research-spiti-valley-bike-trip-2026.json`

---

## Primary keyword

| Field | Value |
|-------|-------|
| Phrase | Spiti Valley bike trip 2026 |
| Volume | medium-high |
| Difficulty | medium |
| Opportunity | **HIGH** |

**Why:** Page one is dominated by tour-operator booking pages (Travel Coffee, Mototour Ladakh, 
Dream Riders, Golden Eagle, Thrillophilia) plus two personal blogs (FootLoose Dev, Vargis Khan). 
Almost every operator result is a sales page, not a genuine plan-it-yourself guide. 
Clear gap for a first-hand, no-commercial-bias bike-planning post with real Rs numbers, which is exactly our edge.

## Secondary keywords

| Phrase | Where to use |
|--------|--------------|
| Spiti bike trip itinerary 7 vs 9 vs 11 days | Comparison table H2 (top PAA question) |
| Spiti bike trip cost 2026 | Dedicated cost-breakdown table section |
| Spiti bike trip for beginners | Safety / experience H2 |
| best time for Spiti bike trip | Month-by-month section (May–October) |
| Manali to Kaza bike route Atal Tunnel | Route section, post-tunnel timing angle |

## Long-tail keywords

- Is a Spiti bike trip safe for first timers
- Which bike is best for Spiti Valley (Himalayan 411 vs 450 vs Xpulse)
- Spiti bike trip solo vs guided group
- Do Indians need a permit for Spiti Valley bike trip
- Spiti bike trip fuel stops Kaza cash ATM

---

## SERP analysis

- **Top format:** tour-operator booking pages + a few deep personal blogs
- **Avg word count:** ~3,500
- **Featured snippet:** none exists. Win it with a clean 7 vs 9 vs 11 day comparison table and a per-day Rs cost table. 
Operators bury these numbers inside sales pages; a standalone table can win the snippet.

**People Also Ask**
1. How many days are enough for a Spiti bike trip?
2. Is a Spiti bike trip safe for beginners?
3. Which route is better, Shimla or Manali?
4. What is the cost of a Spiti bike trip in 2026?
5. Do Indians need a permit for Spiti Valley?
6. Which bike is best for Spiti Valley?

---

## AEO opportunities (the differentiator)

**How AI currently answers:** Assistants synthesize from operator FAQ blocks (Mototour Ladakh, Travel Coffee, spitivalleypackages.com) and blogs (Vargis Khan, FootLoose Dev). 
Consensus they return: ride May–October, plan 7–10 days, budget Rs 20,000–30,000, use a Royal Enfield Himalayan, Indians need no permit. 
**Missing from citations:** a genuine first-hand self-ride cost breakdown in Rs per day (only Vargis Khan has one, and it is dated), 
current 2026 road-status specifics for Kunzum and the Batal–Gramphoo stretch, 
and a beginner-honest “self-ride vs guided” decision framework that is not a sales pitch.

**Recommended answer format: tables.** The most-summarized queries (cost, how many days, permits, which bike) are all comparison/breakdown questions. 
Tables with specific Rs, km, and altitude numbers are exactly what gets lifted into an AI answer, and precisely what operator sales pages avoid publishing.

**Citation opportunities to build (as tables):**
1. Per-day Rs cost table for a **self-ride** (own / rented bike), split solo vs pillion, current 2026 fuel + dhaba prices.
2. 7 vs 9 vs 11 day decision table (who each suits, buffer days, what you skip).
3. 2026 route-status table: Kunzum Pass open date, Chandratal access, Batal–Gramphoo condition, Atal Tunnel timing.
4. Bike-choice table: Himalayan 411 vs 450 vs Classic 350 vs Xpulse for Spiti terrain.
5. Permits-by-traveler-type table (Indian, foreign national, Pin Valley beyond Mudh, 
new border passes like Shipki La / Lepcha La needing only Aadhaar + DL).

---

## Competitor gaps

- **Vargis Khan:** has a genuine motorcycle cost breakdown (Rs 17,000 solo / 11,000 with pillion, ~1,900 km, 11 days) 
but reads as an older Delhi–Narkanda–Shimla calculation, not refreshed 2026 fuel prices. (`vargiskhan.com/log/spiti-valley-trip-cost-motorcycle`)
- **Thrillophilia:** pure package listings (Rs 19,500–65,000), zero self-ride guidance, no first-hand detail, no local language. (`thrillophilia.com/cities/lahaul-spiti/tours`)
- **IndiaHikes:** no bike/road content for this query at all; does not serve the self-ride motorist audience.
- **Operator FAQ pages (Mototour, Travel Coffee):** answer the common questions but always steer to “book a guided group,” so their cost numbers exclude the true DIY budget.

**Our angle:** Own the self-ride, no-commercial-bias lane. 
Every strong ranking page is either selling a package or is one blogger’s narrative. 
Position this as the practical planning guide with current Rs numbers, a beginner-honest solo-vs-guided call, 2026 road status, 
and Hindi-natural detail (dhaba names at Batal, chai stops, cash-at-Kaza warning) that operators and AI cannot fabricate. 
Lean on 14 years and 102 Spiti posts of first-hand authority.

---

## Meta recommendations

- **SEO title:** Spiti Valley Bike Trip 2026: Route, Cost, Days (Self-Ride)
- **Meta description:** Plan a Spiti Valley bike trip in 2026 without a tour package. 
Real Rs cost breakdown, 7 vs 9 vs 11 day routes, permits, best bike, road status. 14 years of riding.
- **URL slug:** `spiti-valley-bike-trip-2026`

## What to do next

1. Use the table formats above as the article’s core structure.
2. Bake the citation opportunities in specifically, not generically.
3. Use the self-ride differentiation angle as the opening hook.
4. Apply the meta recommendations when publishing.

---

## Sources

[TRIMMED for BREVITY]

That is what you hand a writer. No interpretation, no guessing what to publish. Below, I’ve packaged the exact agent that produced it so you can run it on your own topics in about five minutes.


This Kit Is Part of PluggedIn

You just read the exact brief this agent writes. The scaffold that produced it is one download away.

Get PluggedIn: here's what you unlock

Building the agent file, the three context profiles, and the memory layer from a blank page is a couple of hours of typing before you get a single result. PluggedIn members skip straight to running it, and get every other build kit in the library too.

Get PluggedIn to download the ready-to-run scaffold below and build your own version this week. See what’s included.


Get this SEO AEO Agent Scaffold - Ready to Run

Everything above is enough to build this yourself. This is the shortcut: the exact agent, the three context profiles filled in for a real business, and the memory file, packaged so you can be running it in minutes instead of typing it all out.

Inside the zip:

  • .claude/agents/seo-aeo-researcher.md - the agent, with the 5-step method and the 3-call cap already wired in

  • .claude/context-profiles/ - the three profiles, filled in for a Himalayan travel blog as a worked example you can study

  • memory.md - the memory layer, ready for your first correction

  • templates/ - blank versions of the three profiles, the Tavily mcp-config.json, and a full example output

  • setup-demo.sh - a preflight script that checks the files and wires the Tavily config for you

This post is for paid subscribers