
Anthropic has rewritten the Messages API, the front door to Claude, from Python to Rust. According to the write-up the company published on November 25, 2026, CPU use per request fell by about 70% and the median time to first token by about 20%, with the service never taken offline and feature work never frozen (Anthropic, “Migrating our Messages API to Rust”).
Coverage tends to fasten on those numbers. Most of the original, though, is not about performance. It is about reaching the point where you can trust that the rewritten code does what the old code did. Writing the code was the quick part: Claude produced a first version of the core request path in about a week. Verifying it took the time. Because it applies to anyone rebuilding a website or a system, this article follows the verification.
Much of what circulates in secondary coverage differs from the original text. We read the primary source ourselves, but we recommend that you read it too. Sources are given next to each statement. We also use Claude in our own work, and this article rests on Anthropic’s own report, not on independent verification.
The Messages API is the main way customers, and Anthropic’s own Claude Code and Cowork, reach Claude. It was built in Python in 2023, and requests grew about 1,800-fold between early 2024 and fall 2026.
| When | What happened |
|---|---|
| 2023 | Built in Python; at first, “basically a request forwarder” |
| 2024 | A suggestion to move to Go or Rust is shut down for the time being |
| April 2026 | Verification begins: the Rust version passes about 98% of tests, but only about a quarter of production inputs match |
| May 2026 | Claude is writing more than 80% of the code Anthropic merges |
| September 2026 | Public traffic moves to Rust |
| November 25, 2026 | The write-up is published |
Every row comes from the Anthropic write-up above.
The team first tried the cautious route: rewrite only the heavy part in Rust and call it from Python. They rewrote the code that parses a model’s output, and CPU use fell by only 8% to 10%. Each token of a reply now crossed between Python and Rust three times, and the boundary added new overhead. In Anthropic’s words, the gains did not justify the added complexity.
The team’s first resource was an existing set of about 700 integration tests. Two problems kept them from serving as proof that the migration was right.
The first was that the tests were bound to the Python implementation. They ran the API inside the test’s own process and replaced external services such as billing and rate limiting with fakes held in Python’s memory. Move the code and you have to rewrite the tests, and Claude helped with that too, which blurred what a “pass” meant. When the team audited the ported tests, they found more than 100 assertions that had been weakened. A pass could mean the code was right, or that the test had been loosened enough to let wrong code through.
The second was that the tests covered only a sliver of the combinations. The API has dozens of features. Just 20 on/off options make 2 to the 20th power, or 1,048,576 combinations. At one second each, that is 1,048,576 seconds divided by 86,400, about 12 days, and that is for one model, before varying the prompts. In practice engineers pick a subset meant to resemble production, and what they didn’t think of slips through.
April’s numbers show the gap. The Rust API passed about 98% of the tests, yet only about a quarter of the inputs matched on production traffic. For one example, when Python writes a JSON tool call it replaces certain characters, such as an emoji, with escape codes; Rust wrote them as they were, so the prompts differed by a few bytes. In a test suite that is one case. In production it is repeated in every request that triggers it.
So Anthropic used the live production API itself as a verifier that knows the right answer. The method is to run the same request through the old version and the new one and compare the results, usually called shadowing. The usual tools came with assumptions that did not hold here.
They assume you can safely run a request twice, which here would mean counting it twice against a customer’s limits and bill. So the team made sure each request counted once. They also assume the service is deterministic, and Claude’s replies can differ for the same input, so a difference does not necessarily mean a bug. The team ran the model once and replayed that output to the Rust version, so that everything before and after the model call could be compared under the same conditions.
Privacy was another constraint. The team had to work without reading customer requests or Claude’s replies, so it could not simply look at the text to see where the two versions differed. It recorded the shape of each difference instead, using two devices.
The first is checkpointing. Both versions handle a request in the same steps: accept or reject it, resolve its settings, build the prompt. The team compared the result of every step, and within the prompt, every piece. The first place the two disagreed pointed roughly to where the code was wrong. The second is a fingerprint. For each difference they recorded where in the prompt it began and the difference in length. One bug leaves the same fingerprint on every request it affects, so grouping by fingerprint shows how many distinct bugs there are.
A record is a small thing. Anthropic’s example, with made-up values, looks like this.
STEP: BUILD PROMPT ← where in the code
PIECE: 2 ← where in the prompt
FIRST DIFF: BYTE 17 ← fingerprint
PYTHON: 190 BYTES ← fingerprint
RUST: 190 BYTES ← fingerprint
A single bug can produce hundreds of thousands of near-identical records. So a script ran every 10 to 30 minutes, grouped the records by which fields differed, and alerted a coordinating Claude agent only when it saw a new kind. The coordinator assigned a worker agent to each new kind and opened a thread in a shared Slack channel where engineers could follow along and steer.
The fixing runs in three loops. In the inner loop, an agent works in a cloud sandbox holding both codebases and tests its ideas. The check on the input side never calls the model, so comparing the two versions takes under a second. An agent sees only the fingerprint, so it guesses the cause, writes the kind of request that should trigger it, and reads both versions’ results in full. Once it reproduces the difference, it fixes the Rust and adds a test that fails on the old code and passes on the new.
The outer loop is production. An engineer reviews the fix, it is deployed, and live traffic shows whether the fingerprint disappears. A fix that works in the sandbox can still leave the difference in production, and when it does the task goes back to the inner loop. The third is the memory loop. What reviewers correct is kept as rules, tests and checks for the agents that follow. One example is a merge check that requires anyone changing the Python code to make a matching change in Rust, or to ask for an exemption.
One episode stands out. In mid-May, one of the largest remaining differences came from the web search tool’s description. The production API fetches that text from an internal service, and Rust did not yet call the service, so the text was missing from its prompts. An agent proposed a shortcut: copy the text into files Rust could read. The prompts then matched and the sandbox check passed.
An engineer turned it down. Rust would have to call the service before launch, and the shortcut would then be thrown away. Anthropic puts it this way: the verifier tells an agent whether the outputs matched, but not whether the fix is good enough to ship, and the agent had found the cheapest way to produce a match. Where a person has to look is whether what was fixed is really shippable. Building that call took the team weeks. In the meantime, thanks to the note in memory, the records it produced were linked to the known bug instead of being worked around again.
This section is our own reading, not Anthropic’s.
Judge a rebuild against how the live system behaves today, not against a spec or a count of passing tests. Run the same input through old and new and compare. For a website, that means putting the same URLs on the old site and the new one side by side and comparing the rendering, links, metadata, redirects and form behavior. The URLs that actually get traffic miss fewer cases than a checklist a person chose.
Be suspicious of ported tests. A test that was changed along with the code has no standing as evidence, and someone has to check separately that its assertions have not weakened.
Design the comparison record so that it does not expose personal data. The place, size and starting position of a difference are enough to tell the bugs apart without reading anyone’s text.
Check first that running things twice will not cause side effects. Sending the same request through both versions can double a charge or send an email twice.
Finally, decide where a person looks. Comparison can be left to machines, but whether a fix is shippable, and whether a difference is a deliberate change or a bug, are human judgments.
This is Anthropic’s own account of its own product. I found no independent verification.
The figures are not measured under matching conditions. According to the note on Figure 15, the CPU reduction is for one region, the memory figure covers all of production, and time to first token is for customers’ Claude Code requests over a shorter period. The “more than 80% less” memory label appears in the figure, not in the body text; I checked it in an image published with PC Watch’s coverage.
How much of the CPU saving comes from the language and how much from redesign is not stated, and neither is whether Python alone could have improved.
We rebuild websites. When a site moves from WordPress or another CMS to a static site, the check works the same way: compare the old and new sites on the same URLs. If you are planning a rebuild and are unsure how to check it, please get in touch.
