Anthropic has moved the Messages API, the main route that customers and its own applications use to reach Claude, from Python to Rust. In an engineering account published on November 25, the company says the Rust version uses about 70 percent less CPU per request and cuts the median time to first token by about 20 percent, and the migration was completed without taking the service offline or freezing feature development.
The scale behind the move helps explain it. Anthropic built the Messages API in 2023 as a simple Python service that one engineer at the time called basically a request forwarder. Traffic then grew roughly 1,800 times from early 2024 to fall 2026, and each request now has to be validated, converted into a prompt, tokenized, and screened by safety classifiers before a model answers. Python added overhead at every step.
An earlier, smaller attempt showed why a partial fix was not enough. Rewriting only the output parser in Rust, called from Python, saved about 8 to 10 percent of CPU, but each token then crossed between the languages three times, and Anthropic judged the gains not worth the complexity.
What changed the calculation was the falling cost of writing code. Claude produced a first version of the core request path in about a week, and Anthropic says that by May 2026 Claude was writing more than 80 percent of the code the company merged. Generation, in other words, was no longer the hard part. Verification was.
The numbers show why. The Rust version passed about 98 percent of roughly 700 integration tests in April, yet only about a quarter of inputs matched on real production traffic. Auditing the ported tests also found more than 100 weakened assertions, and the test suite could not cover the combinations in live use. The Python service also kept changing throughout the migration, so parity was a moving target, and Claude replies nondeterministically, so a different output did not necessarily mean a bug.
Anthropic's answer was to turn the production API itself into the verifier. The team shadowed live traffic through both versions, ran the model once and replayed its output to Rust so a request counted only once toward limits and billing, and compared each stage before and after the model call. To protect privacy, the team did not read customer requests. Instead it recorded the shape of each difference, using checkpoints to locate where the versions diverged and fingerprints to group differences caused by the same bug.
Those records fed teams of Claude agents working in loops. A fast inner loop let agents test hypotheses in sandboxes within seconds, a slower outer loop checked approved fixes against shadowed production traffic, and a memory loop saved corrections from human reviewers as rules for later agents. Engineers stayed at the gate between the loops, and that judgment mattered. When an agent proposed copying a web search tool description into local files so the prompts matched, an engineer rejected the shortcut because Rust still needed to call the service that supplies the description properly.
The lesson Anthropic draws is broader than one rewrite. As models write more of the code, the constraint on ambitious projects becomes how quickly and reliably their work can be checked. A production system, carefully instrumented, can serve as that check, and other teams with overloaded services are likely to study it closely.
Photo: Anthropic chief executive Dario Amodei, right, speaking at TechCrunch Disrupt 2023. Photo by TechCrunch, via Wikimedia Commons, CC BY 2.0.