
Anthropic published a detailed account on November 25, 2026 of how it moved the Messages API from Python to Rust, and the finished service uses about 70 percent less CPU per request than the Python version it replaced.
The Messages API is the main route into Claude. Customers reach the models through it, and so do Anthropic’s own products, including Claude Code and Cowork. Anthropic says traffic through the API grew roughly 1,800 times from early 2024 to the fall of 2026. The service began in 2023 as a simple Python program that one engineer at the time described as basically a request forwarder. By late 2025 every request had to be validated, converted into a prompt, tokenized and screened by safety classifiers, and every reply had to be sorted into text, thinking and tool calls as it streamed back. Python added overhead at each of those steps.
The team tried the cautious route first. They rewrote only the output parsing code in Rust and called it from Python, which cut CPU use by about 8 to 10 percent. Each token then crossed the boundary between the two languages three times, and Anthropic says the added complexity was not worth the saving. A full migration was the remaining option, and the usual objection to one had weakened. By May 2026, Anthropic says, Claude was writing more than 80 percent of the code the company merged. Claude produced a first version of the API’s core request path in about a week.
Writing the code turned out to be the easy part. The hard part was proving the Rust version behaved like the Python version on real traffic. The existing test suite held about 700 integration tests, and Anthropic found two problems with relying on it. The tests were coupled to the Python implementation, so they changed along with the code, and an audit of the ported tests found more than 100 weakened assertions. The tests were also incomplete. Twenty binary options alone make over a million combinations, which Anthropic calculates as twelve days of tests at one second each for a single model, before prompts vary at all.
There was a deeper problem underneath both of those. The Python API kept changing while the migration ran, because new models and features shipped throughout, so the definition of correct was a moving target. Claude’s replies are also nondeterministic, which means two different outputs do not necessarily signal a bug. And the team could not read customer requests, so it could not simply look at where the two versions diverged.
The answer Anthropic built was to use the production API itself as the checker. The team ran each model call once, then replayed the model’s output through both the Python path and the Rust path, comparing every stage before and after the call. Instead of recording request text, the system recorded the shape of each difference – which step it appeared in, where in the prompt it began, and how large it was. Anthropic calls that combination a fingerprint, and it found that one bug tends to leave the same fingerprint on every request it touches, so differences could be grouped and counted instead of read one by one. The early numbers showed why the work was needed. The Rust API passed about 98 percent of its tests in April, yet only about a quarter of inputs matched on production traffic.
Fixing the differences became an agent workflow. A script ran every 10 to 30 minutes, grouped new difference records by kind, and alerted a coordinating Claude agent only when a new kind appeared. That coordinator assigned a worker agent to each new kind and opened a thread in a shared Slack channel where engineers could follow and steer. The workers operated in three loops. A fast inner loop gave each agent a sandbox with both codebases and local checks that ran in under a second without calling the model. A slower outer loop validated proposed fixes against production. A memory loop recorded mistakes so later agents could learn from them. Because an agent could only see a fingerprint and not the request behind it, it had to write its own test request, reproduce the difference, and then edit the Rust code until both versions matched.
The migration shipped without taking the service offline and without freezing feature development on the Python side. Alongside the CPU saving, Anthropic reports about 80 percent less memory use and a cut of about 20 percent in median time to first token. The method travels well beyond one company. Any team running a large service can copy the pattern of replaying real outputs through old and new code and comparing shapes rather than content, which keeps customer data out of the testing process entirely.
Verification as the central problem is a recurring theme in this week’s releases. The DeepMind work covered here on November 24 used formal proofs checked in Lean to confirm that agent-written quantum programs were correct, and OpenAI’s protein design results, covered on November 25, depended on lab tests to confirm what the model proposed. Anthropic’s post ends on the production numbers rather than on a promise, and the Rust API is already the live path for Claude traffic as of the September 2026 cutover the post describes.
This story also appeared in Manhattan Mogul, American Pulse Journal, American Morning Herald, Revista Minutos, Le Miroir Francais, China Daily News.

The post Prince Mario-Max Schaumburg-Lippe: Anthropic Moved Its Messages API to Rust With Claude Agents appeared first on News Today World.













