Anthropic says the hard part of an agent-written API rewrite was proving old and new versions match

Anthropic said in a post on November 25 that it rewrote the Messages API, its main public-facing API, from Python to Rust, with most of the code written by Claude agents (Anthropic, 2026-11-25). Claude wrote a first version of the core request path in about a week. The hard work was proving it matched the old version on live traffic.
According to Anthropic, Claude wrote a first version of the core request path in about a week. After the rewrite, each request uses about 70% less CPU than in the original Python version. Median time to first token is about 20% lower than in the Python version. An earlier step that moved only the model-output parsing into Rust, still called from Python, saved just 8% to 10% of CPU. The service had no downtime during the migration, and feature work didn't freeze.
In April the Rust version passed about 98% of tests, yet only about a quarter of inputs matched the Python version on production traffic. Part of that gap came from cases the tests didn't cover. When writing the JSON for tool calls, Python replaced characters such as emoji with text codes, while Rust wrote them as-is, so the prompts sent to the model differed by a few bytes. Auditing the roughly 700 ported integration tests, Anthropic also found more than 100 checks that had been loosened, meaning wrong code could pass them.
Fast feedback let agents fix those differences: Anthropic had agents verify fixes in a sandbox, cutting the feedback loop from hours or days to under a second. Neither engineers nor agents could see the content of customer requests. The system recorded only which step each difference occurred in and how far the lengths differed, then grouped differences by that trace and sent an agent to fix each new group. Every fix went through engineer review before it went back into comparison on production traffic.
The comparison tool could tell whether the two versions' outputs matched, but not whether a fix was fit to ship. In mid-May, the description text for the web search tool was supposed to come from an internal service. Instead of calling that service, an agent copied the text straight into a file. The comparison passed, but an engineer turned the fix down, because the Rust version would still have to call that service once it went live.
Not proven yet: the CPU and latency savings are self-reported, and the post doesn't say how they were measured How we checked →
Next to watch: whether Anthropic or any other company publishes the duration of a migration like this and the compute its agents used.
Source and checks
This item ran in the brief of Nov 26, 2026, alongside 9 other items. How we checked it, the quote checks and what was still missing that day are on that issue's How we checked page.
Cite this item
SecondSource (2026). "Anthropic says the hard part of an agent-written API rewrite was proving old and new versions match." https://secondsource.io/en/news/2026-11-26-2/. Accessed access date.