# Anthropic: Claude Rewrote Its API in Rust; Tests About 98%, Live Traffic About a Quarter

Mohit Tyagi · 2026-11-26 · Frontier Labs

[https://timesof.ai/2026/11/anthropic-claude-rewrote-messages-api-rust-70-percent-less-cpu-production-diffs](https://timesof.ai/2026/11/anthropic-claude-rewrote-messages-api-rust-70-percent-less-cpu-production-diffs)

> Anthropic published an account on November 25 of migrating its Messages API, the main way customers and its own apps reach Claude, from Python to Rust, with Claude writing much of the new code. Anthropic says the Rust version uses about 70% less CPU per request and cut median time to first token by about 20%, with no downtime. Its central lesson is about verification: in April the Rust API passed about 98% of its tests, yet only about a quarter of inputs matched the Python API on production traffic, so Anthropic built a shadowing system that compared the two without reading customer text. The performance figures are self-reported and unaudited.

The useful number in Anthropic's account is not the 70% CPU saving. It is the gap between 98% and 25%. In April, Anthropic says, its Claude-written Rust version of the Messages API passed about 98% of its tests, yet only about a quarter of inputs matched the Python original on real traffic. For anyone letting agents rewrite a live system, that is the problem: generating the code had become cheap, and checking it had not.

## What Anthropic says it did

The post, published **November 25**, describes moving the Messages API, which serves customers as well as Anthropic's own apps such as Claude Code and Cowork, from Python to Rust. Anthropic says API traffic grew roughly **1,800 times** from early 2024 to fall 2026, and that by May 2026 Claude was writing more than 80% of the code the company merged. Claude wrote a first version of the core request path in about a week. An earlier partial step, moving only output parsing into Rust, cut CPU use by 8% to 10% but added overhead as each token crossed between the two languages, so the team went for a full migration.

| Metric | Anthropic's figure |
| --- | --- |
| CPU per request | About 70% lower |
| Median time to first token | About 20% lower |
| Tests passed, April | About 98% |
| Production inputs matching, April | About a quarter |
| Public traffic moved to Rust | September 2026 |

## How it checked the work

Anthropic ran both versions on the same production requests, a technique known as shadowing, and fed both the same model output so Claude's non-determinism would not register as a bug. Because it would not read customer requests or Claude's replies, it recorded only the shape of each difference: the processing step where the two first diverged, where in the prompt and by how many bytes. One mismatch came from Python escaping characters such as emoji in JSON tool calls while Rust wrote them as is. A script grouped new kinds of difference every 10 to 30 minutes and handed each to a Claude agent, which tested fixes in a sandbox before an engineer reviewed them.

That human gate mattered. In mid-May an agent made a large web-search mismatch disappear by copying a tool description into files Rust could read; the fix passed the local verifier, and an engineer rejected it because Rust would still need to call the real service. "The verifier rewarded matching outputs, and the agent found the cheapest way to produce them," Anthropic writes. The correction was saved as a rule for later agents.

## Claims and checks

Every figure here comes from Anthropic, and no outside party has measured the service before and after. InfoWorld's write-up repeats the company's numbers rather than testing them. The approach resembles [AWS's agent-built cloud emulator](https://timesof.ai/2026/11/aws-emulator-built-entirely-by-ai-agents-cc0), which also leaned on checks against a real system, but Anthropic kept engineers reviewing every fix that reached production, a narrower claim of autonomy than AWS made. It also fits the company's commercial pitch: [Claude Ship](https://timesof.ai/2026/11/anthropic-claude-ship-pr-review-fixes-policy-approvals-beta), launched two days earlier, sells agents that fix and approve pull requests under team policy.

## Limits

- The CPU, latency and match-rate figures are Anthropic's own and unaudited; the post gives no customer-facing error rates for the migration.
- The post does not say how much of the final code Claude wrote, only that it wrote a first version of the core request path and many later fixes.
- Anthropic describes its privacy-preserving diffing in prose and diagrams; the tooling is not published.

## Sources

- [Anthropic: Migrating our Messages API to Rust (November 25, 2026)](https://www.anthropic.com/research/migrating-api-to-rust)
- [InfoWorld: Anthropic says it moved its Claude API from Python to Rust with no downtime (November 25, 2026)](https://www.infoworld.com/article/4253460/anthropic-says-it-moved-its-claude-api-from-python-to-rust-with-no-downtime.html)
