Anthropic just showed what its own AI can do to a production system. In a November 25, 2026 post, the company explained how the anthropic rust migration moved its Messages API from Python to Rust — with Claude writing the new code. Traffic had grown about 1,800 times since early 2024, and the rewrite cut CPU use by about 70% per request.
The Messages API is the main road into Claude — and the engine behind Claude Code and Cowork.
Why Python had to go
Anthropic built the Messages API in 2023 as a simple request forwarder.
Then the API grew up. By late 2025, every request had to be validated and screened, and replies sorted into text, thinking, and tool calls. Python added overhead at every step — and traffic had grown roughly 1,800 times since early 2024.
The patch that wasn’t enough
The cautious route came first: rewriting the output parser in Rust saved only 8% to 10% of CPU, while each token crossed between languages three times.
A full rewrite looked impossible: test suites never cover all production behavior. In 2024, one engineer suggested it; another settled it: “We are not rewriting the API in go or rust!” What changed was the cost of writing code. By May 2026, Claude wrote more than 80% of merged code — including the core request path, in about a week. One question remained: could anyone prove the new version behaved like the old one?
What Anthropic learned
“Verification, not generation, had become the bottleneck.”
— Anthropic engineering team, November 25, 2026

98% of tests passed. Only 25% of traffic matched
The team started with about 700 integration tests.
- Tests were coupled to Python: they ran the Python API inside the test’s process and mocked services like billing in memory. A “pass” could mean the test had been changed. An audit found more than 100 weakened assertions.
- Tests were incomplete: 20 binary options make over a million combinations.
In April, the Rust API passed about 98% of its tests — yet only about a quarter of production inputs matched. One gap was tiny: Python escapes certain characters, like an emoji, in JSON tool calls; Rust wrote them as-is. The fix: run the model once and replay its output to Rust.
| Result | Number (per Anthropic) |
|---|---|
| Traffic growth, early 2024–fall 2026 | About 1,800x |
| CPU per request | About 70% less |
| Median time to first token | About 20% lower |
| Tests passing, April 2026 | About 98% of ~700 |
| Production inputs matching, April 2026 | About 25% |
How the production API became the referee
Anthropic turned the live Python API into the verifier. The technique is called shadowing: run requests through old and new code and compare. But standard tools assume a request can run twice and a service is deterministic. Neither held here.
Three adjustments made it work:
- Replay, not a second call. The model ran once; its output went to both versions.
- Checkpointing. Both versions handle a request in the same steps; comparing them showed where they first diverged.
- Fingerprinting. Each difference was recorded by where it began and how big it was.
Nobody read customer requests. The system recorded only the shape of each difference — never the text. A script grouped diffs every 10 to 30 minutes and woke a coordinating agent only for a new kind, which assigned a worker agent and opened a Slack thread.

Three loops, one memory
The fixes ran through three loops. The inner loop gave agents a cloud sandbox with fast local checks: the input check never called the model, so comparing versions took under a second. The outer loop validated fixes on shadowed traffic.
The memory loop made sure no lesson was learned twice. When an engineer rejected a shortcut — an agent had copied a missing tool description into local files — the agent saved a note with the fix. Later agents linked new records to the known bug.
Other lessons became general rules. After one agent guessed at Python’s behavior, an engineer made it a rule to port exactly what Python did. In June, an agent turned about 60 review comments into rules for CLAUDE.md.
How to profit: verification is the new bottleneck
Writing code just got cheap. Proving it right is now the bottleneck — where the money is.
- Sell verification, not code: shadow-traffic testing, parity checks, migration audits.
- Shadow before you cut over. Replay real traffic — never trust a green test suite alone.
- Fingerprint your diffs. Group failures by where they start.
- Put humans at the seam. Let agents iterate in sandboxes; keep a person reviewing production fixes.
- Write the lesson down. Turn each review into a rule every future agent reads.
For API businesses, a 70% CPU cut is a margin expansion. For everyone else, the lesson is the same — verify fast, ship fast.
Frequently asked questions
What is Anthropic’s Messages API?
The way customers — and Anthropic’s apps Claude Code and Cowork — reach Claude.
How much faster is the Rust API?
About 70% less CPU per request and about 20% lower median time to first token.
Did Claude write the whole migration?
No. Claude wrote a first version in about a week. Engineers designed the verification and reviewed every fix.
Why did 98% of tests pass but only 25% of traffic match?
The tests were coupled to Python and incomplete: over 100 assertions had been weakened.
Is the Rust API live now?
Yes. Public traffic moved to Rust in September 2026, with no downtime and no feature freeze.