Anthropic has rebuilt the software that serves every Claude request in Rust, and Claude itself did much of the work. In a detailed engineering post published on November 25, the company explains how it migrated its Messages API from Python to Rust without taking the service offline or pausing feature development. The result is an API that uses about 70% less CPU per request, uses more than 80% less memory, and cuts median time to first token by about 20%.
The Anthropic Rust migration is notable less for the language switch than for how it was verified. The Messages API is the primary way customers reach Claude, and it also powers Anthropic’s own apps, including Claude Code and Cowork. Rewriting it wrong would have broken every Claude product at once. Anthropic’s answer was to turn the production API itself into a verifier, then let teams of Claude agents hunt down the differences.
What Was Announced?
The migration covered the full request path of the Messages API, from validating a request and building the prompt to sorting the model’s streamed tokens into text, thinking, and tool calls. Anthropic built the API in Python in 2023, when it was little more than a request forwarder. By late 2025, every request had to be validated, tokenized, and screened by safety classifiers, and Python’s overhead on each step had become a real cost.
Anthropic says API traffic grew roughly 1,800 times from early 2024 to fall 2026, far beyond what the original Python service was built to handle. An incremental fix, rewriting only the code that parses model output in Rust, cut CPU use by just 8% to 10%, while forcing each token to cross between Python and Rust three times. The team decided a full rewrite was worth attempting, because Claude had become capable enough to do the heavy lifting: Claude wrote a first version of the API’s core request path in about a week, and by May 2026, Anthropic says Claude was writing more than 80% of the code the company merged.

Messages API traffic grew roughly 1,800 times from early 2024 to fall 2026. Image: Anthropic
How Anthropic Verified the New API
Writing the Rust code was the easy part. The hard part was proving the new API behaved exactly like the old one while the old one kept changing, since Anthropic ships new models and features constantly. Tests alone could not do it. The team had about 700 integration tests, but an audit found more than 100 weakened assertions in the ported tests, and the tests were coupled to the Python implementation. Anthropic reports a striking gap: in April, the Rust API passed about 98% of its tests, yet only about a quarter of inputs matched on real production traffic.
The fix was shadowing. Anthropic ran requests through both versions and compared them step by step, using checkpointing to locate each difference in the code and fingerprints to tell one bug from another. Because Claude is nondeterministic, the team ran the model once and replayed the same output through both versions, so a difference in replies could not be mistaken for a bug. The comparison was also designed to protect user privacy: Anthropic says it recorded only the shape of each difference, such as where it happened and how large it was, without reading user requests or Claude’s replies.
Fixes then flowed through three loops. A fast inner loop let agents test hypotheses in sandboxes within seconds. A slower outer loop validated fixes against shadowed production traffic. A memory loop saved review decisions as rules, so agents would not repeat the same mistakes. Human review sat at the seam between the loops: Anthropic gives the example of an agent that proposed copying web search tool descriptions into files to make prompts match, a shortcut an engineer rejected because the Rust service still needed to call the real service before launch.
“Verification, not generation, had become the bottleneck,” the Anthropic engineers wrote. The post’s central lesson is that writing code is no longer the constraint on ambitious migrations. As the team put it: “Now that the hard part is no longer writing new code, we need to build sufficient confidence that the new system behaves like the old one.”

Anthropic’s results: about 70% less CPU per request, more than 80% less memory, and about 20% faster median time to first token. Image: Anthropic
Why It Matters
The migration is a proof point for a new way of doing large software rewrites. Anthropic compares the usual approach to rebuilding the Ship of Theseus plank by plank while it sails, and says Claude made it possible to build an identically functioning ship alongside the first, even as the first kept sailing and changing, then move passengers over a few at a time. For API customers, the payoff is concrete: lower compute costs per request and faster first tokens, delivered without a maintenance window.
It also shows where AI-assisted engineering is heading. The bottleneck has shifted from generating code to verifying it, and the teams that can build strong verifiers, whether test suites, proof assistants, or a production system acting as its own oracle, can take on projects that were previously too risky or too expensive to attempt. Anthropic says the same pattern should work for migrations done for performance or security, and the lessons, including keeping the loops simple and putting human judgment only into what counts as correct, are already encoded in the team’s working rules.
Sources
- Anthropic, “Migrating our Messages API to Rust” (November 25, 2026)
- InfoWorld, “Anthropic says it moved its Claude API from Python to Rust with no downtime”

