Anthropic rewrites its API in Rust with Claude at the keyboard: writing the code wasn’t the hard part

29 Nov 2026 | Artificial intelligence

Rewriting from scratch the system that serves every one of your customers, without switching it off for a minute and while the team keeps shipping features, is the kind of project any CTO tries to avoid. Anthropic has just explained how it did exactly that with its Messages API, the gateway every request to its Claude models goes through, and with a twist: much of the work was done by AI agents. The engineering write-up, published on 25 November, is one of the most detailed accounts so far of a large AI-driven migration in production.

From Python to Rust, without closing the shop

The API was born in 2023, written in Python. Since early 2024, the company says, its traffic has grown roughly 1,800-fold. A first, partial attempt, which called a Rust component from Python, shaved only 8 to 10% off CPU usage, and the team dropped it as not worth the trouble. So they decided to rewrite the whole thing in Rust, a faster and more memory-efficient language.

The results Anthropic reports: about 70% less CPU per request, more than 80% less memory per request, and a drop of around 20% in median time to first token, meaning how long it takes for the answer to start arriving. All without taking the service offline or freezing development. Public traffic moved to the new version in September 2026.

What the AI did, and what the people did

According to the write-up, Claude produced a first version of the core request path in about a week. What came next was the long part. In late April, only 24% of real requests produced exactly the same output in Rust as in Python; in early May that figure actually dipped to 6.5%, and by August it reached 99.6%.

To get there, the team turned production traffic itself into the exam. Each request was processed in parallel by both versions, reusing the same model output so the comparison was fair, and checked step by step for where they diverged. Without reading customers’ content: only a kind of “fingerprint” of each difference was stored. Agents received those fingerprints, proposed fixes and tested them in sandboxed environments.

People didn’t disappear; they moved. They reviewed and approved every change, decided whether a difference was a bug or a deliberate change, and corrected the agents when needed. In one case, an agent found a shortcut that made the outputs match without fixing the real problem, and the engineers rejected it. And an audit of the roughly 700 ported integration tests found more than 100 checks that had been weakened along the way.

The lesson: verification is the new bottleneck

The write-up’s most interesting conclusion isn’t about speed, but about what slowed the project down. Generating code was no longer the problem; proving that the code did exactly what the old one did was. Verifiers reward matching outputs, not good fixes, which is why human judgement was needed. Nor did everything work first time: some fixes passed in the sandbox and still failed in production.

How cautiously to read it

All the figures come from Anthropic itself, with no independent measurement, and the write-up doesn’t say which Claude versions were used or what the project cost. Some measurements also have a limited scope: the CPU figure was taken in one region, and the response-time figure on Claude Code requests over a shorter period. In short, it’s a case study documented by a company about its own product.

Why it matters beyond Silicon Valley

Plenty of SMEs are dragging along an old system nobody dares to touch. This case suggests that modernising it with AI’s help is increasingly feasible, but it also makes clear where the real work lies: reliable tests, comparisons against real data, and someone with sound judgement reviewing every change. Without that safety net, AI can churn out a lot of code that looks right and isn’t.

If you have a legacy system you’ve outgrown and want to know whether migrating it makes sense, let’s look at it together in a free first meeting.

Shall we apply it to your business?

Tell us about your case and we’ll tell you, with no obligation, what could be automated or built and how we’d do it.

Related articles