Anthropic is betting $900 billion that customers won't switch to cheaper AI
Telecom firms went bankrupt in 2002 when the price of moving data collapsed. Anthropic’s shareholders could lose money the same way if AI gets cheaper
Many problems require a generator-verifier gap, where verifying a solution is easier than creating it. Sudoku exemplifies this. Verifying a solution is straightforward, but finding one can be time-consuming. Ambitious Claude projects often depend on this gap, such as formalizing mathematical proofs or migrating large codebases with reliable verification.
As Claude's capabilities grew, it started tackling live systems, where generating work is simpler than verifying it. Users often rely on edge cases and quirks outside test suites, making trust in the migration crucial. Anthropic faced this challenge when migrating its Messages API from Python to Rust. This API is central for customers and Anthropic's apps, experiencing significant traffic growth from 2024 to 2026.
Rust would reduce CPU usage per request by a large margin. Writing Claude's core request path in Rust took about a week, but verifying the migration's parity with the production API proved difficult. The Python API kept changing, making parity a moving target. Claude's nondeterministic replies and lack of access to customer requests further complicated the process.
The solution was to turn the production Messages API into a verifier. By using the existing system as an oracle during migration, Anthropic could test the new Rust version on production traffic, identify differences, and automatically fix them. This enabled a 70% reduction in CPU per request and a 20% decrease in median time to first token without service downtime or feature freeze.
The Messages API was initially developed in Python for internal research purposes. Over time, it became deeply integrated with Python libraries, making a language change challenging. By late 2025, every API request required validation, conversion into prompts, tokenization, safety checks, and sorting of tokens. Python added significant overhead to these steps.
Anthropic decided to rewrite the code that parses the model's output in Rust, reducing CPU usage by 8% to 10%. However, incremental improvements came with added complexity. By May 2026, Claude was responsible for over 80% of the code in the migration project. The challenge was defining "correct" for the migration, as the Python API's changes created a moving target. Verification became the bottleneck.
Rewritten by urgent.news; may contain errors — check the original.
Sources: anthropic.com · qz.com
This story
This is one outlet's version. Read the fullest account.