Coding & agents New
Anthropic says Claude agents helped move its Messages API from Python to Rust on live traffic, cutting CPU per request by about 70%
Published:
Anthropic's engineering team published an account on Wednesday of how it moved its Messages API, the main way customers and its own apps such as Claude Code and Cowork reach Claude, from Python to Rust without taking the service offline. It says API traffic grew roughly 1,800 times from early 2024 to autumn 2026, and that the Rust version uses about 70% less CPU per request and cuts median time to first token by about 20%.
Claude wrote a first version of the core request path in about a week, the post says, but verification was the hard part: in April the Rust API passed about 98% of its tests while only about a quarter of real inputs matched on production traffic. Anthropic shadowed live requests through both versions, turned each difference into a small record and dispatched agents to fix it, using an inner sandbox loop, an outer loop on shadowed traffic and a memory loop that turned engineers' review corrections into rules, tests and lints.
The share of matching inputs fell to 6.5% in early May and reached 99.6% by August, according to the post; public traffic moved to Rust in September. Merged changes to the API's Rust code rose to more than 3,000 per two-week period, not all of them migration work.
Caveat. All figures are Anthropic's own, taken from the text and charts of its post; no outside party has checked them.
Sources