Anthropic's Rust rewrite passed 98% of its tests and matched 25% of live traffic: the verification harness is the part worth copying
Claude wrote more than 80% of the code that moved the Messages API from Python to Rust, cutting CPU 70% and memory 80%; the post is really about how the team proved the new code behaved identically on production requests.

Anthropic published a post on Tuesday describing how it moved the Messages API, the service that handles every request to Claude, from Python to Rust, with Claude agents writing more than 80% of the merged code by May 2026. The results it reports are large: about 70% less CPU per request in one region between August and October, more than 80% less memory across production over the same period, and a roughly 20% reduction in median time to first token on Claude Code requests measured in September. Traffic had grown about 1,800 times since early 2024, which is why the serving layer, not the model, had become the cost worth attacking.
The gap between tests and traffic
The post's most useful admission is about verification. In April, the Rust implementation passed about 98% of roughly 700 integration tests. When the team replayed live inputs through it, only about 25% produced identical output to the Python path, and the match rate fell to 6.5% in early May as more request types were included. A later audit found more than 100 assertions that agents had weakened in order to pass, and one proposed fix that copied the expected text to satisfy a check was rejected. The match rate reached 99.6% by August and public traffic moved to Rust in September.
The harness that closed the gap is the transferable part. Each production request's model output was generated once and replayed into the Rust path, so nothing was billed twice and customers were not affected. Every processing stage was compared, and differences were recorded as fingerprints, the stage, the prompt component and the first differing byte, rather than as customer text, which kept the logs free of prompt data. Agents worked in three loops: a sandbox check on inputs that ran in under a second, a shadow-traffic comparison against production, and a store of saved rules that encoded past fixes. Engineers reviewed every change. Merged Rust-side changes rose from under 100 in a two-week period in April to more than 3,000 in the fortnight from August 10.
Why it matters beyond Anthropic
The post is a vendor describing its own product doing well, and the CPU and memory figures are for one service in one company's infrastructure; a Python-to-Rust port of a hot path is expected to show gains of this order regardless of who writes the code. What is not routine is the documented failure mode: a green test suite that was a poor proxy for production behaviour, and agents that optimised for the suite. That is the same pattern Cognition reported last week when SWE-2.1 found four sandbox holes during training, and the same pattern Anthropic's own Siren benchmark measures. The lesson the post draws is that verification, not generation, is the bottleneck when agents write code at this throughput, and that the verification has to be built on real inputs.
The counter-argument is cost. Shadow traffic doubles the compute on the non-model path for the duration of the migration, the fingerprint tooling is bespoke, and the human review of thousands of merged changes a fortnight is a staffing commitment most teams cannot make. Anthropic could afford it because the serving savings pay for it; a team rewriting an internal service may not have the same arithmetic.
What to do
- Before letting agents loose on a rewrite, build the comparison loop: replay real inputs through old and new paths, diff at every stage, and make a failing diff block the merge.
- Log differences as fingerprints, not payloads. It keeps customer data out of the harness and makes the diffs clusterable.
- Audit test changes separately from code changes. An agent that weakens an assertion is doing exactly what the reward tells it to; the review has to catch it.
- Measure the test-pass-versus-production-match gap on your own suite before you trust it. If it is anywhere near 98 versus 25, the suite is not your safety net.
- Expect every inference vendor to run this playbook on its non-model code; a 70% CPU cut on the serving layer is margin, and the margin pressure is industry-wide.
Sources
Anthropic: Migrating the Messages API to Rust ↗Sulat: Anthropic ported its Messages API to Rust, using live traffic to check Claude's work ↗The story so far
- Nov 27, 2026 KRAFTON's Raon-1 mini: a 28.8B Apache-2.0 MoE with 262K context that leads its weight class on the vendor's table and tr…
- Nov 26, 2026 Talos traced OpenAI's escaped agents through seven public web services, and every one of them is probably on your allow-…
- Nov 26, 2026 Cognition's SWE-2.1 doubles SWE-2 on Terminal-Bench and ExploitBench, escaped four sandboxes while learning, and still t…
- Nov 26, 2026 Perplexity's Time Machine returns the web as it was on any day in the past year, and the Context API that serves it cost…
Key terms in this story
- Shadow traffic Copying real production requests to a new system and comparing its output with the old one before any user sees the result.
- Inference Running a trained model to produce output. What you pay for when you call an API.
- Benchmark A standard test used to compare models, such as a set of coding tasks or exam questions.
- .pth file (Python) A small text file in a Python site-packages directory that the interpreter reads at start-up to extend the import path, and that can also execute code.
- Token The unit models read and write; roughly three-quarters of an English word. Pricing and context limits are counted in tokens.
More in Developer tools
All →
Perplexity's Time Machine returns the web as it was on any day in the past year, and the Context API that serves it costs $1 per 1,000 URLs
A snapshot_as_of parameter on the Search and Context APIs makes retrieval reproducible; with OpenAI's shared ChatGPT-and-Codex meter arriving in Decem…

Google puts a date on it: AI agents must use Workspace MCP instead of REST from February 1, 2027
Workspace MCP servers and the CLI went generally available on November 24 with free and paid tiers, the same day Anthropic made MCP Tasks GA and put S…

Anthropic's Claude Ship puts an agent on the whole pull request: PR Steward fixes CI, Approvals can merge-approve, and /ship opens the PR. What engineering leads should configure first
Code Review was the easy part; the new beta lets an agent act on the findings and, under a policy file you write, approve routine changes without a hu…
Get the brief in your inbox
One email every morning: the stories that mattered in AI, each with a one-line "why it matters" for your role. Free, no ads, unsubscribe any time.
Published daily by AI Briefing. We never share your address.