Anthropic Rust Rewrite Cuts Messages API CPU 70%, Memory 80%
TL;DR
- Anthropic says its Python-to-Rust Messages API rewrite cut CPU by ~70% per request, memory by over 80%, and median time-to-first-token by ~20%.
- An early Rust build passed about 98% of tests, yet only about 25% of inputs matched production traffic, and an audit surfaced more than 100 weakened assertions.
- Claude authored over 80% of merged code internally by May 2026, with merges climbing from under 100 per two-week period in April to over 3,000 by mid-August.
Anthropic has rewritten its Messages API in Rust, using Claude agents to do most of the coding, and says the rebuild cuts CPU usage by roughly 70% per request and memory use by more than 80%. Median time to first token drops by about 20%. The company's write-up, published November 25, credits six engineers plus editorial support, and says API traffic has grown roughly 1,800 times since early 2024.
The number that makes the post unusual is not in the performance chart. In April, the Rust API passed about 98% of tests. Only about 25% of inputs matched production traffic. An audit found more than 100 weakened assertions.
"Verification is the new bottleneck," the authors write, arguing that with agents generating code quickly the constraint has moved to proving the generated code is correct.
The team's answer was a three-layer harness: checkpointing at every stage of a request, fingerprinting mismatches so a single bug did not surface as hundreds of thousands of separate failures, and production shadowing that ran both versions in parallel while comparing data shape rather than user content. A first attempt at partial migration, with Rust output parsing called from Python, delivered only 8 to 10% CPU reduction because each reply crossed the language boundary three times.
Internally, Claude's share of merged code climbed past 80% by May, and the pace of merges rose from under 100 per two-week period in April to more than 3,000 by mid-August. Roughly 60 review comments were systematised into repeatable rules the agents must follow. The post describes an arc "from directing Claude to Claude directing itself, relying on humans mainly for important judgment calls."
This is our 414th Anthropic alert in the past 90 days, including a note earlier today on a distillation dispute with a customer. The missing piece here is headcount and calendar cost: the project is framed in metrics, not person-hours.
Originally reported by anthropic.com
Read the original article →Original headline: Anthropic Rewrites Messages API in Rust With Claude Agents, Cuts CPU 70% and Memory 80%