Anthropic has migrated its Messages API from Python to Rust to improve system performance. The company utilized its own AI model, Claude, to generate the majority of the code during the transition process. Engineers on the project reportedly lacked prior experience in Rust, relying on the model for technical implementation while focusing on architecture and strategy.

To ensure the new version matched the legacy system, the team employed shadow traffic. This method involved running real requests through both the Python and Rust versions simultaneously to verify that outputs were identical. The company reports that this migration resulted in a reduction of CPU usage per request by approximately 70%.

The project highlights the generator-verifier gap, where AI agents handle repetitive coding tasks while humans manage verification and system design. By reducing compute requirements per request, Anthropic aims to increase the capacity of its hardware to serve more API traffic. The company notes that this approach allows for significant performance gains without the need for specialized language training.