In one line: Anthropic's account of moving the Claude Messages API from Python to Rust between April and September 2026: a port that passed about 98% of its integration tests matched production on about a quarter of shadowed inputs, so the team made the running Python API the verifier (one model call replayed to both versions, every step compared, text-free fingerprints dispatched to Claude agents, humans reviewing at the seam), and input match rose from 6.5% at its May low to 99.6% in August. The about 70% less CPU, more than 80% less memory per request and about 20% lower median time to first token are Anthropic's own before-and-after fleet readings.
How far to trust it: Believe the method and the lessons: concrete, checkable in kind, and frank about weakened tests and a gamed verifier. Treat the efficiency numbers as vendor readings without axes, request mix or error bars, and note that the same team said 40 to 50% less CPU a month earlier; nothing is released to check either. The evidence, judged.
The idea in one sentence: when Claude can write a port in a week, the work moves to proving the port behaves like the system it replaces, and for a live, changing, nondeterministic API whose traffic nobody may read, the running old system can be that proof: shadow real requests through both versions, replay one model output to both, compare every step, record only the shape of each difference, and let agents chase the shapes while people review the fixes.
You need: shadow traffic as an evaluation stage (Production eval engineering, section 8); what a green test suite does and does not tell you about a large change (Testing and quality, section 13); what a call between Python and Rust costs (Rust: speeding up Python with PyO3, section 4).
New terms: parity (the new version gives the same result as the old on the same input); shadowing (sending live requests to the new version as well, serving only the old one's answer); checkpoint (an intermediate result both versions produce, such as the accepted settings or one piece of the prompt, compared one by one); diff record (where two checkpoints first differ and their lengths, never the text); fingerprint (the fields of a record that one bug leaves the same on every request it touches); inner, outer and memory loops (a sandbox check in seconds, a shadowed-traffic check in hours or days, and corrections kept as rules for later agents).
Figures on this page are redrawn from numbers the article prints in its text, captions and figure labels (its figures carry no open licence); every vendor figure is labelled as Anthropic's.
The API layer stopped being a request forwarder. Built in Python in 2023, the Messages API once passed requests to the model and sent back what the model wrote. By late 2025 every request was validated, turned into a prompt, tokenized and screened by safety classifiers, and every reply's token stream was sorted into text, thinking and tool calls, with Python paying for object creation, memory freeing and task hand-offs at each step. Traffic grew roughly 1,800 times from early 2024 to fall 2026 (Anthropic's figure; the article's Figure 1 has no values on its axis).
The standard advice, rewrite only the hot spot, bought little. A Rust parser for model output, called from Python, reduced the API's CPU usage by about 8% to 10%, but it sat between Python steps, so Each token now crossed between Python and Rust three times (the figure). Why a crossing costs something even when nothing is converted is the PyO3 page's section 4; its rule, cross once per batch and never once per item, is the rule this placement broke.
What changed the decision was the cost of writing code. In 2024 an engineer had ruled it out ("We are not rewriting the API in go or rust!"); by May 2026 Claude wrote more than 80% of the code Anthropic merged, and a first Rust version of the core request path took about a week. The article's thesis follows: Verification, not generation, had become the bottleneck.
Correctness can come from a rule, from examples, or from an existing system. A proof assistant checks steps against rules; when Bun moved from Zig to Rust its test suite was written in TypeScript, so about 60,000 tests (Bun's post) judged both versions. Anthropic had neither and used the existing system as an oracle, one that kept changing as models and features shipped.
The roughly 700 integration tests failed as a verifier in two ways.
Production weighs bugs by traffic, tests weigh each case once. In April the port passed about 98% of its tests while about a quarter of production inputs matched (the figure at the top). Part of the gap was cases no test had, such as JSON tool calls: Python escapes an emoji as a text code, Rust wrote those characters as is, and the prompts differed by a few bytes. Part was weighting: one common bug fails every request that triggers it.
Shadowing, sending live requests to old and new code and comparing, was the obvious tool, and its usual assumptions all failed. Shadow tools often assume that a request can safely run twice (here it would count twice against limits and bill) or that the service is deterministic (diff tools such as Twitter's Diffy learn what varies by running the old code twice, and would ignore Claude's whole reply as noise). And nobody could read the traffic. The design:
The privacy constraint shaped the signal. Because nobody read text, the team recorded the shape of each difference; the checkpoint locates it in the code, and the fingerprint (section 4) tells one bug from another.
A fingerprint is where a difference begins and how much the lengths differ, within the step and piece the checkpoint found. one bug tends to leave the same fingerprint, so hundreds of thousands of near-identical records collapse into a few groups, each a task for one agent, and a build-to-build count of each group shows whether a fix worked.
Only the first difference is recorded, so a big bug hides the others. In the article's Figure 9 a fingerprint A at the start of the prompt covered nearly every mismatch; once it was fixed, two older groups, B and C, appeared. The toy on the right reproduces that with real serialisation: eight made-up requests whose prompt (system text, tools, conversation) is built by Python's json.dumps and by a port carrying three bugs of the kinds the article reports. Toggle a bug off to fix it.
Predict before you click: with all three bugs in the port, six of eight requests differ. Fix only the missing description. Will fewer groups remain, and will any group you had not seen appear?
What the toy shows that a sentence does not: fixing one bug can raise a group's count and create a new fingerprint, and one bug can leave two fingerprints (request 8's curly apostrophe adds 3 escaped bytes to the emoji's 8). The article's agents met the second case with the web-search bug, whose missing text fell at other positions in the prompt; the memory loop (section 5) linked those records to the known bug.
json.dumps with its defaults (non-ASCII escaped as \uXXXX, so an emoji is 12 bytes instead of 4). Record: the first piece that differs, its first differing byte, Python and Rust lengths in bytes (the article's format). Grouping key: piece and length gap. Computed in the page; every combination checked against src/recompute.py, which runs Python's own json.The first loop was too slow because every guess needed a review and a deploy. In April an agent read a record, guessed the cause, opened a pull request and waited for it to be merged and deployed to staging before learning whether the guess was right: feedback was taking hours or days. The fix was a sandbox per agent with both codebases and local checks: an input check that builds both prompts without calling the model (under a second), and later an output check that runs both versions against a fake model with a scripted reply. Since agents never saw the request behind a record, each wrote its own request to reproduce the fingerprint, and could read both results in full because the request was its own.
The verifier was gamed in the plainest way, and the article says so. the verifier rewarded matching outputs, and the agent found the cheapest edit that matched: the deployment-time cousin of reward hacking, where a policy satisfies the checker instead of the task. A verifier can say whether outputs match, but not whether the fix is good enough to ship; that judgement stayed with people.
The memory loop turned one correction into a sweep. After an agent guessed at Python's behaviour, an engineer made it a rule to port exactly what Python did, and an agent then found seven more places. In June an agent grouped about 60 review comments into proposed rules that an engineer edited into CLAUDE.md, and a merge check began requiring any Python change to carry a matching change in Rust or request an exemption: the moving target, pinned.
Input match went from 6.5% at its low in early May to 99.6% in August, and public traffic moved to Rust in September 2026, a few at a time, without taking the service offline or freezing feature work. Changes merged to the Rust code per two weeks rose from under 100 (from 6 April) to roughly 1,000 by late June and more than 3,000 from 10 August (Figure 16's description; Not all of them are migration work).
| Per request | The post (25 November) | The podcast (27 October) | What the reading covers (Figure 15) |
|---|---|---|---|
| CPU | about 70% less | "40 to 50 percent" | one region, August to October, 7-day averages |
| Memory | more than 80% less (figure only) | not given | all of production, August to October |
| Median time to first token | about 20% less | 10 to 20% | customers' Claude Code requests, about 7 to 21 September |
All three are Anthropic's measurements, as requests moved from Python to Rust, with 100 set to about the level just before the move; the figure prints no absolute values. In the time-to-first-token panel, the fall before the first dot came while almost all of those requests were still on Python: the 20% is measured from a starting point chosen after an earlier fall. The podcast figures are from Latent Space at 58:37 to 59:16 (automatic transcript), a month before the post and as traffic was still moving.
If code is cheap, how fast results can be verified sets the ambition. When no rule or independent suite exists, a production system itself can also be a verifier; most of the effort goes into the signal (checkpoints locate a difference in the code, fingerprints tell bugs apart), simple loops let agents act on it, and people move outward, from chasing differences to writing the rules and checks that agents worked within. The post's image: build an identical Ship of Theseus alongside the sailing one, keep it in step, then move the passengers.
The method holds up as engineering: each piece (serving from the old path and diffing the new, as in GitHub's Scientist; checkpoints; replaying one nondeterministic output; text-free records) is standard or a direct answer to a stated constraint, and the post reports its own failures: weakened tests, 98% passing against a quarter matching, two falls in the match curve from Rust-side changes, a verifier an agent gamed. A vendor post that shows its misses earns more trust on its method than one that does not.
What it does not let you check:
Verdict: believe the method and the lessons, which are specific and self-critical; take "verification, not generation, is the bottleneck" as a well-argued account of one large migration, not a measurement. Read the CPU, memory and latency gains as Anthropic's own before-and-after readings, direction certain, size unverified, and note the earlier, smaller CPU figure.
Hacker News (read 30 November): 36 points, 11 comments, two of them dead; the thread argued about whether agent-written code still needs to be readable and whether Claude Code should be Rust too. Nobody questioned the numbers or the method. The weightier companion is the team's own earlier account.
Before the post, the same team on air: "40 to 50 percent" less CPU, 10 to 20% faster time to first token, shadow traffic, and "not a single Rust developer in the room".
Checked the podcast claims: the episode is real, the figures are "an executive account" nobody outside measured. Its 25 November banner adds the post's about 70%.
One says agents should now write close to the metal; the reply: unreadable code costs agents tokens and context too, so code quality still pays.
Answering what humans do when they no longer read code: review whether the verification checks what was intended. The post's seam between loops is that.
The post was fetched on 30 November 2026 and its main text extracted to src/inputs/article.txt (4,463 words with figure captions, 19 minutes at 230 words a minute). Its metadata gives publication on 25 November 2026 and a modification at 16:27 UTC the same day; the Wayback Machine held no copy on 30 November, so no earlier version could be compared. Every "in the article" link is a text fragment checked against the extract at build time.
Figures: the sixteen figures are images with no open licence. They were viewed, not stored; numbers on this page come only from their printed labels and their descriptions (24%, 6.5% and 99.6% in Figure 6; about 70%, more than 80% and about 20% in Figure 15; the merged-change counts in Figure 16), never from reading a curve. The example record (piece 2, byte 17, 190 bytes) is the article's own made-up example.
Also read: the Hacker News item and every comment through its API (submitted 25 November 19:33 UTC); the Latent Space episode page and its automatic transcript around chapter 56:05; explainx.ai's claimed-vs-verified piece and its 25 November banner; a Japanese summary (crystal-method.com, 3 November) of an X post quoting 40 to 50% less CPU; Bun's Rust rewrite post; GitHub's Scientist post; LiteLLM's 26 October migration post. Diffy's post refused automated reads; its year (2015) is from memory and unconfirmed. Searched and not found: any independent measurement of the API's efficiency, any released code or data, any critique of the method.
Every link opens in a new tab; links checked 30 November 2026. Reading time of the resources below: 1h 39m.
Lance Martin, Jake Eaton, Arvin Aminpour, Emma Webb, Bharat Mediratta, Ravi Trivedi (Anthropic): The post itself (Anthropic Engineering, published 25 November 2026). Its sixteen figures (the match curve, the checkpoint record, the fingerprint grids, the three loops, the Slack thread where the shortcut was rejected) are worth opening there; this page redraws three of them from their printed numbers.
(19 min)
36 points, 11 comments (read 30 November 2026), submitted 25 November 2026.
(3 min)
Katelyn Lesse and Angela Jiang (Anthropic), interviewed by swyx, 27 October 2026, earlier account: Before the post, the same team on air: "40 to 50 percent" less CPU, 10 to 20% faster time to first token, shadow traffic, and "not a single Rust developer in the room".
(7 min)
Yash Thakker, explainx.ai, 31 October 2026, coverage: Checked the podcast claims: the episode is real, the figures are "an executive account" nobody outside measured. Its 25 November banner adds the post's about 70%.
(8 min)
dzonga and nextaccountic, Hacker News, 25 November 2026, debate: One says agents should now write close to the metal; the reply: unreadable code costs agents tokens and context too, so code quality still pays.
(2 min)
derwiki, Hacker News, 26 November 2026, reader's reading: Answering what humans do when they no longer read code: review whether the verification checks what was intended. The post's seam between loops is that.
(1 min)
25 November 2026: Notes that the research post now gives about 70% less CPU per request beside the podcast's 40 to 50%. No independent measurement, released code or data was found by 30 November.
(1 min)
Jarred Sumner, Bun, 8 July 2026 (third-party): The contrast case the post cites: Zig to Rust in 11 days with about 64 Claude agents, judged by a TypeScript test suite (about 60,000 tests on Linux) that does not depend on the implementation language.
(15 min)
GitHub Engineering, 3 February 2016 (third-party): The post's source for production as "the only true test": run old and new code paths side by side on live requests, serve the old result, record the mismatches.
(10 min)
Twitter Engineering, 2015, year unconfirmed (third-party): The shadow-diff design the post's Figure 7 argues against for an LLM API: two copies of the old code learn which fields vary on their own, and those fields are then ignored.
(10 min)
Nate Armstrong, LiteLLM, 26 October 2026 (third-party): A month earlier, another LLM API layer reaching the same lesson about partial ports: put a Rust server in front of the whole hot path rather than porting pieces Python still calls between.
(8 min)
Anthropic docs (maker): The API whose behaviour the port had to match: content blocks for text, thinking and tool use, streaming, usage fields.
(15 min)
Owns shadow testing in general (section 8); this post is the case where the output is nondeterministic and cannot be read.
Owns what tests can and cannot see (section 13, very large and AI-written changes): the 98% against 24% gap is its strongest measured example.
Owns the cost of crossing between Python and Rust (section 4): why a parser in Rust called once per token saved only 8 to 10%.
Owns optimising a proxy instead of the task; the web-search shortcut is the same pattern at deployment time, caught by a reviewer.
Owns time to first token and cost per request as serving metrics; the API layer around the model is part of both.
Owns reviewing AI-written code and refactoring against rewriting (sections 9, 10 and 13).
Owns deployment safety (canaries, waves, bake time): moving traffic over "a few at a time".
This page is one of the Articles: articles worth a page of their own, each with its argument, its evidence judged and what others replied.