AI & Compute · 3 min read
Anthropic rewrites Claude's Messages API in Rust, cuts CPU 70%
Anthropic's Rust Messages API now handles all public Claude traffic, using ~70% less CPU and 80%+ less memory per request. Claude wrote the first core version in a week; verification took months.
Key takeaways
- Anthropic's Rust Messages API uses ~70% less CPU and over 80% less memory per request, with median time to first token down ~20% for Claude Code.
- The Rust service took public traffic in September 2026; Claude wrote a first version of the core request path in about a week.
- Verification match rate rose from ~24% in late April to 99.6% by August, using live-request replay through both Python and Rust services.
- API traffic grew roughly 1,800x from early 2024 to fall 2026; a March 2026 partial Rust rewrite had cut CPU only 8-10%.
- Claude agents fixed most mismatches, with an orchestrator grouping records every 10-30 minutes and human review gating merges.

Anthropic's Rust rewrite of the Messages API now serves every public Claude request, and the company says it burns about 70% less CPU and over 80% less memory per request, according to an engineering post published Wednesday, Nov. 25. Median time to first token for Claude Code requests fell roughly 20% between about Sept. 7 and 21.
Claude itself wrote the first version of the core request path in about a week. Public traffic moved to the Rust service in September 2026.
The Messages API is, in Anthropic's words, "the primary way that customers—as well as our own apps, like Claude Code and Cowork—reach Claude." It started life in 2023 as something an early engineer called "basically a request forwarder." Then it grew. The Python service learned to validate requests, build prompts, tokenize, run safety classifiers and parse streamed output, while API traffic grew roughly 1,800 times from early 2024 to fall 2026.
Why the rewrite took months
This wasn't Anthropic's first attempt. A partial rewrite in March 2026 moved only response parsing to Rust and cut CPU by about 8% to 10%. The team judged that not worth the added complexity. The full rewrite was different — but proving it behaved identically to the Python original became the hard part.
The verification burden was substantial. Roughly 700 existing integration tests were tied to the Python code, and an audit found more than 100 weakened assertions in the ported tests. Some 20 binary options produce over a million combinations. Every one of those combinations had to produce the same output as before.
So Anthropic turned the old service into the referee. Live requests ran through both versions, with the model called once and its output replayed to Rust so the model's randomness would not create false mismatches. Engineers couldn't read customer data, so the system recorded only the shape of each difference — the step, the first differing byte, the lengths — and grouped them into "fingerprints."
That machinery caught real bugs. A 1M-token context limit was being read as 200K. A tool description went missing. The share of matching inputs climbed from about 24% in late April to 99.6% by August.
What happens when agents do the debugging
Claude agents did much of the fixing. An orchestrating agent grouped mismatch records every 10 to 30 minutes and assigned worker agents, which each wrote a reproducing request, edited code until both versions matched and added a test. Human pull-request review gated every merge. Engineers still rejected some agent shortcuts that passed the automated checks — a detail worth sitting with.
The authors land on a pointed conclusion: "Verification is the new bottleneck."
The numbers tell a story of scale catching up with a quick 2023 prototype. A request forwarder that handles 1,800x traffic growth, safety classifiers and tokenization is no longer a forwarder. And the performance gains — 70% less CPU, 80% less memory, 20% faster first tokens for Claude Code — land directly on Anthropic's infrastructure bill at exactly that scale.
For rivals watching from OpenAI to Google, the post reads as a data point in a quiet migration: latency and per-request cost at inference scale are being attacked at the API layer, not just in the model. Whether Rust rewrites become standard practice across the industry will likely hinge on whether others find verification — not porting — the affordable half of the job.
mlq.ai (Source)
More from Rebecca Stone
Show full bio
Correspondent covering technology and product news in Semiconductors, chip manufacturing, hardware, AI compute at Chip Dispatch.
1,326 articles