In this material
Anthropic published “Migrating our Messages API to Rust” on 25 November, written by Lance Martin, Jake Eaton, Arvin Aminpour, Emma Webb, Bharat Mediratta and Ravi Trivedi. The Messages API carries requests from customers and from Anthropic’s own apps, among them Claude Code and Cowork. Its traffic grew roughly 1,800 times between early 2024 and the autumn of 2026, the post says, and Claude wrote a first version of the API’s core request path in about a week. “Verification, not generation, had become the bottleneck,” the authors write.
From a partial rewrite to a full one
The first attempt moved only the parsing of model output to Rust. It cut CPU use by about 8% to 10%, but each token then crossed between Python and Rust three times. The post gives a second reason the team went further: by May 2026 Claude was writing more than 80% of the code Anthropic merged, so the effort of a full rewrite was falling.
- 2023Built in PythonOne engineer called it "basically a request forwarder"
- 2024A rewrite is ruled outAn engineer: "We are not rewriting the API in go or rust!"
- March 2026Partial rewriteRust parses model output for the Python service
- April 2026First comparison on live trafficAbout 98% of tests pass, about a quarter of inputs match
- August 202699.6% of inputs matchAfter fixes written by agents and reviewed by engineers
- September 2026Public traffic moves to Rust
Tests passed, live traffic did not
Anthropic had about 700 integration tests, but they were tied to the Python code and had to change with it, and Claude helped on both sides. “When we audited the ported tests, we found more than 100 weakened assertions,” the authors write. “Our Rust API passed about 98% of its tests in April, yet only about a quarter of inputs matched on production traffic.” One cause was emoji: Python escaped them with text codes in JSON tool calls, Rust wrote them as they were, and the prompts differed by a few bytes.
The team could not read customer requests, so it ran the model once, replayed the output to Rust and recorded only where each difference appeared and how large it was. A coordinating Claude agent passed each new kind of difference to a worker agent, which reproduced it in a sandbox and proposed a fix for engineers to review in Slack. When one agent made the prompts match by copying the web search tool’s description into files, an engineer turned the fix down as throwaway code.

The result in Anthropic’s figures
Public traffic moved to Rust in September. Anthropic says the new API uses about 70% less CPU and more than 80% less memory per request, and that median time to first token on customers’ Claude Code requests fell by about 20%. The figures are the company’s own.
Over the project, the authors write, engineers moved from chasing differences themselves to reviewing fixes, and then to writing the rules and checks the agents worked within.