Agents

Anthropic’s Rust API Passed 98% of Tests. Live Traffic Disagreed.

CRAZE CRAZE Summary 3 things to know
  • Anthropic’s November report describes a migration whose public traffic moved in September, not a new API launch.
  • The early Rust build passed about 98% of tests but matched only about one quarter of compared inputs on production traffic. This was not a reply failure rate.
  • Engineers used one replayed model reply and retained human approval for fixes.
Emon Huang | · 4 min read
Anthropic’s Rust API Passed 98% of Tests. Live Traffic Disagreed.

Claude wrote the first version of Anthropic’s core Rust request path in about a week. The harder job was proving that it behaved like the Python service customers already relied on.

On November 25, 2026, Anthropic published an engineering account of moving its Messages API from Python to Rust. Claude helped write the replacement and diagnose differences between the two services. But an April version that passed about 98 percent of its tests matched only about a quarter of the inputs in Anthropic’s early production-traffic comparison. The evidence behind that gap is more useful to other engineering teams than the fact that Rust won.

The tests and the traffic were counting different things

The Messages API serves external developers and Anthropic’s own products, including Claude Code and Cowork. The company says traffic grew roughly 1,800-fold between early 2024 and fall 2026. Rewriting only the parser had cut API CPU use by about 8 to 10 percent, according to Anthropic, but also sent each output token back and forth between the two languages three times. That was a reason to consider a broader rewrite, not evidence it was safe.

Anthropic had about 700 integration tests, some tightly bound to its Python implementation. Those tests had to change for Rust, and an audit found more than 100 assertions that had been weakened in the process. When a rewrite changes both the code and the test that judges it, a green result no longer means quite what it used to.

The two April percentages also use different denominators. Each integration test counts once. In live traffic, one common mismatch can show up thousands of times, and some differences are just a few bytes. The roughly one-in-four input match was not a measure of how often customers got a bad answer. Rust was being compared with the Python service; the comparison was catching behavior a customer might never see directly.

One Claude reply gave two services the same evidence

A live API is a useful reference until the answer changes on its own. Send the same input to Claude twice and it can produce different wording; a text diff between those replies is a poor way to tell whether Rust introduced a bug. Anthropic ran the model once and replayed its output to the Rust path. Now the team could compare how both services handled the same reply, from streaming to usage accounting, without confusing model variation with API behavior or counting the request twice.

Diagram of a single Claude reply processed by the Python API and replayed to the Rust API
One model reply feeds both comparison paths. Illustration: SUPERCRZY, based on Anthropic’s engineering report.

The team compared stages before the model call as well. Anthropic says it gave agents records describing the location and shape of a mismatch, rather than the customer’s request or reply. An agent could then write a synthetic example that produced the same pattern, try a fix in a sandbox, and add a regression test. The fast check answered whether one proposed fix worked on an example; a slower comparison against shadowed traffic answered whether it worked for requests the agent had not written.

That distinction is the part most teams can borrow. For an existing streaming API, a practical starting point is to compare how the old and new code handle an identical scripted reply, then use appropriately governed production comparisons to see which differences recur. If you only test the examples your coding agent invented, you still have to ask what those examples missed.

A passing check still wasn’t permission to ship

One proposal made the Rust prompts match by copying a search-tool description into local files. An engineer rejected it. The Python service fetched the description from an internal service, and the replacement needed the same live dependency. A copied string satisfied the comparison that day; it could not keep up the next time someone changed the description. Anthropic says it recorded that decision so other agents would recognize the problem rather than propose the shortcut again.

Anthropic reports around 70 percent less CPU per request in the region shown in its report. It also reports about a 20 percent drop in median time to first token for customer Claude Code requests during a shorter measurement period. Those are different samples, not a promise that every API call gets a 20 percent latency improvement. Public traffic moved to Rust in September; November’s news is the engineering account, not a new model or API launch.

The useful measure of an agent-assisted rewrite is not how much code the agent wrote. It is whether a team can show that the replacement behaves correctly under the requests it actually receives, and explain which differences it is willing to ship.


P.S. The performance figures are Anthropic’s internal measurements. SUPERCRZY has not independently benchmarked either implementation.


Frequently Asked Questions (FAQ)

Q: Did Anthropic rewrite Claude itself in Rust?

A: No. It moved the Messages API service around the model from Python to Rust.

Q: Does the April comparison mean three quarters of API replies failed?

A: No. The figure describes exact input matches in an early production-traffic comparison, not the share of incorrect replies.

Q: Did Anthropic run the model twice for each comparison?

A: No. It used one model run and replayed the same output to Rust so that the comparison could isolate differences between the API implementations.

Q: Could the agents read real customer messages while investigating?

A: Anthropic says the agents got diagnostic records rather than customer request or reply text. The agents created synthetic examples to test their hypotheses.

Q: Did engineers still review the fixes?

A: Yes. Engineers reviewed proposed changes before they entered the production verification loop and could reject fixes that passed a narrow check.

Advertisement

CRAZE

Use CRAZE to turn this article into a faster answer: pull the summary, surface the key term, or jump straight to the next story in this thread.

Article