4.6 million docs, 60 errors: how did a "chaos loop" prepare the Claude Docs launch?

Claude Docs engineer Vivek Nair describes the load-testing method in which Claude spent two weeks breaking and fixing staging, its cost and steps for small teams.

Paylaş
4.6 million docs, 60 errors: how did a "chaos loop" prepare the Claude Docs launch?

When Claude Docs opened to everyone on September 16, the service had been running only three weeks earlier as a proof of concept on a single node, used by a few thousand people inside Anthropic. The team's own estimate said millions of docs would arrive in the first few days. By September 22, more than 4.6 million docs had been created, and across 2 billion requests there were only 60 server errors. The team never had to roll back.

Vivek Nair, one of the engineers behind the service, explained how in a post on the claude.dev blog on November 17. The method is called a "chaos loop": Claude ran nonstop for two weeks trying to break the service on purpose, then fixing whatever broke. This article walks through the method, the choices that worked, the cost and how a small team could try it.

The problem: preparing for launch traffic you don't have

A few thousand internal users on one machine said nothing about whether the service would survive launch, and there was no launch traffic to test with. According to the author, the team wanted real evidence to decide how fast it could roll out. A classic load test runs a scenario and leaves the result to a person; here Claude ran the scenario, read the result, wrote the fix and restarted the test.

How the loop was built

On September 4, about two weeks before launch, Claude was handed a staging cluster that mirrored production. The cluster produced more than a million synthetic docs a day, and Claude's job was to break core components on purpose. The setup was a single Claude Code session left running: pick a scenario, run the harness, read the telemetry, propose a fix, ship it to staging, repeat. That session acted as a coordinator and handed most of the work to sub-agents, usually about 11 at a time in the busiest week and 30 at the peak. The coordinator also consulted, through Slack, the agents of other Anthropic infrastructure teams that had scaled similar services.

The scenarios were deliberately paranoid: 10 million new docs in one day, 22,000 live connections reconnecting at once, one hot doc with hundreds of viewers, a server killed while loading a doc, and a stalled database. Each iteration pushed one feature, such as doc creation, to saturation. Claude read the telemetry through Datadog and came back with a short menu of options and a recommendation.

If the recommendation was easy to undo, Claude wrote the change, deployed it to staging and reran the test. Every operation in the service was instrumented; each database query, for example, reported its name and how many rows it scanned versus returned, so Claude could spot a bad query and rewrite it.

Where the human stays: decisions that are hard to undo

Before the loop started, the author told Claude which decisions needed his approval: anything hard to undo, such as changing the database schema or key layout, or how a doc is stored. When Claude hit one of those, it stopped and asked, usually with a recommendation. The author writes that schema changes are exactly the kind he wanted to be consulted on, because there are usually several reasonable answers and changing direction later is painful.

Throughout testing, Claude had to respect two invariants. Docs had to open almost instantly, even those with a long history. And once the server acknowledged an edit, tests had to show the edit was still there.

Making the service legible to Claude

The author cites an idea from his colleague Felix Rieseberg: ask Claude for the outcome you want rather than individual tasks. Instead of fixing crashes one by one, ask it to make the app crash-free. That requires setting up the code so Claude can pull crash reports on its own and check its own fixes. The team did two things.

A diagnostic loop. On every iteration Claude read the telemetry and added whatever it thought was missing. Writing telemetry by hand is tedious, so it usually goes in after something breaks; here Claude wrote it as it went. Memory is the best example. Early on, one large doc used about 3 GB on its pod. Claude's first attempt was to shrink a cache; the next run showed the memory was really in a separate cache inside a dependency, so Claude dropped the change. With finer memory profiling it eventually found that every keystroke copied the doc into several data structures, adding a few MB each time. Claude switched those structures to copy-on-write so they share one reference. After about three days, the same doc topped out around 180 MB, and the estimate for launch dropped from more than 500 memory-optimised pods to about 50.

Legible technology choices. The team wanted every number Claude measured to trace back to code it wrote. According to the author, models hill-climb best with a clean signal, and a garbage collector adds noise because memory and latency shift on its schedule. So the service was written in Rust: with no garbage collector, all of a doc's memory sits in structures the team defined, and when memory grows Claude can point to the one responsible and change it. Dependencies were kept to a minimum, and the few that were needed were vendored so they could be read and measured. The author notes Anthropic also has strong Go tooling and that the two languages were not compared head to head. He adds that Rust is hard for people to write, but since Claude writes it well, that matters much less now.

Launch week

The service held at launch scale. The first million docs came in about 30 hours. The team rolled production 629 times in September and never rolled back. According to the author, seven of the ten scenarios rehearsed in staging actually happened in production. By then the fixes were already behind runtime flags, so when part of the infrastructure came under pressure, flipping a flag was usually enough.

Why it works now

The author writes that this probably would not have worked a few months earlier. Older models were fine at reading telemetry, but ten or twenty iterations into a long loop they would start forgetting the goal, and he had to restate it. Inside Anthropic this is called goal drift. He says he used an internal research model roughly comparable to Claude Fable 5.2, and that it held the invariants across many context compactions without being reminded. He also points to Vercel, which made Turborepo up to 96% faster with a similar supervised agent loop.

What it cost

At Claude Fable 5.2's list price as of November 2026, the author says he used roughly 125,000 dollars of inference from late August to launch day. He estimates that work on this scale would have taken a team of engineers about six months a couple of years ago. Most of the spend went to reading telemetry, writing proposals, generating fixes and reviewing code. He adds two caveats: the launch was especially large, and infrastructure that only makes sense at that scale took more reasoning; and he burned many tokens figuring out the process, so with what he knows now he thinks about half would have been enough.

How a small team can try it

According to the author, the method also works for much smaller services and should cost far less. For a classic small-team stack of a couple of Kubernetes nodes and a Postgres instance, his rough estimate for a similar two-week push is 3,000 to 10,000 dollars at the same list price, and he says plainly that he has not run it. His suggested steps:

Give Claude access to your telemetry; most observability providers have an MCP server it can use. Have Claude write a load script that throws ten times your real traffic at staging and breaks things on purpose; killing an instance, stalling the database and deploying in the middle of a spike are good starting points. Then let Claude keep fixing whatever falls over. When choosing your stack, lean toward whatever Claude can measure most easily. Write down your most important technical invariants and give them to Claude before you start. For anything hard to undo, have Claude stop and offer a few options with a clear recommendation. The coordinator and sub-agents sped things up, but if they burn too many tokens per hour, the author says a single agent also works well.

Sources: claude.dev blog post