Originally published at Rohan Tech Official.
Anthropic has rebuilt the Messages API — the service that connects customers and its own apps to Claude — from Python to Rust, and Claude did most of the writing. The results, shared in an engineering post on November 25: about 70% less CPU per request, over 80% less memory, and median time to first token roughly 20% faster.
The rewrite went live for public traffic in September 2026, with no downtime and no feature freeze. The interesting part is not that an AI wrote the code. It is how Anthropic proved the new version behaved exactly like the old one.

Why the rewrite was needed

Anthropic built the Messages API in 2023 as a simple Python service. Then Claude took off: API traffic grew roughly 1,800 times between early 2024 and fall 2026, and every request now passes through validation, tokenisation and safety classifiers.
A partial rewrite in March 2026 moved only response parsing to Rust and saved 8–10% CPU — not enough to justify two languages. A full rewrite looked huge until the economics changed: by May 2026, Claude was writing more than 80% of the code Anthropic merged. Claude wrote a first version of the core request path in about a week.

The hard part was proving it worked

The team had about 700 integration tests, but they were tied to the Python code, and an audit found more than 100 weakened assertions. In April the Rust API passed 98% of its tests, yet only about a quarter of real production inputs behaved identically.
The problems were real: the Python API kept changing as new models shipped, Claude's replies are nondeterministic, and 20 binary options create over a million combinations. Anthropic's fix was to turn the live Python API into the answer key. Real requests ran through both versions, but the model was called once and its output replayed to Rust, so nobody was billed twice and randomness could not create false mismatches. Engineers never read the actual requests — only the shape of each difference.
Checkpointing found where the versions first split, fingerprints told one bug from another, and three agent loops did the fixing: a fast inner loop in a sandbox, a slower outer loop against shadowed traffic, and a memory loop that turned corrections into permanent rules. A coordinating Claude agent grouped mismatches every 10 to 30 minutes and assigned worker agents, with human review gating every merge. Matching inputs rose from about 24% in late April to 99.6% by August.
"Verification, not generation, had become the bottleneck," the engineers wrote. AI can now draft a production system in days — trusting that draft with live traffic is the slow part, and Anthropic's answer was to let agents do the checking too.