What happened
Anthropic has migrated the Messages API, the main service behind Claude applications, from Python to Rust. According to the company, Claude agents wrote and fixed much of the code during the migration.
Tests weren't trusted
Anthropic said its automated tests were not reliable enough, so it ran the old and new API versions side by side on real user traffic to compare them. The goal was to measure whether the rewritten code behaved the same way in production.
The result
The company says the new API uses about 70% less CPU per request. Rust is a programming language focused on memory safety and high performance, allowing more requests to be handled with fewer resources than Python.
Why it matters
This is a notable example of AI agents writing their own infrastructure code, with the result measured on a live system. It also points to infrastructure efficiency that directly affects the cost of serving large language models.



