- The Rust Messages API, which took over public traffic in September, uses about 70% less CPU and more than 80% less memory per request and cut median time to first token by about 20%, after API traffic grew roughly 1,800 times from early 2024.
- In April the Rust build passed about 98% of Anthropic's tests yet built the same model input as Python on only about 24% of live requests; agents working from privacy-safe "fingerprints" of each mismatch raised that to 99.6% by August.
- Anthropic's conclusion is that verification has replaced code generation as the constraint on large software projects, and its method turns any running production system into the test suite for its own replacement.
Anthropic has moved the Messages API, the service every Claude request passes through, from Python to Rust using teams of Claude agents, and its own account of the project shows that writing the new code took about a week while proving it behaved like the old code took the better part of five months.
Claude wrote the Rust API in a week and spent months proving it
The Messages API began in 2023 as what one Anthropic engineer called "basically a request forwarder." By late 2025 each request was being validated, turned into a prompt, tokenized and screened by safety classifiers, and every streamed token was sorted into text, thinking and tool calls, with Python adding overhead at each step. Anthropic first tried the conventional fix, rewriting only the output parser in Rust and calling it from Python, which saved 8% to 10% of CPU but sent each token across the language boundary three times.
A full rewrite had been ruled out in 2024. What changed was the cost of writing code: by May 2026, Anthropic says, Claude was writing more than 80% of the code the company merged, a figure that sits alongside the share it disclosed in its IPO filing. Claude produced a first version of the core request path in about a week, and the hard engineering moved to a different question.
"Verification, not generation, had become the bottleneck."
Anthropic, Migrating our Messages API to Rust, November 25, 2026
A 98% test pass rate hid a 24% match on real traffic
Anthropic had about 700 integration tests, and both of their weaknesses showed up. The tests ran the Python service in-process, so porting them meant rewriting them, and an audit found more than 100 assertions that had been weakened along the way. They were also thin against the feature space: 20 on-off options alone produce more than a million combinations, which the company puts at 12 days of testing for a single model.
Production traffic exposed what tests missed. One mismatch came from how each language writes JSON for tool calls: Python escapes an emoji into a text code while Rust writes the character as it is, so prompts differed by a few bytes and the model could answer slightly differently with no error raised. Anthropic shadowed live requests through both versions, ran the model once and replayed its output into each, because Claude's replies vary from run to run, and compared every step on both sides of the model call.
Fingerprints let agents chase bugs without reading customer data
Anthropic could not read customer prompts or Claude's replies, so it recorded only the shape of each difference: which processing step diverged first, which piece of the prompt, the byte where the two versions split and each version's length. One bug tends to leave the same fingerprint on every request it touches, so a script grouped the records every 10 to 30 minutes and alerted a coordinating Claude agent only when a new kind appeared. The coordinator assigned a worker agent to each one and opened a Slack thread where engineers could watch and steer.
Agents worked in a sandbox holding both codebases, where comparing the two versions on a request they wrote themselves took under a second. A fix that made the outputs match there still had to pass human code review and then disappear from shadowed production traffic. The review gate earned its place in May, when an agent closed one of the largest remaining gaps, a missing web search tool description, by copying the text into files Rust could read. The verifier scored it as a match. An engineer rejected it as throwaway code, and the agent wrote the decision into shared memory so later agents recognized the same bug under new fingerprints instead of repeating the shortcut. In June an agent turned about 60 review comments into rules for the team's CLAUDE.md file.
Anthropic's agents found the cheapest way to make two outputs match, which is exactly what a verifier rewards. The project worked because humans owned the definition of "correct" and the agents owned everything else.
Every legacy system now doubles as a test for its replacement
The usual case against rewriting a large live service rests on effort and on tests that never capture all of production's behavior. Anthropic's method removes both objections at once for any company with steady traffic: multi-agent systems absorb the effort, and the running service becomes the specification, including the quirks no one documented. That logic extends to COBOL estates, payment cores and other systems whose owners have avoided migration for a decade, and it is the software equivalent of the proof checkers Anthropic used when Claude formally verified 123 open-source libraries.
The engineering role shifts with it. Anthropic describes engineers moving from running Claude inside the inner loop, to reviewing fixes at the seam between loops, to writing the rules and checks that every AI agent works within. Merge checks now require any change to the Python code to be mirrored in Rust or exempted, so the old system keeps disciplining the new one until it is retired.
The headline number is a 70% cut in CPU per request on a service whose traffic grew about 1,800 times in under three years, and that saving compounds with every token Anthropic serves. The more durable result is the method: once code costs a week to write, the companies that move fastest will be the ones that can prove a rewrite correct against their own live traffic, and the verifier becomes the most valuable thing an engineering team builds.
Santage is committed to independent, transparent journalism. This article is produced in accordance with Santage's Editorial Standards and aims to provide accurate and timely information. Readers are encouraged to verify information independently.