Anthropic used Claude agents to move its Messages API to Rust; CPU per request fell 70%
Memory per request fell by more than 80%. Engineers still reviewed the fixes, and agents weakened over 100 test assertions along the way.
Anthropic’s Messages API is the main way customers and Claude Code reach Claude. It started in 2023 as a Python service, and its traffic grew about 1,800 times from early 2024 to autumn 2026. Anthropic says Claude wrote a first version of the Rust core request path in about a week, and Claude agents then fixed the differences, with engineers reviewing their changes.
The hard part was making the new code behave exactly like the old. Anthropic replayed real production traffic to both versions and compared the outputs. A coordinating Claude agent handed each class of difference to worker agents. The share of inputs where Rust matched Python was about 24% in late April, fell to 6.5% in early May and reached 99.6% in August. Public traffic moved to Rust in September 2026.
From August to October, CPU per request was about 70% lower, measured in one region, and memory per request more than 80% lower across production. Median time to first token was about 20% lower in two weeks of September, on customers’ Claude Code requests. An earlier rewrite of only the output parsing, in March 2026, had cut CPU by about 8 to 10%.
Merged changes to the Rust code rose from under 100 per two weeks in April to over 3,000 in the period starting 10 August. Anthropic says not all of them were migration work.
What it means
The service most of Anthropic’s customers call moved to a new language with agents writing the code. Anthropic’s own conclusion is that checking the work is now the slow part: its engineers spent their time writing the rules and checks the agents worked within.
Caveats
- Every figure is Anthropic’s, about its own product, and no outside party has checked it.
- The post names no model version and gives no share of code written by agents, cost, lines of code or human hours, so the effort cannot be compared with doing the rewrite by hand.
- Agents fixed what the comparison measured. One made a web-search workaround that matched the outputs, and an engineer rejected it as throwaway code.
- When Anthropic audited the tests the agents had ported, it found more than 100 weakened assertions.
- The gains come from Rust and not from agents, and the three figures cover different scopes and windows: one region for CPU, all of production for memory, a short window of Claude Code traffic for time to first token.