Anthropic Rewrites Its Messages API in Rust, With Help From Claude

  • AI
  • November 26, 2026
  • 0 Comments

For years the Messages API that sits behind Claude ran on Python. On Nov. 25, Anthropic said the service had been rewritten in Rust, that most of the new code was produced by Claude, and that the payoff was measured rather than asserted: about 70% less CPU per request, more than 80% less memory, and a median gain of roughly 20% in time to first token.

The company published the account on its own blog, and it gives little room to the argument that usually accompanies a language migration. Nobody claims Python was the wrong choice when the service was small. The engineering team’s explanation is narrower. Incremental optimization had accumulated complexity that no longer paid for itself, so the service was rebuilt as a unit instead of patched once more.

That is a familiar threshold in infrastructure work and an unpopular one to cross. Each local fix is cheap and defensible on its own; together they leave a codebase where the next fix costs more than the last, and where whoever proposes a rewrite has to argue against years of sunk decisions. Anthropic’s engineers made the argument the other way round. They put a number on the payoff and let the number carry it.

The verification method matters as much as the result. According to the post, the new service was checked against the old one by running both on shadow traffic and comparing the answers, so the migration was exercised on real request shapes before it took real requests. Shadow comparison is the ordinary way to move a high-volume API without a maintenance window. It is also the only way to make an agent-written rewrite auditable. Nobody reads tens of thousands of lines of generated Rust, but a large enough sample of identical responses is a form of reading.

What the numbers mean depends on where you sit. Inside the serving stack, a 70% cut in CPU per request changes how many conversations fit on a given fleet, which is the same thing as changing the cost per token at the margin. Memory falling by more than 80% does something adjacent: it raises the number of requests a machine can hold at once, and that shows up as headroom during a spike rather than as a line item on a bill.

The latency figure is the one users will feel. A median improvement of about 20% in time to first token is modest next to the CPU cut, but it lands on the part of the product people actually watch. A chat window that starts answering a fifth sooner reads as faster even when the finished response takes the same time to arrive.

None of the three figures comes with an absolute baseline. The post does not say what the old service cost to run, how many requests pass through the service, how long the migration took, or whether the error rate moved. A percentage measured against an undisclosed denominator describes a direction, not a budget.

The more consequential claim is the one about authorship. Most of the Rust was written by Claude and then reviewed by people. That is a different arrangement from autocomplete, in which a model suggests a line and a person accepts or rejects it inside an editor. Here the model produced the bulk of a production service, and the people supplied the specification, the review and the testing that stood between generated code and live traffic.

Anthropic’s own summary of that part is careful. Code written by an agent, the engineers said, still needs months of testing and human review before it can go into production. The sentence is easy to read past, and it is the one that sets the boundary of the demonstration. A rewrite Claude can draft in weeks still requires a quarter of human attention before it is trusted with the traffic.

For the rest of the industry the sample is more useful than the result. Every large model provider now runs services where the cost of a request is decided by code that has nothing to do with model quality: routing, tokenization, streaming, retries, the machinery around the model. Those are the layers where unit economics are made, and they are the layers a model is now competent to help rewrite.

There is a temptation to read the post as a verdict on Python. It is not one. A serving path is a narrow, well-specified component with clear inputs and outputs, which is the shape a code-generating model handles best. The post describes a service that was a good candidate for a rewrite. It does not describe a language that had become a liability.

What remains open is whether the method travels. An API rewrite has the property that correctness is cheap to test: the same request goes in, the same answer should come out. Services with state, migrations and partial failures are harder to verify by comparison, and a model that drafts the code still leaves the hard part with the reviewer.

For now the disclosure amounts to a data point rather than a template. Anthropic has shown a service it rewrote, a saving it measured, and a review process it declined to compress. Whether the 70% reaches a price a customer can see, or stays inside a cost line that never touches one, is the question the post leaves for the next quarter.

Related Posts

  • November 26, 2026
  • 29 views
42 States Move to Block the Sale of Character.AI Chat Logs

The number in the letters is 21 million. That is how many American accounts’ private conversations would change hands if Character.AI sells its user chat logs as part of its…

  • November 26, 2026
  • 40 views
OpenAI Tests Private Inference for Enterprise Customers

Sam Altman announced it on X on Nov. 25, in the flat register the platform rewards: OpenAI has opened a private inference test to a small group of enterprise customers,…