AI news ·
Anthropic moved its Messages API from Python to Rust, with Claude writing the first version in about a week
Anthropic rebuilt the API every Claude request passes through in Rust. Claude agents wrote the first core version in about a week and hunted mismatches in live shadow traffic. The result: about 70% less CPU per request and a 20% faster first token, with no downtime.

Anthropic has published an engineering account of one of the riskiest projects a software company can take on: rewriting its core API in a new language while it is under heavy load. The Messages API, the front door every Claude request passes through, including Anthropic's own Claude Code, has moved from Python to Rust. Much of the rewrite was done by Claude itself.
Why rewrite at all
According to the post, published on 25 November, traffic through the API grew roughly 1,800 times between early 2024 and fall 2026. The Python service was struggling to keep up. Full rewrites of systems that size are usually avoided; in 2024 one Anthropic engineer even ruled out rewriting the API in Go or Rust. Two years later, the economics had changed, because AI agents could do most of the typing.
Claude wrote a first version of the core request path in about a week. By May 2026, the company says, Claude was writing more than 80% of the code Anthropic merged.
The hard part was proving it worked
Writing the code turned out to be the easy part. In April the Rust version passed about 98% of the existing tests, but only about a quarter of real production inputs produced byte-for-byte identical results. Tiny differences were to blame: Python escaped certain characters, such as an emoji, in tool-call JSON, while Rust wrote them as-is, so prompts differed by a few bytes. The live match rate started at 24%, dipped to 6.5% in early May and reached 99.6% by August.
There was a second lesson. When engineers audited the tests that had been carried over, they found more than 100 assertions that had been weakened along the way. Tests had been changing together with the code, and some changes let incorrect behavior pass.
Anthropic's answer was to make the old system the referee. Real traffic ran through both versions in parallel and every difference was logged. A coordinating Claude agent watched for new kinds of mismatch and assigned a worker agent to own and fix each one, opening a thread in a shared Slack channel where engineers could follow along and step in.
The results
- About 70% less CPU per request and more than 80% less memory.
- Median time to first token about 20% lower.
- Public traffic moved to Rust in September, with no downtime and no feature freeze.
What other engineering teams can take from it
The story is a candid picture of where agent-driven development stands. Generating a large codebase quickly is now realistic; verifying that it behaves identically is where the human and organizational effort goes. Shadow traffic against the old system, independent checks on the test suite itself, and a visible channel where people can watch and steer agents were what made the migration safe.
It also feeds a wider debate. This week Anthropic CEO Dario Amodei rejected claims that humans should hand control to AI, while Anthropic's own engineering blog shows agents finding, assigning and fixing bugs with people supervising from Slack. Both can be true: this is infrastructure work reviewed by humans, not AI training itself, but the share of work done by machines keeps rising.