Anthropic moves Messages API from Python to Rust: 70% less CPU per request, Claude wrote the core in a week

Text
Article image

US-based Anthropic said on November 25 that its Messages API has moved from Python to Rust: about 70% less CPU per request, about 80% less memory, and about 20% faster median time to first token, with no downtime. Claude wrote the core request path in about a week; proving it correct took four months, using the production Python service itself as the grader, with Claude agents fixing the differences.

US-based Anthropic said on November 25, Beijing time, that its Messages API has been fully migrated from Python to Rust: the new version uses about 70% less CPU per request and about 80% less memory, and cuts median time to first token by about 20% — all without ever taking the service offline or freezing feature development. The numbers are Anthropic's own, the CPU chart covers a single region, the time-to-first-token figure covers Claude Code requests only, and a podcast cited a 40% to 50% CPU cut instead — but even discounted, this is the most concrete case yet of AI performing surgery on itself.

The Messages API is the main route by which customers and Anthropic's own apps, including Claude Code and Cowork, reach Claude. It was built in Python in 2023. From early 2024 to fall 2026, traffic on it grew roughly 1,800 times, and the Python bill kept climbing. Anthropic first tried rewriting only the code that parses model output in Rust. CPU use fell just 8% to 10%, each token had to cross between Python and Rust three times, and the added complexity was not worth the gain. By May 2026, Claude was writing more than 80% of the code Anthropic merged, and a full rewrite finally made sense: Claude wrote a first version of the core request path in about a week.

The hard part was not writing the code, it was proving the new code behaved exactly like the old code. The Python service kept changing throughout the migration, so parity was a moving target; Claude's replies are nondeterministic, so a different output did not necessarily mean a bug; and Anthropic could not read customer requests, so it could not easily see where the two versions diverged. Its 700 existing integration tests were not enough either — some were incomplete, some were coupled to the Python implementation, and some passed when they should have failed.

Anthropic's answer was to turn the production Python API itself into the grader: the same request ran through both the old and the new code, results were compared stage by stage, and only the location and length of each difference were recorded — never the customer content itself. Differences that looked like they shared a cause were grouped together, and Claude agents were dispatched automatically to fix them. The repair ran in three loops: an inner loop that reproduced and fixed bugs in a sandbox, an outer loop that validated fixes against live traffic, and a memory loop that turned recurring failures into permanent rules. Every fix needed a human engineer's approval before it went near production traffic. The Rust version took over production traffic in September 2026.

The impact runs in three layers

The impact runs in three layers. The first is Anthropic itself: API costs fall sharply, and high-frequency uses such as Claude Code suddenly have far more margin — this is the first time a language migration has produced visible profit for the inference business. The second is the whole industry: verification, not generation, has become the real bottleneck of AI-written code — one week to write, four months to prove it correct. Whoever turns "use the production system as the grader" into a product will turn AI rewrites of legacy systems into a business. The third is the programming profession: after May 2026, most code merged at Anthropic was written by Claude, and the human's job has become writing the test, grading the work, dispatching the agents, and signing off. Writing code is becoming the AI's job; setting the question, grading the answer, and taking responsibility is the human's.

The biggest hidden loser is anyone still betting that "AI coding is just a slightly faster tool." Anthropic's post is a public announcement that most code production has already been taken over by AI, and the remaining fortress is the verification system. Once that system exists, migrations, rewrites, and language changes that used to be measured in person-years become measured in weeks. The money will flow to the big companies that hold production traffic and can use real requests as the grader, and to the people who can design verification rules; people who only write code without touching verification will find their work first written away by AI, then graded away by AI.

iHolyshit review The number that matters in Anthropic's post is not 70%, it is the sentence the industry has been avoiding: verification, not generation, has become the bottleneck. Claude wrote the core code in a week and needed four months to prove it was not wrong — that is the real pace of AI programming. Chinese companies should look at exactly this layer: whoever holds production traffic and dares to use real requests as the grader can turn AI rewrites into their own cost advantage; teams with no traffic that only call other people's APIs will forever be someone else's test subject. Anthropic dared to hand its main channel to Claude for a rewrite because it had built the grading system first; copying the AI-written core code without that system is gambling with your users' service. And do not be dazzled by the number: 70% is Anthropic's own measurement in one region, and the 40% to 50% heard on a podcast may be closer to the network-wide truth — discount the boast before believing it.

November 26, 2026

Share this article

What do you think of this story?

Anonymous feedback, up to 5 reactions per article.

Reader comments

Comment without signing in, or sign in to display your member name.

Discuss the technology and the story. Hate, politics and war, threats, abuse, personal accusations, sexual content, ads, links and personal information are not allowed.

0/500

No comments yet. Be the first to share.

Sources