Anthropic has moved its Messages API from Python to Rust with Claude agents writing and fixing much of the code. Its tests could not be trusted, so it compared the two versions on live traffic, and says the new API uses about 70% less CPU per request.
Anthropic has moved the main API behind Claude from Python to Rust, with Claude agents doing much of the work, the company said on Wednesday. It switched public traffic over in September without taking offline a service that has suffered outages this year.
The Messages API is how customers and Anthropic’s own apps, such as Claude Code, reach Claude. Anthropic added message threads to it this month to cut delays in long agent sessions.
Anthropic says the API’s traffic grew about 1,800-fold from early 2024 to this autumn. Over that time, it has signed huge compute deals , including with Google and Broadcom. Python, meanwhile, was adding overhead at every step.
Claude wrote a first version of the core code in about a week. Checking it took months. The new code passed about 98% of its tests in April, but only about a quarter of real requests matched the old system.
Part of the problem was the tests themselves. Claude had helped port them, and an audit found more than 100 checks that had been weakened.
So Anthropic used live traffic as the test. It ran requests through both versions and compared each step, without reading customers’ text. Claude agents then fixed each difference, with engineers reviewing every fix.
Engineers still had to catch shortcuts. In one case, an agent made the outputs match by copying a missing tool description into files, which an engineer rejected as throwaway code.
The new API uses about 70% less computing power per request and over 80% less memory, Anthropic says. The median wait for the first part of a reply fell about 20% for Claude Code users.
Anthropic has said Claude now writes more than 80% of the code it merges. The company argues that checking AI-written code, not writing it, is now the bottleneck.
Get the most important tech news in your inbox each week.