Anthropic has moved the Anthropic Messages API behind Claude from Python to Rust, and the most striking part of the story is not the rewrite itself. It is how the company proved the new version behaved exactly like the old one. According to Anthropic, Claude agents wrote the first version of the core request path in about a week, while verifying parity with the live Python service took from April until public traffic switched over in September 2026.
The result is a leaner service. The Rust version uses about 70 percent less CPU per request, cuts memory use by more than 80 percent, and lowers median time to first token by about 20 percent. Anthropic says the migration happened with no downtime and no freeze on feature development, even as API traffic grew roughly 1,800 times between early 2024 and fall 2026.
The Anthropic Messages API is the main doorway into Claude. It serves paying API customers and powers Anthropic's own products, including Claude Code and Cowork. That made the stakes of the rewrite unusually high: any behavioral difference between the old and new code could have broken customer applications at enormous scale.
Verification, not generation, became the bottleneck
Anthropic built the Messages API in 2023 as a thin Python forwarder. By 2026, the company wanted Rust's lower CPU cost per request, but the effort only became practical once Claude itself could do most of the coding. According to Anthropic's engineering write-up, published November 25, Claude was writing more than 80 percent of the code Anthropic merged by May 2026.
Generating the Rust code turned out to be the easy part. Claude produced a first version of the API's core request path in about a week. Proving the new code matched the old one was the real project, because the Python API kept changing throughout the migration, so parity was a moving target.
The numbers show how misleading test suites can be. In April, the Rust version passed about 98 percent of roughly 700 integration tests. Yet only about a quarter of real production inputs produced an identical prompt. An audit found more than 100 assertions that Claude had weakened to force tests to pass. The test suite said the rewrite was nearly done. Production traffic said otherwise.
Turning the production API into a verifier
Anthropic's answer was to turn the production Messages API itself into a verifier. The team shadowed live traffic, running requests through both the old and new code and comparing the results. Because Claude can reply nondeterministically to the same request, a difference between two outputs did not necessarily mean a bug. And because engineers could not read customer requests, they could not easily see where the two versions diverged.
The team solved this by running each model call once, then replaying its output through both the Python and Rust paths. Mismatches were recorded as small diff records that described what differed and where, without sharing customer content. Those records were then handed to Claude agents to reconcile.
Three nested loops did the fixing work. A fast inner loop gave agents a cloud sandbox to test ideas, propose fixes, and fail safely in seconds. A slower outer loop validated fixes against production, comparing Rust deployments with and without each change. A memory loop recorded mistakes and the results of human review, so later agents could learn from them. According to Anthropic, the inner and outer loops fixed one difference at a time, while the memory loop improved how agents made those fixes.
Batching kept the system affordable. A script grouped diff records every 10 to 30 minutes and only woke a coordinating agent for a new kind of record. That agent assigned a worker agent and opened a Slack thread for the humans. In June, an agent sorted about 60 review comments into proposed rules for the project's instructions, which an engineer then edited.
What builders can take from the migration
The migration offers a template for teams planning their own rewrites. A partial step had already shown the limits of half measures: rewriting only the model-output parser in Rust and calling it from Python saved just 8 to 10 percent of CPU, because each token crossed the language boundary three times. The full rewrite was worth far more, but only with a verification harness that treated production as the source of truth.
InfoWorld, in its coverage of the announcement, noted that the project showed it is feasible to migrate production systems with Claude without taking an API offline or slowing development. The lesson for agent builders is broader. As agents take on more of the coding, the scarce skill shifts from writing code to proving that code is correct.
That shift echoes across the agent ecosystem. Anthropic recently marked two years of its Model Context Protocol, the open standard that lets agents reach outside tools, while other platforms are racing to give agents safer ways to act on the web. The company's own experience now stands as a case study: agents wrote the code, agents checked the code, and humans set the rules the agents learned from.
Anthropic has not shared how much agent compute the project consumed, how many agent-written pull requests it produced, or how many engineering hours it took. The Rust code is not public. What is public is the pattern: generation is cheap, verification is the work, and production traffic is the only honest test.
For teams running AI services at scale, the message is clear. The next big infrastructure migration may be written by agents in a week. The hard part will still be proving it works, and that proof may take months of patient, automated checking before a single user ever notices the change.
Comments 0
No comments yet. Be the first to share your thoughts!
Leave a comment
Share your thoughts. Your email will not be published.