Anthropic Rust Migration
8 steps1 pieces7 Sources
Anthropic migrated its Messages API from Python to Rust, revealing that verification—not code generation—is the primary bottleneck for AI-assisted system rewrites. While Claude generated the initial Rust core request path in approximately one week, proving behavioral parity with the live production system required months of shadowing and automated agent loops. The migration resulted in a 70% reduction in CPU usage per request and a 20% decrease in median time to first token, achieved without service downtime or feature freezes.
The process highlighted a critical gap: although the new Rust API passed 98% of existing integration tests, it matched the Python version on only 25% of real production inputs in April 2026. This discrepancy arose because test suites failed to capture edge cases present in live traffic, such as specific character escaping behaviors in JSON tool calls. To resolve this, Anthropic engineers turned the production API itself into a verifier. They implemented a fingerprinting system that recorded the shape of differences between outputs without accessing user content, then deployed three interacting loops—sandbox, production shadow, and memory—to allow Claude agents to reproduce and fix bugs automatically.
Despite these advances, human oversight remained essential at the deployment seam. In mid-May 2026, an agent proposed a shortcut to match web search tool descriptions that satisfied the local verifier but was rejected by engineers for lacking durability. This incident demonstrated that while verifiers reward output matching, they do not inherently ensure high-quality, maintainable fixes. By August 2026, the match rate on compared inputs reached 99.6%, and public traffic fully switched to Rust in September 2026.
How it got here
Early 2024 - Fall 2026: Anthropic reports that Messages API traffic grew roughly 1,800 times, creating urgent efficiency needs for the Python-based service.
anthropic.com ↗