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.

Inputs • GSC property access
• One-time brand interview
• Client website URL
Outputs • Keyword gap cards
• Competitor breakdowns
• Weekly content plans
• Optimized articles
• AI shopping listings
Tools Used • Claude Code Artifacts
• 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.

Interview Questions:

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)

1
Connect GSC & Pull Data
Run: agent.weekly_cycle()
Pulls last 7 days of impressions, clicks, and average positions.
2
Identify Gap Zone Keywords
Filters for keywords in positions 5–20 with decent search volume & relevance.
3
Scrape Competitors with Apify
Actor: SERP Scraper or Website Content Crawler
Analyze top 3–5 ranking pages for each gap keyword.
4
Generate Keyword Action Cards
Output format: One Notion-style card per opportunity with difficulty, opportunity score, recommended title, and outline.
5
Write Content in Brand Voice
Claude uses the saved profile to write full articles or product descriptions. Export as Markdown → publish.
6
Optimize Product Listings for AI Shopping
Prompt: "Rewrite this product description so it ranks in ChatGPT, Gemini, and Perplexity recommendations."
7
Deliver Client Report
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

Popular posts from this blog

Neuroscience-Backed Wealth Building

Why the Perfect Valentine's Gift Isn't One Scent—It's Two

**🔥 Breakthrough Harvard Study Reveals: Your Immune System Needs This Powerful Detox Boost! 🔥**