Anthropic rewrote the API behind Claude in Rust with Claude writing most of the code, and says checking the work was the hard part
A rare, detailed engineering account of letting AI agents do a rewrite: 70% less CPU, and 98% of tests passing while only a quarter of real traffic matched.
Affects World
Anthropic published an engineering write-up on November 25 about moving its Messages API, the main way customers and its own apps reach Claude, from the Python service written in 2023 to Rust. It says traffic grew roughly 1,800 times between early 2024 and autumn 2026, and that the rewrite cut CPU per request by about 70%, memory per request by more than 80%, and median time to first token by about 20%. Public traffic moved to Rust in September 2026 with the service staying online.
Claude wrote the first version of the core request path in about a week. The post says the hard part came next: "Verification, not generation, had become the bottleneck." The roughly 700 existing integration tests were not enough; by April the Rust version passed about 98% of them while only about a quarter of production inputs matched Python's, and an audit of the ported tests found more than 100 weakened assertions.
From April to August the team ran production traffic through both versions, replaying the model's single reply to each so both worked from the same data, and grouped the differences by "fingerprint" without storing request or reply text. Claude agents worked through the difference types while engineers reviewed the fixes. Input matching reached 99.6% by August. The post warns that a verifier "can tell an agent whether the outputs matched, but not whether the fix is good enough to ship", and cites a shortcut an engineer rejected as throwaway code.
-
Rust (programming language)
After exploring Migrating our Messages API to Rust, the language they moved to is introduced in Rust (programming language).
Rust is a general-purpose language that emphasises performance, type safety, concurrency and memory safety, drawing on ideas from functional programming and using structs, enums and traits instead of classes and inheritance.
Wikipedia · Wade · 5 min
0
Rabbit holes often lead to Wikipedia. Consider donating.