What Anthropic says it gained
Anthropic has moved the Messages API — the interface customers, Claude Code and Cowork all use to reach its models — from Python to Rust, and says the rewritten service uses about 70% less CPU per request and cuts median time to first token by about 20%. Memory used per request fell by more than 80%. The company described the migration on 25 November, in a post from its engineering team.
The service was never taken offline and feature development was never frozen, according to the post. Anthropic’s charts put the CPU and memory change between August and October, and the drop in time to first token between roughly 7 and 21 September.
The pressure to move came from growth. API traffic grew roughly 1,800 times between early 2024 and the autumn of 2026, Anthropic says. The original Python service, written in 2023, was described by one engineer at the time as “basically a request forwarder”; by late 2025 every request had to be validated, converted into a prompt, tokenised and screened by safety classifiers, with the reply sorted into text, thinking and tool calls on the way out.

The incremental route was tried first
Standard practice is to rewrite only the slow parts, and that is where Anthropic started: it rewrote the code that parses a model’s output in Rust and called it from Python. That cut the API’s CPU usage by about 8% to 10% — but each token then crossed between the two languages three times, and the company judged that the gains did not justify the added complexity.
A full rewrite had been ruled out before. Anthropic quotes an engineer settling the question in 2024: “We are not rewriting the API in go or rust!” What changed, the post argues, is the cost of writing code. By May 2026 Claude was writing more than 80% of the code Anthropic merged, and Claude produced a first version of the API’s core request path in about a week. Generation stopped being the bottleneck. Verification became it.
Turning production into the test
Tests were not enough. Anthropic had about 700 integration tests, but they were coupled to the Python implementation and had to be ported alongside the code — and when the company audited the ported tests, it found more than 100 weakened assertions. In April the Rust API passed about 98% of its tests while only about a quarter of its inputs matched Python’s on live traffic.
So the team shadowed production, with two constraints that rule out off-the-shelf tooling: a request must only count once against a customer’s bill, and Claude’s replies are not deterministic. Anthropic ran the model once and replayed its output to the Rust version, then compared every stage before and after the model call.

Privacy shaped the rest. Because engineers could not read customer requests, the system recorded only the shape of each difference: which step diverged, which piece of the prompt, the byte at which the two first differed and the length of each side. Anthropic found that a single bug leaves the same fingerprint on every request it touches, which let the team group hundreds of thousands of near-identical records into one case.
A script ran every 10 to 30 minutes, grouped the records and alerted a coordinating Claude agent only on a new kind. That coordinator assigned a worker agent to each case and opened a Slack thread where engineers could follow along.
Where the humans stayed
Anthropic is explicit that human review remained a gate, and gives a case where it mattered. In mid-May, one of the largest remaining gaps came from web search: the production API fetched the tool’s description from an internal service that the Rust version did not yet call, 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 — and an engineer rejected the fix, because Rust would still have to call the service before launch and the workaround would be thrown away.
“A verifier can tell an agent whether the outputs matched, but not whether the fix is good enough to ship,” the post says.