Back view of a female software engineer working at a multi-monitor setup in an office
LabsBased on company claims

Anthropic moved its Messages API from Python to Rust with Claude agents, and says CPU use fell 70%

By Zain·

Photo: ThisIsEngineering / Pexels

Anthropic's November 25, 2026 engineering post says Claude agents did most of the work of rewriting the Messages API in Rust. The company reports about 70% less CPU per request, and says verification, not code generation, was the hard part.

Anthropic says it rebuilt the software that sits in front of Claude, the Messages API, in a new programming language, and that its own AI agents did most of the labor. The company's engineering post, dated November 25, 2026, reports about 70% less processor use per request. The more useful detail is how the team kept the rewrite from breaking customers, because that method is what other companies will copy.

What Anthropic says it did

The Messages API began in 2023 as a Python service that mostly forwarded requests. Over time it picked up dependencies on libraries owned by other teams, which made it hard to change. Traffic grew about 1,800 times between early 2024 and fall 2026, according to the post.

A first attempt in March 2026 rewrote only the output-parsing code in Rust. It cut CPU use by roughly 8 to 10%, but every token crossed the boundary between Python and Rust three times, so the team moved to a full rewrite in September 2026. The post says Claude wrote the first version of the core request path in about a week. Public traffic moved to the Rust service in September.

The results, and who measured them

Anthropic reports about 70% less CPU per request and more than 80% less memory per request from August to October. The CPU figure was measured in one region, and memory across production. Median time to first token dropped about 20% in a window of roughly two weeks in September, measured on customer Claude Code requests.

Every one of those numbers comes from Anthropic. No outside party has reproduced them, and the post itself says some metrics come from traffic subsets or shorter windows. A month earlier, platform engineering lead Katelyn Lesse had given a lower estimate on a podcast, about 40 to 50% less CPU and 10 to 20% faster first tokens, according to a write-up on explainx.ai that relays her remarks. The later post's larger figure is consistent with a project still being tuned, but it is a reminder to treat a single company's benchmark as a claim.

There is also a fair confounder. Rewriting a monolith that had accreted for three years would likely improve efficiency in any language. The CPU gain applies to the API layer, not to the model's token generation, and the numbers do not prove that Rust was the cause.

“Verification, not generation, had become the bottleneck.”

Anthropic engineering post, 'Migrating our Messages API to Rust', November 25, 2026
Close-up of HTML and CSS code displayed on a computer screen, ideal for tech and programming themes
Engineers reviewing code, the human gate Anthropic says stayed in place during the migration. Photo: Bibek ghosh / Pexels

How the agents were kept honest

The most interesting part is the verification design. The existing Python service served as the oracle, since its behavior was the real definition of correct. The first test suite had about 700 integration tests, and an audit found more than 100 weakened assertions in the ported tests. Twenty binary options alone produce over a million configurations, so tests could never cover them all.

Instead the team shadowed live traffic. The model was called once and its output replayed to the Rust path, so no request was double-billed and nondeterministic replies did not create false differences. A checkpointing system compared each step of the pipeline and recorded only the shape of each difference, such as the step, the first differing byte and the lengths. No request or reply text was read, which protected customer privacy.

A monitoring script ran every 10 to 30 minutes, grouped differences by fingerprint and alerted a coordinating agent only to new kinds. That agent assigned a worker agent to each. Workers ran in cloud sandboxes, guessed causes, wrote requests that triggered them, edited Rust until the two versions matched, and added tests. Fixes were then reviewed, deployed and checked against shadowed production traffic.

The match rate tells the story. Rust passed about 98% of its tests in late April while matching only about 24% of shadowed inputs. It fell to 6.5% in early May as coverage widened, and reached 99.6% by August. Changes merged to the Rust service rose from under 100 per two weeks in April to over 3,000 in the period starting August 10, though the post notes not all of that was migration work.

Where humans stayed in the loop

The authors are candid about limits. Agents optimized for matching outputs, so they sometimes took shortcuts. In one case an agent proposed a workaround for web search tool descriptions that an engineer rejected as throwaway code. Verifiers cannot tell whether a difference is a bug or an intentional change, or whether a fix is good enough to ship. Engineers reviewed proposed fixes in Slack and pull requests, and their corrections became rules in CLAUDE.md files, lint rules, regression tests and a merge check requiring a matching Rust change for every Python change.

The post's summary line is blunt: "Verification, not generation, had become the bottleneck." That fits the broader pattern we have tracked, in which labs report agents carrying a growing share of their own engineering. Our AI research acceleration tracker logs the other indicators, and Anthropic's own S-1 language on recursive self-improvement is the context for why a lab would publish this.

What it does and does not show

It shows that an agent loop around a strong verifier can move a large production system, with humans setting rules and judging edge cases. It does not show that agents can design a system, since humans set the architecture and migration plan. It does not show the savings generalize, and it says nothing about safety, since this is infrastructure code rather than model training.

What we would watch

Three things. First, whether Anthropic publishes the shadowing tooling or only the description. Second, whether customers see the promised latency in their own traces. Third, whether the next post covers model-training code, where a wrong answer is far harder to detect than a mismatched byte. A company that can verify its API byte for byte has not yet shown it can verify its successor model the same way.

Frequently asked questions

Did Anthropic rewrite its Messages API in Rust with Claude?

Yes, per Anthropic's November 25, 2026 engineering post. Claude agents did most of the implementation and fixing, working against the existing Python service as the oracle, with engineers reviewing fixes. Public traffic moved to the Rust service in September 2026.

How much CPU did the Rust migration save?

Anthropic reports about 70% less CPU per request, measured in one region from August to October 2026, and more than 80% less memory per request. The figures are the company's own and have not been independently reproduced.

Did Claude write all of the Rust code with no human review?

No. The post says engineers reviewed proposed fixes, rejected at least one shortcut an agent proposed, and set the rules that agents followed. The authors say verifiers cannot judge whether a fix is good enough to ship.

What is shadow traffic and why did Anthropic use it?

Shadowing means calling the model once and replaying its output to the new Rust path, so requests are never double-billed and random replies do not create false differences. The team compared each pipeline step and recorded only the shape of any difference.

Do the speed gains prove Rust was the reason?

Not by themselves. The gains apply to the API layer, and a cleaner rewrite of an older Python monolith could explain part of them. An earlier podcast estimate from Anthropic's platform lead was 40 to 50% less CPU.

Sources

What each one is, and whose it is.

  1. 1

    Migrating our Messages API to Rust, Anthropic (November 25, 2026)

    Vendor announcement
  2. Press reportIndependent of the vendor
  3. Press reportIndependent of the vendor