SEO

Claude Computer Use agent: monitor your top 20 keyword rankings daily and alert you on Slack when something changes

Claude Computer Use agent: monitor your top 20 keyword rankings daily and alert you on Slack when something changes
Contents

At 7:14 AM on a Tuesday, my Slack pinged: "Keyword 'best running shoes for flat feet' dropped from #3 to #7 overnight." The drop had happened between 1 AM and 5 AM — the Google Helpful Content update rollout window. I had a 2-hour head start over competitors who only check rankings on Monday morning. That alert is the entire reason this post exists, and the reason I now run a Claude Computer Use agent on my own projects as well as client work.

Claude Computer Use (Anthropic's ability for Claude to drive a real browser — clicking, typing, reading screenshots) is built for tasks exactly like this: short, repetitive, visual checks that no clean API exists for. Keyword rank tracking is a perfect fit, and most SEO tools either don't have a public API, or have one so rate-limited it's useless for daily checks. So instead of writing scrapers, I let Claude use the tool the way I would.

Here's the exact setup. It takes about 90 minutes the first time, runs at roughly $0.04 per daily check once stable, and has caught ranking drops I would have missed for weeks.

What we're actually building

A small scheduled job that:

  1. Opens a rank tracking dashboard (SERPWatcher, Ahrefs, or even a free SERP scraper) in a headless browser
  2. Reads the top 20 keyword positions for a domain
  3. Compares them against yesterday's snapshot
  4. Posts a Slack message to a channel with anything that moved more than 2 positions

No code that touches a SERP directly. No fighting with a rank tracker API. The agent drives a real browser like you would, but at 6 AM before you've had coffee.

Step 1 — Pick a rank tracker Claude can actually see

Computer Use works through vision. Whatever tool you use has to have a dashboard with the data visible on screen, not buried five clicks deep.

My shortlist, ranked by Computer Use friendliness:

  • SERPWatcher ( Mangools) — clean single-page dashboard, all 20 keywords visible above the fold, ~$19/mo for 100 daily-tracked terms. This is what I run.
  • Ahrefs Rank Tracker — works, but the data is split across tabs. Claude has to click into each keyword to see the position. Adds 3-4 turns per keyword.
  • Google Search Console + a small custom frontend — most accurate, but you have to build the dashboard. Skip this for the first version.
  • A free SERP scraper like SERPapi's UI or even a Google Sheets =GOOGLEFINANCE-style hack — works for proof-of-concept. Don't ship this to a client.

If you already pay for Ahrefs or Semrush and don't want another subscription, Ahrefs is fine. Expect the daily run to cost closer to $0.10 than $0.04. SERPWatcher is cheaper to run because the agent finishes in fewer steps.

Step 2 — Set up the Slack incoming webhook

Free, takes 4 minutes:

  1. Go to api.slack.com/apps, create a new app, pick your workspace
  2. Enable "Incoming Webhooks", click "Add New Webhook to Workspace"
  3. Pick the channel (I use #seo-alerts)
  4. Copy the webhook URL — it looks like https://hooks.slack.com/services/T.../B.../...

Save that URL in a .env file, not in the prompt. You'll be passing it in to the Slack POST step later.

The message format I use:

json{
  "channel": "#seo-alerts",
  "text": "*SEO Alert — *\n3 keywords moved more than 2 positions overnight:\n• `best running shoes for flat feet`: #3 → #7 ↓4\n• `marathon training plan 16 weeks`: #5 → #8 ↓3\n• `running shoes supination`: #12 → #9 ↑3"
}

Plain text, no Block Kit. Block Kit makes Computer Use turn count go up. Keep it boring.

Step 3 — The Computer Use prompt that actually drives the dashboard

This is the part that took me three tries to get right. Computer Use prompts need three things the average Claude prompt doesn't: a clear stopping condition, an explicit format for what to return, and a fallback when the UI is unreadable.

Here's the role block I use (this is the exact text I prepend):

You are an SEO rank-tracking agent. You will be given a URL to a
rank tracking dashboard, login credentials, a list of 20 target
keywords, and yesterday's positions as a JSON object.

Your job:
1. Log in to the dashboard
2. Navigate to the rank tracking view for the target domain
3. Read the current position for each of the 20 keywords
4. Compare against yesterday's positions
5. Identify any keyword whose position changed by more than 2 places
   (in either direction)
6. Return a JSON object with: { "changes": [ { "keyword": str,
   "old": int, "new": int, "delta": int } ], "unchanged_count": int }

Stopping condition: you have a complete JSON object, OR you have
failed 3 times to read a value (in which case set that keyword's
position to null and continue).

Hard rules:
- Do not click on ads, do not navigate away from the dashboard
- If a value is unreadable (overlapping chart, hidden behind a
  tooltip), say so explicitly and move on
- Never invent positions. null is always better than a guess.
- Return ONLY the JSON object, no prose

The "stopping condition" line is the one that mattered most. Without it, Claude will keep clicking "next page" forever looking for missing data, and your $0.04 run becomes $0.40. With it, the agent finishes in 8-14 turns consistently.

The "never invent positions" rule is the second-most-important. I once caught Claude confidently reporting a #4 position that the dashboard actually showed as #11. The model wanted to be helpful. I had to take helpfulness off the table.

Step 4 — Wrap it in a runner that talks to the Anthropic API

The Computer Use loop is just the standard Anthropic API with the tools array set up for computer actions. Anthropic ships reference code at github.com/anthropics/anthropic-quickstarts — clone the computer-use-demo repo and modify the loop to:

  • Read credentials from environment variables (the dashboard login, the Slack webhook)
  • Save yesterday's snapshot to a small JSON file (/data/rankings-<date>.json)
  • After the agent returns, write today's snapshot to a new file
  • POST to Slack if the changes array is non-empty

Run cost on Sonnet 4 with SERPWatcher: about 8 turns × ~3,500 tokens per turn = ~28K tokens per run. At $3/$15 per million, that's roughly $0.03-$0.05 per daily check. Trivial.

Step 5 — Schedule it

I run mine with a GitHub Actions cron job at 06:00 UTC. The action:

  • Spins up an Ubuntu runner
  • Installs Playwright (the browser Claude drives)
  • Runs the Python runner
  • Commits today's snapshot back to the repo
  • Posts to Slack

A few gotchas:

  • Don't run at midnight UTC — that's when the most rank tracker refreshes happen, and you get flaky reads. 06:00 UTC is after the refresh and before humans are awake.
  • Keep a 7-day rolling window of snapshots in the repo — the diff only needs yesterday, but you'll want the history the first time you debug.
  • Set a hard timeout of 5 minutes on the agent. If it hits the limit, the job posts a Slack message saying "rank check failed at

Step 6 — Decide what counts as "something changed"

This is the part that separates a useful alert from a noisy one. The first version of mine flagged any movement at all. The Slack channel got 14 messages a day. I turned it off within a week.

The threshold I settled on after two months of tuning:

  • Position drop ≥ 3 places → red alert, Slack post immediately
  • Position gain ≥ 5 places → blue alert, daily digest at 8 AM (not immediate)
  • Position drop of 1-2 places → ignore, it's noise
  • Position gain of 1-4 places → ignore, the SERP (Search Engine Results Page, 搜索引擎结果页) moves around more than people think, especially in the bottom half

The 3-place drop threshold catches almost every real incident (algorithm shifts, competitor updates, technical SEO regressions). The 5-place gain threshold catches wins worth celebrating, not random SERP shuffling.

What I'd do differently if I started over

The thing I underestimated was screenshot resolution. The first version of the agent failed 30% of the time on a high-DPI MacBook screenshot — the SERPWatcher numbers were too small to read reliably. I switched to running on a Linux container with a fixed 1280×720 viewport and the failure rate dropped to under 5%.

If you're starting from scratch, don't iterate on the prompt first. Get the browser environment stable first. A pixel-perfect screenshot of the dashboard is the foundation. Without it, the prompt is irrelevant.

The other thing — and I'd skip the Computer Use agent entirely for the first week and just use Claude API with the rank tracker's export feature. Most paid tools have a "Send to Slack" or "Email weekly report" button. Use that. Get the alerts flowing. Get used to receiving the alerts. Then, once you've validated the threshold logic and the channel cadence, swap in Computer Use for the part the export can't do (custom thresholds, custom diff format, the "only alert on drops" logic that most tools don't ship).

One more thing worth saying

Computer Use is overkill for this if your rank tracker has a real API. Most don't, or gate the API behind an enterprise plan. The whole reason this workflow exists is that I tried four rank tracking tools in 2024, and three of them didn't have an API at all. Computer Use is the path of least resistance when the dashboard is the only API.

If Anthropic ships structured tool use improvements later this year — and they will — I'd expect to rewrite this against a proper rank tracker API. Until then, the agent is the cheapest working solution I've found, and the alert has already paid for the development time in a single dropped keyword I caught in time to fix.