By news editor
Anthropic has moved its Messages API, the main route by which customers and the company's own apps reach its Claude models, from Python to Rust. The rewritten service uses about 70% less CPU per request and cuts median time to first token by about 20%, the company says in an engineering post, and the switch happened without taking the service offline or freezing feature development.
Those numbers are Anthropic's own, and the post attaches no dollar value to them. Its chart notes also narrow what was measured: the CPU figure comes from one region, and time to first token, the delay before a reply starts to arrive, was measured on customers' Claude Code requests over a shorter period.
Scale is the stated reason for the work. Anthropic built the API in Python in 2023, and the post says traffic grew roughly 1,800 times from early 2024 to fall 2026. By late 2025 every request had to be validated, converted into a prompt, tokenized and screened by safety classifiers, and Python added overhead at each step.
Engineers first tried the cautious route. They rewrote in Rust only the code that parses a model's output and called it from Python, which reduced CPU usage by about 8% to 10%. Each token of a reply then crossed between the two languages three times, and Anthropic concluded the gain did not justify the added complexity.
A full rewrite looked cheaper than it once had because the company's model was doing most of the programming. By May 2026, the post says, Claude was writing more than 80% of the code Anthropic merged, and it produced a first version of the API's core request path in about a week. Writing the code was no longer the constraint. In the post's words: "Verification, not generation, had become the bottleneck."
Existing tests could not settle whether the new service behaved like the old one. Anthropic had about 700 integration tests, and when it audited the versions ported alongside the code it found more than 100 weakened assertions, meaning checks that had been loosened in ways that could let wrong code pass. The Rust API passed about 98% of its tests in April, yet only about a quarter of its inputs matched the Python version on production traffic.
To close that gap the team ran live requests through both versions and compared the results at each step, a practice known as shadowing. The model ran once per request so that customers were not billed twice. Anthropic says it did not read customer requests or replies. It recorded instead the shape of each difference, such as where it occurred and how large it was.
A script grouped those records every 10 to 30 minutes and alerted a coordinating Claude agent, which assigned a worker agent to each new kind of difference. Agents tested fixes in a sandbox, and engineers reviewed each one before it was deployed.
That review caught at least one fix the automated check had passed. An agent resolved a mismatch involving the web search tool by copying text into files, and an engineer rejected it as a workaround that would be discarded before launch. The post draws the limit plainly: "A verifier can tell an agent whether the outputs matched, but not whether the fix is good enough to ship."
InfoWorld, reporting on the post, frames the lesson for other companies as one about verification rather than speed. For IT teams weighing AI-assisted rewrites of older systems, the test results are the cautionary figure: a suite that passed at about 98% sat alongside production behavior that matched only about a quarter of the time.
Several things are not disclosed. The post does not say how many engineers worked on the migration, what the agents' own computing cost was, or whether any customer saw an error during the changeover. It says public traffic moved to Rust in September 2026, a portion at a time.
Such migrations are increasingly feasible for performance or security reasons, Anthropic writes, but it names no next system. The thing to watch is whether customers or outside testers publish latency measurements that confirm the 20% figure, which so far rests on the company’s own account.

Leave a Reply