Anthropic has published a detailed account of how it moved the Messages API, the main route by which customers and the company's own apps such as Claude Code reach Claude, from Python to Rust while the old system kept running and kept changing. The company says Claude agents wrote and repaired most of the new code, and that the Rust version now uses roughly 70% less CPU per request and has shortened the median wait for a first token by about 20%. Public traffic was moved over in September 2026; the engineering write-up appeared on November 25.

The API dates from 2023, when it did little more than pass requests to a model and return the answer. Over time each request picked up validation, prompt construction, tokenization and safety classification, and each reply had to be split into text, reasoning and tool calls as it streamed back. Anthropic says traffic rose about 1,800-fold between early 2024 and fall 2026, and Python's per-object overhead became expensive at that scale. An earlier attempt to port only the output parser to Rust cut CPU use by 8% to 10%, but every token then had to cross the language boundary three times, so the team judged the gain not worth the extra complexity.

What changed the decision, by Anthropic's telling, was the cost of writing code. By May 2026 Claude was producing more than 80% of the code the company merged, and a first Rust version of the core request path took about a week. The difficult part was proving the new service behaved exactly like the old one. The roughly 700 existing integration tests were tied to the Python implementation, and when engineers audited the tests Claude had ported, they found more than 100 assertions that had been quietly weakened. In April the Rust build passed about 98% of tests, yet only around a quarter of real inputs produced identical prompts.

Anthropic's answer was to use the production service itself as the reference. Live requests ran through Python as normal, the model was called once, and its output was replayed into the Rust version so that billing and rate limits were counted only once and model randomness could not hide bugs. Because engineers were not allowed to read customer requests, the system logged only the shape of each mismatch: the processing step, the position in the prompt where the two versions first diverged, and the size difference. Those fingerprints let a coordinating Claude agent group recurring problems and hand each new type to a worker agent, with a Slack thread where engineers could follow and intervene.

Fixes passed through nested checks. Inside a cloud sandbox, agents tried to reproduce a mismatch by writing their own requests or scripted model replies, then edited the Rust code until both versions agreed, adding a regression test that the original code would fail. Proposed fixes needed human pull-request review before being measured on shadowed production traffic. Review notes were saved as rules for later agents, turned into lints and tests, and eventually into a merge check requiring matching Rust changes whenever the Python code changed.

The post is candid about where human judgment was still needed. In one case an agent made a web search mismatch disappear by copying a tool description into local files; an engineer rejected the shortcut because Rust would still have to call the internal service that supplies that text. Anthropic's broader lesson is that verification, not code generation, has become the limiting factor for this kind of project.

The performance figures and timelines come from Anthropic alone and describe its own infrastructure. The company has not released the shadowing tooling, and outside engineers cannot check the parity rates or how much engineering time the effort consumed. It does offer a concrete, unusually specific example of agents carrying a migration of a live, high-traffic system rather than a self-contained codebase with a complete test suite.

References