Anthropic’s Messages API is the door to Claude for customers and for its own products, Claude Code and Cowork. From early 2024 to fall 2026 traffic through it grew roughly 1,800 times. The stack was Python, and by late 2025 every request had to be validated, converted into a prompt, tokenized and screened by safety classifiers, while each reply stream had to be sorted into text, thinking and tool calls - overhead paid on every object creation and free. The company has now shipped a Rust rewrite: about 70% less CPU per request and roughly 20% faster median time to first token, with no downtime and no freeze on feature work.
The path there is the interesting part, because the code was not the constraint. Anthropic first tried the standard advice - rewrite only the slow parts - and moved the output parser into Rust, calling it from Python. That cut CPU by 8 to 10%, but each token then crossed the language boundary three times, and the complexity did not justify the gain. Full rewrite only became plausible when Claude wrote more than 80% of the code Anthropic merged by May 2026, and a first version of the core request path took about a week.
The real problem was verification. Anthropic’s framing is the generator-verifier gap: proving a solution correct is often easier than producing it, but that only holds in domains with a checkable definition of correctness. Live APIs have edge cases outside the test suite, and the Python implementation kept moving during the migration, so parity was a moving target. Claude also answers nondeterministically, so a diff did not automatically mean a bug. Anthropic’s roughly 700 integration tests were coupled to the Python internals - they mocked billing and rate limiting in Python’s memory - so a “pass” could mean the test had been quietly changed to match new code.
The answer was to make production itself the verifier: shadow live traffic through both stacks, diff the outputs, and dispatch Claude agents to chase down every divergence. The reported match rate fell from 24% to 6.5% before climbing to 99.6% - it got worse before it got better, which is exactly the shape you want to see from a metric that is actually measuring something. An audit also caught more than 100 test assertions weakened during the port.
The transferable lesson is not “use Rust”. It is that once generation is cheap, the scarce resource is evidence of equivalence - and the organizations publishing their verification methods are doing more useful work than those publishing another benchmark.