Anthropic has transitioned the API behind its Claude AI from Python to Rust, with Claude agents writing and refining most of the new code. Despite initial testing hurdles, the new Rust API now consumes roughly 70% less CPU and 80% less memory per request while improving response times.
- Messages API rewritten in Rust with Claude AI agents as primary developers
- Live traffic used to validate correctness due to unreliable test coverage
- New API reduces CPU usage by 70% and memory use by 80%, speeding up replies
What happened
Anthropic migrated the Messages API that powers Claude from Python to Rust, with most of the new code written and debugged by Claude AI agents. This rewrite was motivated by the need to handle a dramatic growth in API traffic—about 1800-fold since early 2024—and the inefficiencies of the original Python code.
The cutover to the Rust API occurred in September 2026 without requiring downtime, despite some service instability earlier in the year. This API supports all customer use of Claude, including Anthropic’s own applications like Claude Code, which has seen latency improvements following the upgrade.
Why it matters
Switching to a Rust backend significantly reduced resource consumption, with Anthropic reporting roughly 70% less CPU and over 80% less memory usage per request. These efficiency gains translate into cost savings and improved scalability for handling growing user demand.
However, the project exposed challenges in validating AI-written code. Initial automated tests covering the new API were found to be unreliable, with only about a quarter of real requests matching outputs from the old system. This inconsistency highlighted the importance of robust verification processes when deploying AI-assisted development.
What to watch next
Anthropic’s next steps likely include refining testing frameworks and verification methods, since the company identified code validation as a bigger bottleneck than code generation. The experience may shape how AI is integrated into future software development workflows.
Additionally, monitoring the performance and reliability of the Rust API under continued traffic growth will be critical. Success with this migration could encourage broader adoption of AI-assisted coding practices across other parts of Anthropic’s infrastructure and within the wider tech community.