Claude Code SEO Agent
The complete playbook to replace $200/mo Ahrefs subscriptions with one Claude Code agent
For DTC brands & agencies — fully automated keyword gaps, competitor analysis, brand-voice content, and weekly ranking tracking
🚀 Overview
This agent runs the entire SEO loop inside Claude Code (Projects + Artifacts). It connects to Google Search Console, uses Apify for competitor scraping, maintains brand voice profiles, and generates weekly action plans.
• One-time brand interview
• Client website URL
• Competitor breakdowns
• Weekly content plans
• Optimized articles
• AI shopping listings
• Google Search Console API
• Apify actors
• Built-in Claude reasoning
📁 Skill Files (Claude Code Artifacts)
1. seo_agent_core.py
# Core SEO Agent Class
class SEOAgent:
def __init__(self, client_name, gsc_property):
self.client_name = client_name
self.gsc = GSCConnector(gsc_property)
self.brand_voice = load_brand_profile(client_name)
self.apify = ApifyClient()
def weekly_cycle(self):
rankings = self.gsc.get_rankings(days=7)
gap_keywords = self.find_gap_zone(rankings) # positions 5-20
competitors = self.apify.scrape_serp(gap_keywords)
analysis = self.analyze_competitors(competitors)
content_plan = self.generate_content_plan(gap_keywords, analysis)
return content_plan
def find_gap_zone(self, rankings):
return [k for k in rankings if 5 <= k['position'] <= 20]
2. brand_voice_profile.json (per client)
{
"client": "Example DTC Brand",
"tone": "warm, confident, slightly playful",
"values": ["sustainability", "transparency", "joy"],
"forbidden_words": ["cheap", "best ever"],
"sentence_style": "short sentences mixed with longer storytelling",
"examples": [
"We spent 18 months sourcing the perfect organic cotton..."
]
}
3. competitor_analyzer.md
# Competitor Analysis Prompt Template
Analyze these top-ranking pages for keyword "{keyword}":
{scraped_content}
For our client {client} with brand voice {voice}:
1. Content gaps
2. Unique angles we can own
3. EEAT signals they use
4. Exact fixes we should implement
🗣️ One-Time Brand Interview Script
Run this once per client. Claude stores the output as the permanent brand voice profile.
1. Who is your ideal customer? Paint a picture of their life.
2. What are the top 3 problems you solve for them?
3. What makes your product different from competitors? (Be brutally specific)
4. What tone/voice do you want? (examples: playful like Glossier, authoritative like Patagonia)
5. Share 3 recent customer testimonials or reviews.
6. What brand values are non-negotiable?
7. Any words/phrases you never want used?
8. How do you want to position against big competitors?
After interview: Ask Claude to generate brand_voice_profile.json and save it in the project.
📅 Exact Weekly Workflow (Monday Morning Ritual)
Run:
agent.weekly_cycle()Pulls last 7 days of impressions, clicks, and average positions.
Filters for keywords in positions 5–20 with decent search volume & relevance.
Actor: SERP Scraper or Website Content Crawler
Analyze top 3–5 ranking pages for each gap keyword.
Output format: One Notion-style card per opportunity with difficulty, opportunity score, recommended title, and outline.
Claude uses the saved profile to write full articles or product descriptions. Export as Markdown → publish.
Prompt: "Rewrite this product description so it ranks in ChatGPT, Gemini, and Perplexity recommendations."
One beautiful weekly summary with:
- 📈 Ranking movements
- 🎯 New opportunities
- ✍️ Content published this week
- 🔄 Next week's priorities
⚡ Advanced Capabilities
- Ranking Feedback Loop: Every week, successful keywords are weighted higher in future plans.
- Multi-Client Mode: One Claude Project can handle 5–20 clients with separate voice profiles.
- AI Shopping Optimization: Generates schema + natural language answers for "best X for Y" queries.
- Content Refresh Triggers: Flags pages that dropped >3 positions for quick updates.
💡 Implementation Tips
- Use Claude 3.5 Sonnet or Opus inside Claude Code Projects.
- Store all client data in Artifacts folder structure:
/clients/{client_name}/ - Set up Apify account and store API key in Claude environment.
- For GSC, use official Google API + service account (easy in Python).
- Deliver reports via Notion, Email, or shared Google Doc.

Comments