← Ledger

How an AI agent's post briefly rolled my site back two months

A Claude session in the cloud started from a two-month-old copy of my blog, and Cloudflare published it over the live site. How it got through, how it was undone, and what stops it now.

Contents
  1. How it got through
  2. How it was undone
  3. The part that needed me
  4. Asking the live site which build it is

Just after midnight on 8 October, an AI agent working in the cloud pushed a blog post to a side branch of my site’s code. It was Claude Haiku, the smallest Claude model. About 40 seconds later Cloudflare, which hosts the site, made that branch the live site. For eight minutes aaronorelup.com was the site as it stood on 2 August, with four posts and none of the thirty-nine I’d written since.

The agent did what its copy of the code told it to. Three settings nobody had looked at since August did the rest, and four separate stops now keep it from happening again.

Quick context. A branch is a separate copy of the code you can change without touching the real one, and the default branch is the one GitHub hands to anyone starting fresh.

The homepage the branch served: AARON ORELUP in monospace over a list of four posts, AO-004 Scythe and serpent dated Oct 08 2026 above AO-002, AO-003 and AO-001 from August The homepage built from main: the night tea house scene with cherry trees, a lantern and the Aaron Orelup welcome card
The same address, two buildsLeft: the cloud branch, rebuilt from its own files on 9 Oct to show what it served. Right: the live site the same day, at the same size.

How it went:

  • GitHub still handed out the August copy. The default branch was an old one called master, with three posts, so the agent numbered its post AO-004.
  • My blog’s rules never left my laptop. The cloud session never saw them.
  • Cloudflare put every branch live. Branch builds ran the same command that replaces the live site.
  • A Claude session on my laptop had the site back 8 minutes after it broke, then fixed what it could reach and asked me before the rest.
  • The site can now say which build it’s running.

How it got through

The default branch. After 2 August I kept working on my real branch, main, and never went back to master. My laptop’s copy was on main, so I never noticed master was still the default.

What a cloud session gets. A Claude Code session on claude.ai starts with a fresh copy of the default branch and nothing else. My blog’s rules sat in a CLAUDE.md, the file Claude reads for instructions, one folder above the code on my laptop. They say to start from main. I’d never committed the file, so it was never saved into the code itself.

What Cloudflare did with a branch. Cloudflare builds the site from the code on every push. “Builds for non-production branches” was on, and those builds ran npx wrangler deploy, the command that replaces the live site. So any branch went straight to the live site.

How it was undone

At 00:42 I asked a session on my laptop running Opus, the biggest Claude model, to fix it:

I had a haiku session post to my blog from the cloud and it accidentally reverted it back to a very old version, could you please correct the mistake and could you figure out why it happened and make sure it never happens again.

It put the last good version back at 00:47:58, 8 minutes 10 seconds after it broke. Then it checked it live, down to a video skipping ahead. That fix was only a day old. After that it made main the default, committed a CLAUDE.md into the code and added a guard that fails the build on any branch but main.

The part that needed me

The guard only lives in the new code, and the session said so plainly. The two old branches didn’t have it, so they could still go live. Fixing that needed my Cloudflare login.

  1. Builds the site from main and puts it live. The last good version.

  2. Saves its post as AO-004 on top of the August copy, master, and pushes it to a side branch.

  3. Builds the branch and puts it live with wrangler deploy. The site now has four posts.

  4. I ask the laptop session to fix it and find out why.

  5. Puts the last good version back. Checks five pages and a video live.

  6. Pushes the build guard and the repo's own CLAUDE.md, then makes main the default branch.

  7. Reports, and asks me before two things: changing Cloudflare's setting in my Chrome, and deleting the two old branches.

  8. yes do the cloudflare setting in chrome and delete the branches

  9. Deletes master and the Haiku branch and notes the commits they can be restored from. Chrome isn't signed in to Cloudflare, so it stops and leaves typing my password to me.

  10. ok I'm signed in

  11. Turns off builds for other branches, changes their command to npx wrangler versions upload (uploads a version, never puts it live), and reloads to check it held.

Now a stale branch has to get past four stops. main is the default, master is gone, Cloudflare only builds main, and the build refuses anything else.

The Haiku session’s own post was never published. Its painting is one of several of the same picture, in the post where nine Claudes paint it.

Asking the live site which build it is

What bothered me was how I found out. The pages looked old, and I only saw it because I happened to look, three minutes after it broke. Nothing said which commit (one saved change to the code) the live site was built from.

Now every build writes /version.json with its commit, branch, time and newest post, and every session is told to check it after a push. This button asks the live site from your browser:

  1. Which build is this page from?
The site's own answerA right answer says branch "main" and a recent commit. Between 00:39 and 00:47 on 8 Oct it would have named the Haiku branch, if the file had existed then.
The commit, the deploy history and the build guard

The commit the cloud session pushed. Its clock is UTC, five hours ahead of mine, so 05:39 there is 00:39 my time.

2ac796e  Thu Oct 8 05:39:08 2026 +0000  Claude
    AO-004: scythe and serpent, painted with claude-paint
    Co-Authored-By: Claude Haiku 5.5

 public/paintings/scythe.png             | Bin 0 -> 3319429 bytes
 src/content/posts/scythe-and-serpent.md |  17 +++++++++++++++++

Two files on top of August. To that commit, the thirty-nine newer posts had never existed.

The laptop session’s first look at the deploy history failed. It ran wrangler deployments list, and Cloudflare’s tool answered that the Worker didn’t exist. The Worker is the site’s program on Cloudflare. The repo’s config names it aaronorelup-blog, and on Cloudflare it’s called blog. Asking for blog gave the history, and the problem with it. Every deploy was made by the same account through the same tool, so nothing marks one as a branch. The commit-to-version pairs come from Cloudflare’s check run on each commit, the build report it posts back to GitHub.

Deployed (Central)VersionBuilt from
7 Oct 22:5034b650ef5170ce2 on main: AO-038’s paintings
8 Oct 00:390075e1af2ac796e on claude/pensive-hamilton-yuqj1a
8 Oct 00:4734b650ef againrollback

The rollback itself was npx wrangler rollback 34b650ef… --name blog. The first turn took 16 minutes in all.

The guard went into the build, and the session tested it both ways before it pushed it. A fake branch build failed and a fake main build passed.

const ciBranch = process.env.WORKERS_CI ? process.env.WORKERS_CI_BRANCH : null;
if (ciBranch && ciBranch !== 'main') {
  throw new Error(
    `Not building "${ciBranch}" on Cloudflare: only main deploys aaronorelup.com. ` +
      'Rebase the branch onto main and merge it there (see CLAUDE.md).',
  );
}