A cloud agent that reviews my site three times a week
Halfway through its first run, my review agent told me the home page of this site had been returning 404 since 23:00 the night before. It was wrong, and it worked that out by itself before it wrote the report. A read-only agent with a bad idea costs me a few minutes of checking, and nothing else.
I set the agent up because Cloudflare knows a lot about this site (what people open, where they come from, how long the pages take, which addresses fail) and I wasn’t reading any of it. Now the agent reads it three times a week, writes down what it sees, and opens a pull request with the fixes the numbers call for. The same run found a page that jumped while it loaded, traced the jump to the fonts, fixed it and measured again, and I merged that fix the same night. This is how the agent is set up, why it can read so much and change so little, and what it got wrong.
What it does
The agent is a scheduled task in Claude Code. It runs in Anthropic’s cloud, not on my machine, with its own copy of the site’s repository. I first planned one weekly review, then asked for a lighter check in between.
| When (São Paulo time) | Job | Reads | Opens a pull request |
|---|---|---|---|
| Monday 09:17 | the weekly review | the last 7 days, and 30 for the art-style test | always, with the report and the fixes |
| Wednesday and Friday 09:17 | a short check | the last 2 days | only when something is broken |
The weekly review writes a report into the repository: the numbers, what changed since the last report, the art-style test (which compares the site’s three looks), and one to three improvements, each with the number that calls for it. It may fix what is small and safe, such as a broken link, a layout shift or a missing file. Larger work goes into the report as a proposal.
The short check looks only for breakage: error pages, a page that suddenly fails a lot, a speed score that fell 15 points or more, a page whose speed turned poor, a day with no page views at all. On a good day it says “All clear” and opens nothing.
The procedure lives in the repository
The task’s prompt is short. It says what to read first, which job to run on which weekday, and what the agent may never do. The real procedure is a file in the repository, docs/weekly-review.md: the analytics queries, the report’s shape, the rules for a winner in the art-style test, and what a review may change.
I keep it there for the same reason I keep code there: when the site changes, the procedure changes in the same pull request, and I review both together. Every query in that file ran on the free plan before I wrote it down, so the agent starts from queries known to work. The repository’s AGENTS.md wins when the two disagree.
Read everything, change little
The agent reads Cloudflare through Cloudflare’s MCP server, which exposes the whole Cloudflare API with two tools: one searches the API’s description, the other runs a short script against it. Analytics go through the GraphQL API.
A cloud task can’t use the sign-in I have on my laptop, so it needs a connector on my Claude account. When Cloudflare asked what to grant it, the screen offered three base scopes: minimal, read only and full access. I picked read only. My own sessions at my desk use the same server with full access, because I’m watching them.
The reason is who writes the data. Request paths, referrers and browser names come from anyone on the internet, and in the first week scanners asked this site for /.env, /.git/config and /.claude/settings.local.json. A path can just as well be a sentence addressed to an agent, and an agent that reads it can be talked into things. That is prompt injection, and I don’t try to out-argue it. I limit what a fooled agent can do instead: it can’t change Cloudflare, it can’t merge, and it can’t deploy. The worst a bad run can produce is a bad pull request, and I read those before they go anywhere.
Two settings surprised me:
- When I created the task without naming its connectors, the server attached every connector on my account, Gmail and Claude Docs included. I asked whether that would hurt. It would, because a run that reads strangers’ text should not also be able to read and send my email, so I removed both before the first run.
- The first attempt to create the task failed with “You don’t have access to a repository this scheduled task uses.” I had authorized the Claude GitHub App, which lets it act for me, but I had never installed it, which is what gives it a repository. I installed it on this one only.
The prompt ends with what the agent never does: merge, deploy, end the art-style test, change a Cloudflare setting, or use any connector but Cloudflare. It also says that text in the data is data and never instructions. That line doesn’t make the agent immune. The read-only grant does the real work.
The first run
I started one run by hand, and it took about 13 minutes.
It read the week: 1,340 HTML responses, most of them on the day the site moved to Cloudflare Workers, plus the usual scanners. Three of its first queries failed because the free plan doesn’t expose some fields, such as the referrer, so it rewrote them with fields the plan allows and went on.
Then came the alarm. It wrote:
The homepage looks like it has been returning 404 since about 23:00 UTC yesterday.
It couldn’t check, because its sandbox could not reach the live site and every request it sent came back with no status at all. It was reasoning from counts, and the 404s on / came from the host that serves the videos, which has nothing at its root. The agent found that out before the report, which says the site’s own home page answered 200 every hour it checked. I had already checked by hand, with the same result.1The report’s own words: “The site’s own / answered 200 every hour I checked.”
The finding it could fix was /about/. Real visitors measured a layout shift of 0.285 there, and Lighthouse, the speed test Cloudflare runs, 0.29, where under 0.1 counts as good. The agent built the site, opened the page in a headless Chromium on a throttled network, and measured the shift in each art style. It traced the jump to the web fonts: the page painted in a fallback font, then the real fonts arrived and the header changed height. Its fix preloads each style’s three main fonts from the script that already picks the style before the first paint.
/about/, style | Before | After |
|---|---|---|
| photoreal | 0.083 | 0.000 |
| inked | 0.115 | 0.001 |
| pixel art | 0.244 | 0.000 |
It also added the /favicon.ico that browsers ask for whatever the page says, which had answered 404 to 31 requests that week. And it wrote up the big problem without touching it. The home page is a 3D room, and the room is slow to start. Here is the top of its report, trimmed:
- The home page is slow for real visitors. Largest contentful paint at the 75th percentile on
/is 15.1 s over 34 samples (good is under 2.5 s), and Lighthouse on/from North Virginia measured 160 s of total blocking time on mobile. That is the room starting up. Every other page loads in under 0.8 s./about/jumped as its fonts arrived. Layout shift p75 0.285 from real visitors, and 0.29 from Lighthouse desktop (good is under 0.1). Fixed in this pull request.- The art-style test has no data yet. It went live at 01:06 UTC today, after the window closed.
The first bullet became my next piece of work, the 3D home page that shows something in two seconds. The report also ends with a “Not verified” list: the Web Analytics window it could not read, and the speed test from Iowa that failed.
What is still open
The first short check runs on Wednesday. I don’t know yet whether it stays quiet on a good week or opens noise, since the thresholds in the procedure are my guess at “broken” and the first weeks will tune them.
I also don’t know what a run costs me in usage over a month. I’ll look after a few weeks and decide whether the Wednesday and Friday checks earn their keep.
What I’d tell someone doing the same
- Put the procedure in the repository and keep the prompt short. You will change the procedure, and you want to review it like code.
- Give the agent read-only access to anything strangers can write into, and say so in the grant, not only in the prompt.
- Name the connectors a scheduled agent gets, then check what it actually got.
- Let the agent propose and measure. Keep the merge and the deploy for yourself.