Skip to main content
Claude Cowork

I Replaced My Daily 20-Minute SEO Routine With a Claude Code Scheduled Agent

The scheduled Claude Code routine that replaced my daily Search Console check: full prompt, cron, connectors, and guardrails from a real deindexing.

9 min
Read time
1,617
Words
Published
Last revised
Engr Mejba Ahmed

Written by

Engr Mejba Ahmed

Share Article

I Replaced My Daily 20-Minute SEO Routine With a Claude Code Scheduled Agent

The argument for automating your SEO checks is not the twenty minutes a day they take. It is that manual checks are the first thing you skip when work gets busy, and skipped checks are how small problems become graphs you never forget. I know the exact price of a skipped check: my site's indexed page count once fell from around 7,000 to around 1,700, and because my "daily" Search Console review had quietly become a weekly-if-lucky review, the slide was well underway before I reacted. The cleanup took months.

That is why a scheduled Claude Code routine now runs my morning SEO check at 3 AM, every day, including the days I am sick, traveling, or shipping something else. It performs the same checks I used to do by hand, applies the same thresholds, and emails me a short report I read in two minutes. This post is the whole thing: the prompt, the schedule, the connectors, and the guardrails, each of which exists because of something that actually went wrong.

I Replaced My Daily 20-Minute SEO Routine With a Claude Code Scheduled Agent - overview of what the manual ritual was, the routine's skeleton

What the manual ritual was

You cannot automate a task you have not precisely described. My hand-run morning routine, written out honestly, was six steps:

  1. Open Search Console, view the last 7 days of clicks and impressions by page.
  2. Flag any page with impressions down more than 20% against the prior 7-day window.
  3. Flag queries over 100 impressions sitting at average position 15-30. Those are the "one internal link from ranking" opportunities.
  4. Spot-check click-through on top pages. This site once logged 1.15 million impressions at a 0.7% CTR over a year, which taught me that impressions without clicks are a vanity graph; CTR anomalies are where the actionable titles-and-snippets work hides.
  5. Check index coverage. My site publishes in six locales, so every post is six URLs, and at the worst point about 14,500 pages sat in "Crawled, currently not indexed." Coverage drift is my early-warning system now.
  6. Write three bullets: what dropped, what is climbing, what to do today.

Everything before step six is data gathering. The value was always the three bullets. Twenty minutes of clicking to produce three sentences is exactly the shape of work a scheduled agent should own.

The routine's skeleton

Claude Code's scheduled routines run a prompt on a cron schedule in the cloud, with your connected tools attached; you create one with /schedule from Claude Code or from the routines dashboard. Mine is named seo-morning-report and runs on:

0 3 * * *

Three in the morning UTC, daily, so the report is waiting when I sit down. The prompt has four parts, and the shape matters more than my specific wording: a role, explicit inputs, a numbered procedure, and delivery rules.

Here is the full reference prompt, trimmed only where it names private paths. Swap the site, folder, and thresholds and it is yours:

# ROLE
You are the SEO analyst for mejba.me, a long-form tech blog published
in six locales. Your single job is a concise, honest morning report.

# INPUTS
1. Yesterday's Google Search Console CSV export is in the Drive folder
   "seo-daily", named gsc-YYYY-MM-DD.csv (query, page, clicks,
   impressions, ctr, position; last 7 days).
2. A rolling 28-day baseline is in the same folder as baseline.csv.
3. The sitemap is at https://www.mejba.me/sitemap.xml — fetch it only
   to verify a page exists.

# STEPS
1. Read yesterday's CSV. If it is missing, say so at the top and STOP
   the data section there — do not fabricate numbers.
2. Compute clicks and impressions per page, last 7 days vs prior 7.
3. Flag pages with impressions down >20% week over week.
4. Flag queries with >100 impressions at average position 15-30.
5. Flag pages whose CTR fell >30% with stable impressions (title or
   snippet problem, not a ranking problem).
6. Fetch the top 5 pages by clicks; confirm each returns HTTP 200 and
   contains no internal links that resolve to non-200s.

# ANALYSIS RULES
- Never invent a number. Missing data is reported as missing.
- Cite the number behind every claim: "impressions on /x fell 1,240
  to 870, -30%" — never "impressions dropped."
- No hedging. If nothing changed, say "No significant changes" and end.
- Recommendations must be white-hat: internal links, refreshed
  content, better titles. Nothing else.

# OUTPUT
Email the report, subject "SEO Morning Report — YYYY-MM-DD", markdown,
under 400 words, exactly three sections:
## What Dropped
## What's Climbing
## Today's Actions (max 3 bullets, each starting with a verb)

# GUARDRAILS
- On any failure (missing file, fetch error, auth), send whatever
  sections completed plus an "## Errors" section at the top.
- Retry fetches at most twice.
- Send nothing if the report would be empty.

Every rule in there is a scar. The anti-fabrication lines exist because during testing, with the CSV deliberately deleted, an earlier prompt version produced plausible-looking numbers instead of admitting the file was gone. For an SEO report that failure mode is poison: you would act on fiction. The current version, tested the same way, reports the missing file and stops. If your agent invents data, your prompt is the bug.

Connectors, and how little to grant

The routine needs exactly two capabilities: read one Drive folder, send me email. So it gets exactly two connectors, scoped down:

  • Google Drive: read access to the seo-daily folder only. The agent cannot see the rest of my Drive, which means a prompt injection hiding in a fetched page cannot exfiltrate anything beyond a folder of CSVs it could already read.
  • Gmail: compose and send. It does not need to read my inbox to deliver a report, so it cannot.

Everything else that exists in my connected-tools list (Slack, Notion, GitHub, design tools) is detached from this routine. The rule I follow for every scheduled agent: attach the minimum, because a routine's permission set is its blast radius, and scheduled agents run when you are not watching. This is the same least-privilege logic I apply to interactive sessions in my daily MCP stack, just with less forgiveness, since nobody is sitting there to notice something weird.

One more absolute: no credentials in the prompt. Connectors carry auth separately; the model never sees a key. If you are typing an API key into a routine prompt, stop and rethink the design.

A real morning's output

The shape of what lands in my inbox, numbers softened but structure exact:

Subject: SEO Morning Report — 2026-04-24

## What Dropped
- /ai-agent-cost-guide: impressions 1,420 → 980 (-31% WoW), position
  8.2 → 11.7. Driven by one query. Check the SERP today.
- /claude-code-update-post: impressions flat, CTR 4.1% → 2.6%.
  Title reads like a changelog, not a search result.

## What's Climbing
- /agent-sdk-guide: position 14.3 for its main query, 180 impressions
  this week from zero. One internal link could push it to page one.

## Today's Actions
- Link from the mastery guide to /agent-sdk-guide with descriptive anchor.
- Rewrite the meta title on /claude-code-update-post.
- Check who took the top SERP spot for the dropped query.

Under 400 words, three sections, a number behind every claim. Two minutes to read, and the actions are already triaged. The consistency is the real dividend: the report exists every single morning, in identical format, which makes trends visible in a way my variable, mood-dependent manual checks never were.

Failure modes worth planning for

Months of operation have produced a short, honest list:

  • Connector auth expiry. Tokens lapse; the run fails visibly in the dashboard. Re-authorize, hit "run now" to confirm, done. Turn on failure notifications so you learn immediately, not when you notice a week of silence.
  • Hedging drift. Models slide toward "impressions may have declined somewhat." The "no hedging, cite numbers" rules went in after I caught exactly that in three consecutive test runs.
  • Silent wrong output. The scariest one, because nothing errors. The defense is testing every prompt edit with a manual run before letting the schedule pick it up, plus deliberately breaking inputs (delete the CSV, point at an empty folder) to verify the guardrails hold. Chaos-testing a 60-line prompt takes ten minutes and is the difference between a report you trust and one you re-verify by hand, which would defeat the whole point.
  • Scope creep in the prompt. Because adding a check costs one sentence, the temptation is to add ten. Resist it; a 400-word report you read daily beats a 2,000-word report you skim weekly. New checks earn their place by replacing something.

What this pattern generalizes to

The template is: recurring procedure, defined inputs, written artifact out. Once the SEO routine stabilized, the same skeleton took over my weekly content-freshness audit (scan top posts for outdated versions and broken links, propose fixes) and a weekly index-coverage diff that would have caught my 2026 crash in days instead of weeks. The broader scheduling patterns, including loops and event triggers, are in my write-up of cron scheduling with Claude Code, and the office-work equivalent is covered in scheduled task automation with Cowork.

Two boundaries keep me honest about what to automate. The routine gathers and triages; it does not decide. Rewrites, disavows, content calls stay human. And it monitors the channel, it does not game it: everything it can recommend is an internal link, a refresh, or a better title. If you want the wider toolkit those recommendations feed into, my Claude SEO toolkit breakdown covers the audit side, and understanding AI crawlers versus search bots covers the strategy those numbers plug into.

Start with the check you most reliably skip. Describe it in numbered steps, add the anti-fabrication rules, scope two connectors, and test it by breaking its inputs on purpose. The version of you that does this by hand is not more rigorous than the routine. The routine shows up every day.

My public prompt library holds 850+ prompts I run in production, including the SEO audit family this routine grew out of. Take the prompt above, adapt the thresholds, and let your mornings start with the three bullets instead of the twenty minutes.

Advertisement
Coffee cup

Enjoyed this article?

Your support helps me create more in-depth technical content, open-source tools, and free resources for the developer community.

Related Topics

Engr Mejba Ahmed

Engr Mejba Ahmed

Engr. Mejba Ahmed builds AI-powered applications and secure cloud systems for businesses worldwide. With 8+ years shipping production software in Laravel, Python, and AWS, he's helped companies automate workflows, reduce infrastructure costs, and scale without security headaches. He writes about practical AI integration, cloud architecture, and developer productivity.

Related Articles

Browse All

Comments

Leave a Comment

Comments are moderated before appearing.

Learning Resources

Expand Your Knowledge

Accelerate your growth with structured courses, verified certificates, interactive flashcards, and production-ready AI agent skills.

Sample Certificate of Completion

Sample certificate — complete any course to earn yours

Engr Mejba Ahmed

Engr Mejba Ahmed

AI assistant · trained on my work

👋

Hey there!

Quick Actions

WhatsApp Direct line to me

Chat on WhatsApp

+880 1723 741224 · Replies within the hour on working days

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

mejba.13@gmail.com

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support