Anthropic uses Claude to rewrite its API from Python to Rust and cuts CPU use per request by about 70%
IA en un minuto newsroom · Editor: Jon Elgezabal

In 30 seconds
Anthropic has rebuilt in Rust the gateway to Claude, its model, which previously ran on Python. Claude drafted a starting version within days, yet making it trustworthy took months of side-by-side checks against the live service, with agents fixing gaps and people reviewing them. The company reports far lower processor use and quicker first replies, based on partial measurements.
The Messages API, the main door through which customers and in-house apps such as Claude Code and Cowork reach the Claude AI model, no longer runs on Python: Anthropic has rebuilt it in Rust, another programming language. In an account published on Wednesday, November 25, the firm says Claude needed roughly a week to produce an initial version of the core code that handles requests.
Growth drove the decision. By the company's count, API traffic rose roughly 1,800-fold from early 2024 to the fall of 2026. An earlier, narrower attempt had moved only the component that reads model output to Rust; it saved between 8% and 10% of CPU, too little to justify the extra complexity.
Most of the effort came after that first draft. By April the Rust code was clearing about 98% of its tests, yet on live traffic only around a quarter of the compared inputs came out the same as in Python. To close the gap, the team treated the running service as the benchmark. It logged where the two versions drifted apart, without reading what users sent or what they got back, and dispatched agents automatically to repair each mismatch. Engineers reviewed proposed changes before they shipped. Public traffic switched to Rust in September.
Anthropic puts the drop in CPU (processing power) per request at about 70%, a figure taken from a single region. Median time to first token, meaning the wait for the opening piece of a reply, fell by roughly 20%; that number covers only customer requests coming from Claude Code and a shorter window. The switch happened with the service staying up and feature work continuing.
Why it matters · analysis and opinion
The useful lesson lies in how the work was checked rather than how fast it was written. A team that wants to rewrite a running system with AI help first needs a yardstick, and here the old service played that part. Automated tests alone let too many cases slip through. It also matters who decides: software proposed repairs and engineers could turn down any that were mere shortcuts. Still open is how far this helps organisations with little traffic, where fewer real examples exist to compare, and the performance gains are the firm's own figures from narrow conditions. Before copying the approach, define what it means for both versions to match.
Official source: Anthropic · Written with the help of AI: how we make the news


