In April 2026, the new Rust version of Anthropic’s Messages API passed about 98 percent of its tests. When Anthropic compared it with the Python service on live traffic, only about a quarter of the inputs matched. That gap shaped the move to Rust. Anthropic used the existing service as a reference, gave Claude agents the job of investigating differences and had engineers review the proposed fixes.
Why Anthropic rewrote the API
The Messages API is the interface through which apps, including Claude Code, send structured messages to Claude and receive replies. It prepares requests for the model and sends the answers back to the app. Anthropic says traffic grew roughly 1,800-fold between early 2024 and autumn 2026. The move from Python to Rust aimed to reduce the processor work required for each request. Claude wrote an initial version of the core request path in about a week.

What the tests missed
Many tests depended on the Python implementation and had to be adapted during the rewrite. An audit found more than 100 checks that had been weakened. The tests also covered only a subset of the ways customers used the API. For example, Python represented an emoji in a tool call as a text code, while Rust left the emoji as it was. That changed the prompt sent to the model by a few bytes. In live traffic, the same discrepancy could count against every request that triggered it.
One model call, two versions of the API
Claude can give different answers to the same input. To compare the API versions on equal terms, Anthropic ran the model once per comparison and replayed the same model output to Rust. The team checked stages before and after the model call, including how the API assembled a prompt and processed the reply. The comparison logs recorded where a difference appeared and its size without storing the text of customer requests or replies in those records.
Where engineers made the call
A coordinating Claude agent assigned each new kind of discrepancy to another agent. The assigned agent could use a sandbox, an isolated test environment, to investigate and propose a fix. Engineers reviewed the code before the fix could be checked against live traffic. One agent proposed using a static copy of the web search tool’s description. The local check passed, but an engineer rejected the workaround because Rust still needed to fetch the description from the service that supplied it.
If you’re assigning work like this, I’d have agents investigate repeat discrepancies and reserve code approval for reviewers. The web search example shows why. A comparison can tell you whether two results agree. A reviewer can also judge whether the change keeps the service connected to the source it needs.
What Anthropic measured after the move
Anthropic reports that the service stayed online throughout the move. Processor use per request fell by about 70 percent in the region measured. For the Claude Code requests Anthropic measured, the median wait for the first token, the first small unit of a streamed reply, fell by about 20 percent. That last measure tells you how soon the reply starts to arrive.
Ask AI about this article
Opens in a new tab with the question filled in.


