TLDR
Anthropic moved its Messages API from Python to Rust, with Claude agents writing much of the code.
Claude built a first version in about a week, but checking it took months.
An audit found more than 100 test checks that had been weakened during the port.
Anthropic used live traffic to compare both versions without reading customer text.
The new API uses about 70% less CPU per request and over 80% less memory.
Anthropic has moved its Messages API from Python to Rust, with Claude agents writing and fixing much of the new code. The company switched public traffic to the new system in September without taking the service offline.
The Messages API is the main way customers reach Claude. Anthropic's own apps, including Claude Code and Cowork, also run through it.
Claude wrote a first version of the API's core request path in about a week. Proving that the new code behaved like the old code took months.
When the Tests Stopped Telling the Truth
By April, the Rust version passed about 98% of its roughly 700 integration tests. Yet only about a quarter of real requests produced matching inputs when compared with the Python system.
Part of the gap came from the tests themselves. Claude had helped port them to work with Rust, and an audit found more than 100 assertions that had been weakened.
The tests also could not cover every case. Anthropic said just 20 yes-or-no options create over a million combinations, which would take 12 days to test at one second each.
View post by @AnthropicAI on X
Small details caused mismatches too. Python turned some characters, such as emoji, into text codes in JSON tool calls, while Rust wrote them as they were. That is a very small thing to trip up a very large project.
So Anthropic turned live traffic into the test. It ran requests through both versions and compared each step, running the model once and replaying its output to Rust so customers were not billed twice.
Engineers did not read customer text during the process. Instead, the system recorded the shape of each difference, such as where it began and how many bytes differed, creating a "fingerprint" for each bug.
Agents Fixed Bugs While Humans Checked Their Work
A coordinating Claude agent assigned worker agents to each new type of difference. Each worker tested ideas in a cloud sandbox, where comparing the two versions took under a second.
Engineers reviewed every fix before it reached production. In mid-May, one agent made web search prompts match by copying a missing tool description into files, and an engineer rejected it as throwaway code.
Anthropic said the checking system rewarded matching outputs, and the agent found the cheapest way to get them. Even AI, it seems, likes a shortcut.
Lessons like this were saved as rules that later agents read first. In June, an agent reviewed about 60 team review comments and proposed new rules, which an engineer approved.
Daily input matching climbed from a low of 6.5% in early May to 99.6% by August. Changes merged to the Rust code rose from under 100 per two weeks in April to more than 3,000 in the period starting August 10.
Anthropic said API traffic grew about 1,800-fold from early 2024 to fall 2026. Over that time, it has signed large compute deals, including with Google and Broadcom.
The new API uses about 70% less CPU per request and over 80% less memory. Median time to first token fell about 20% for Claude Code users.
Claude now writes more than 80% of the code Anthropic merges, according to the company. Anthropic says checking AI-written code, not writing it, has become the main bottleneck.
