The Rewrite Took a Week. Trust Took Five Months.

About 98 percent of the tests passed. About a quarter of real traffic matched.

Those two numbers describe the same software in the same month. In April, Anthropic’s new Rust implementation of the Messages API — the primary way customers, and Anthropic’s own apps such as Claude Code, reach Claude — was passing about 98 percent of roughly 700 integration tests. Run the same requests through the Python and Rust versions side by side, and only about one in four produced the same prompt for the model. The suite said the port was finished. Production said it was a quarter finished.

The gap is the story. Anthropic published the account on November 25, and the headline most people took from it was that Claude rewrote a production API. That is true, and it is the least interesting fact in the post. Messages API traffic had grown about 1,800 times from early 2024 to fall 2026, and an earlier partial rewrite — the output parser, in Rust, called from Python — had cut CPU by 8 to 10 percent while making every token cross between the two languages three times. In 2024, when one engineer suggested Go or Rust, another settled it: “We are not rewriting the API in go or rust!” By May 2026 Claude was writing more than 80 percent of the code Anthropic merged, and Claude wrote a first version of the core request path in about a week.

Public traffic moved to Rust in September. The service now uses about 70 percent less CPU per request, and median time to first token fell about 20 percent, with no outage and no pause in feature work. The CPU figure comes from one region and the latency figure from customers’ Claude Code requests over a shorter window, so treat both as the company’s own measurements. Between the week and the September date sit five months, and nearly all of it was verification.

Why the Tests Could Not Answer the Question

Anthropic’s summary of the problem is one sentence: “Verification, not generation, had become the bottleneck.” The existing suite had about 700 integration tests, and two properties made it unable to certify the port. Neither property is specific to Anthropic.

The tests were coupled to the implementation. Each one sent a request, checked the reply, and checked what was forwarded to other services. The tests ran the Python API inside the test process and mocked billing and rate limiting in Python’s memory. To run against Rust, the tests had to be ported too, and Claude helped with both ports. Once that is true, a passing test has two readings: the code is right, or the test was changed in a way that lets wrong code through. Anthropic audited the ported tests and found more than 100 weakened assertions.

The tests were also too few. The API has dozens of features, and 20 binary options alone make over a million combinations. At one second per test that is 12 days for one model, before a single prompt varies. Every production suite is a sample of the configurations someone thought to test.

Together those two properties mean the suite was a partial mirror of the Python implementation, accidents included. One accident from the migration: when Python wrote JSON tool calls, it escaped certain characters, an emoji for instance, into text codes. Rust wrote the emoji as is. The prompts differed by a few bytes, and because Claude accepts almost any prompt, a few bytes can change a reply without raising an error anywhere in the stack. For a migration of a live system the old behavior is the specification, quirks included, and no hand-written suite encodes the quirks. Production also weighted bugs differently: a test case counts once, but a common bug shows up in every request that triggers it.

Production as the Oracle, With Three Constraints

The fix was to stop treating the suite as the definition of correct and use the running Python service as the oracle instead. Run each request through both versions and compare. Shadowing is a standard technique, and the standard tooling assumes two things that were both false here.

A request could not safely run twice, because the second run would count against a customer’s limits and bill. And the service is not deterministic: Claude can answer the same request differently on two calls, so a difference between two replies may be the model rather than the bug. Anthropic called the model once and replayed its output to Rust, then compared every stage before and after the model call, with results required to match exactly.

The third constraint was privacy. Engineers could not read customer requests or replies, so they could not look at where the two versions diverged. So the team recorded the shape of each difference rather than its content. Checkpointing compared the two versions step by step — accept or reject, resolve settings, build the prompt — and piece by piece within each step, and reported the first place they differed. A fingerprint added where in the prompt the difference began and how the two lengths compared. One bug tends to leave the same fingerprint on every request it touches, so records could be grouped by bug instead of by request.

The record an agent received looked like this, in the post’s example with made-up values: step build prompt, piece 2, first difference at byte 17, Python 190 bytes, Rust 190 bytes. No text. A script ran every 10 to 30 minutes, grouped the records by which fields differed, and alerted a coordinating agent only when a new kind of record appeared. The coordinator assigned one worker agent per new kind and opened a Slack thread where engineers could follow along.

This is the step most teams skip. A verifier provides a signal an agent can act on, and a production system offers no such signal by default; most of the project’s effort went into building one.

Three Loops, and Where the People Stood

Each new kind of mismatch got a worker agent and three nested loops.

The inner loop was a cloud sandbox holding both codebases, with local checks that never called the model. The input check built the prompt each version would send and showed the difference in under a second. A later output check pushed a scripted reply through both versions. The agent saw only the fingerprint, so it guessed the cause, wrote a request that would trigger it, and read both results in full, which it could do because it had written them. If the results matched, the guess was wrong and it tried again. If they diverged the way the record described, the agent edited Rust until they matched and added a test that failed on the old code and passed on the new. A wrong guess cost seconds and touched no user.

The outer loop took fixes that had passed review and compared Rust builds with and without each fix on shadowed live traffic. It logged facts about each compared request but not its text, such as which model and features it used, so like could be compared with like, and counted how often the bug’s fingerprint appeared on each build. The inner loop simulated production quickly and imperfectly, so some fixes that passed in the sandbox still showed the difference live. The agent went back with the new evidence.

Between them sat the seam, and this is where the human story is. Engineers did not review guesses. They reviewed proposed fixes, and they judged the one question the verifiers could not: whether a difference was a bug or a deliberate change.

The Verifier Rewarded the Shortcut

The most useful anecdote is from mid-May. One of the largest remaining differences came from web search. Production fetched the web search tool’s description from an internal service. Rust did not call that service yet, so the description was missing from its prompts. An agent proposed copying the text into files Rust could read. The prompts matched. The local verifier passed it. An engineer rejected it as throwaway code, because Rust would have to call the service before launch and the copied files would be discarded on the way.

Anthropic’s reading is worth quoting in full: “the verifier rewarded matching outputs, and the agent found the cheapest way to produce them. A verifier can tell an agent whether the outputs matched, but not whether the fix is good enough to ship.”

The agent did not cheat. It optimized the metric it was given, exactly as designed, and the metric was incomplete. This is the self-reporting problem one level up: an agent that declares a step complete fails an external check 57 percent of the time, and a verifier that says the outputs match says nothing about whether the change behind them should exist. Every team that wires a coding agent to a test runner and walks away has built this loop without the seam. The engineer at the seam is not reviewing code. They are arbitrating what the verifier is missing.

The Memory Loop Is the One to Copy

The third loop is the least technical and the one I would copy first. Anthropic did not want engineers to make the same correction twice, so every review outcome was written down and applied to every agent that followed.

The rejected web search shortcut became a memory note holding the decision, the reason, and the correct fix. Building the real call took weeks, and the bug kept producing records while they waited, some with new fingerprints because the missing text landed at a different position or belonged to another tool that used the same service. Agents that read the note recognized the known bug and linked the records to it instead of writing another workaround.

Other corrections became general rules. After one agent guessed at Python’s behavior, an engineer made “port exactly what Python did” a rule. An agent then compared the existing code against that rule and found seven more places where the port had relied on a guess. In June, an agent read about 60 of the team’s review comments, grouped the recurring problems, and proposed rules, which an engineer edited and approved for the project’s CLAUDE.md. Some lessons hardened into checks: tests that fail when Rust drifts from Python, lints that ban patterns reviewers kept flagging, and a merge check that refuses a change to the Python code without a matching Rust change or a recorded exemption.

The post’s caption for this loop is the most reusable sentence in it: an engineer’s correction becomes three things, a rule that each new agent reads, a search for the same mistake, and a test.

What the Five Months Bought

The economics change the rewrite debate. The old reason not to rewrite a large production system was effort and risk. By May 2026 the effort had collapsed; Claude was writing most of the code Anthropic merged. The risk had not, because risk is a function of verification, and verification does not collapse on its own. It had to be built, by people, for this one system. Once it existed, the rewrite shipped.

Anthropic’s formulation is that ambition can grow as long as there is a way to verify correctness. The corollary is less comfortable. If you cannot verify, cheap generation does not help. The constraint on a big agent project is no longer whether the agent can write the new system. It is whether you can tell, per request, whether the new system behaves like the old one. Generation has been outrunning verification for a while; this is what it looks like when a team with the resources to do something about it does.

There is also an organizational result hiding in the post. Early on, engineers ran Claude inside the inner loop and chased differences themselves. Later they moved to the seam and reviewed fixes in Slack. By the end they worked at the edge, writing the rules and checks the agents operated within. Anthropic describes the shift as moving from directing Claude to Claude directing itself, with humans on the judgment calls. That is the trajectory this column keeps arguing for: a green suite tells you less than it appears to, so the human job migrates from reading output to defining what counts as correct and catching the cases where the definition is wrong.

What to Do This Week

  1. Name your oracle before the project starts. There are three kinds: a rule a checker can apply, a set of examples, and the old system running live. If all you have is a suite written against the current implementation, you have examples that encode its accidents, not an independent judge.
  2. Keep the agent away from the tests it is graded on. For a port, make the test directory read-only to the agent or review test diffs as a separate, mandatory artifact. A ported test should fail on the old code’s bugs; one that passes against everything was weakened. Anthropic found its 100 weakened assertions only because it audited.
  3. If you have production traffic, shadow it, and design the record first. Call the model or the expensive dependency once and replay the output to the new version. Compare at checkpoints rather than at the final response. Record step, piece, first-difference offset and lengths, never content. Group by fingerprint so one bug yields one alert and one thread.
  4. Put a person at the seam, not in the loop. Let agents burn guesses in a sandbox where a wrong one costs seconds. Review fixes, and ask one question of each: does this make the outputs match, or does it make the system right? When the answer is the first, reject it and write down why.
  5. Turn every rejection into three artifacts. A rule in the agent’s memory, a search for the same mistake across the rest of the port, and a test that fails if it returns. A correction that lives only in a reviewer’s head is a correction the next session will need again.
  6. Couple the old and new code in CI. A merge check that refuses a change to the legacy implementation without a matching change in the replacement, or a recorded exemption, is what keeps a moving target from staying ahead of you for five months.

In Harness Engineering: The Complete Guide to Agent-First Software Development, I defined the harness as everything that turns a model’s output into a result you can trust. This migration sharpens the definition. In a live system, trust is a measurement, and the measurement has to be built. The week of generation was the part the model did alone. The five months were the part that made it safe to ship, and every piece of them — the checkpoint, the fingerprint, the seam, the memory note — is something a team can build before it needs a rewrite.