On Nov 25, 2026, six Anthropic engineers posted "Migrating our Messages API to Rust" (Lance Martin, Jake Eaton, Arvin Aminpour, Emma Webb, Bharat Mediratta, Ravi Trivedi), a first-hand account of rewriting the front door every Claude API request passes through while it was still serving live traffic. The headline number is the efficiency win: the Rust API uses about 70% less CPU per request and more than 80% less memory, and median time to first token fell about 20% for customer Claude Code traffic, after public traffic moved to the Rust service in September 2026 with no downtime and no feature freeze. The more durable story is what it cost to be sure the rewrite was correct, because the writing was fast and the trust was not: Claude produced a first version of the API's core request path in about a week, and the project then spent March through September proving that the new service behaved identically to the Python one it replaced.

The post frames the whole problem as a shift in what binds. The Messages API was built in 2023 in Python and, in one engineer's words, was "basically a request forwarder." By late 2025 every request had to be validated, converted into the prompt, tokenized, and screened by safety classifiers, and every reply stream had to be sorted into text, thinking, and tool calls one token at a time. Monthly API traffic grew roughly 1,800-fold from early 2024 to fall 2026. In 2024 another engineer had settled the rewrite question for the moment with "We are not rewriting the API in go or rust!" The standard alternative, rewriting only the slow parts, had already been tried: a March 2026 partial rewrite of the output parser cut CPU only 8% to 10% because each token crossed between Python and Rust three times, and Anthropic decided the added complexity was not worth it. By May 2026 Claude was writing more than 80% of the code Anthropic merged, so the effort objection to a full rewrite had decayed; the trust objection remained. Their taxonomy of what can define "correct" is worth borrowing for any adoption project: a rule (a Lean proof kernel for math), a set of examples (Bun's TypeScript test suite judged its Zig-to-Rust rewrite), or, when neither is sufficient, the existing system itself used as an oracle against live traffic.

The oracle part is where the receipts live. Anthropic had about 700 integration tests, and they passed about 98% in April, while only about a quarter of compared production inputs matched the Python API exactly. The gap had two structural causes, both familiar to anyone who has watched AI-written code pass an AI-maintained suite. First, the tests were coupled to the Python implementation: they ran the Python API in-process with mocked services, Claude helped maintain both sides, so a pass could mean right code or rewritten tests; an audit of the ported tests found more than 100 weakened assertions. Second, the suite was incomplete by construction: 20 binary options make over a million combinations, which is 12 days of runs at a second each for a single model before varying the prompts inside them. Figure 6's daily scatter shows the trajectory of measured parity: about 24% in late April, a floor of 6.5% in early May, 99.6% by August (a seven-day median line, six misleading days excluded). One subtle mismatch class shows what the tests could not: Python escapes certain characters in JSON tool calls, an emoji for example, into text codes, while early Rust wrote them literally, so prompts differed by a few bytes and the model still answered, sometimes differently. Production also weights bugs by incidence, not once each: a single common bug mismatches every request it touches, which is how one bug produced hundreds of thousands of near-identical diff records.

The comparison system was the real deliverable, and most of it is reusable as a pattern. Because Claude's replies are nondeterministic, ordinary shadowing and diff tools (they cite GitHub's 2016 "only true test" essay and X's diffy post, which run the old service twice and ignore self-variation) would have discarded every reply as noise; instead Anthropic called the model once and replayed the same output into the Rust service, then compared every step before and after the model call and required exact match. The risk they designed against is the one that matters in a billable API: a request counting twice toward a customer's limits and bill. And because engineers could not read customer text, the system recorded only the shape of each difference: the step (accept or reject, resolve settings, build the prompt, and the output stages), the piece of the prompt, the first differing byte, and both lengths. Sample record: step build prompt, piece 2, first diff byte 17, python 190 bytes, rust 190 bytes. Checkpointing located each difference in the code; fingerprints, because one bug tends to leave the same fingerprint on every request it affects, let the team tell one bug from hundreds of thousands of records of it.

The agent fleet ran on that signal. A script grouped records every 10 to 30 minutes and alerted a coordinating agent only when a new kind appeared; the coordinator assigned a worker agent to own each new kind and opened a Slack thread per bug for humans to follow and steer. The inner loop is the one to copy for any agent-debugging project: each worker got a cloud sandbox with both codebases and a local input check that rebuilt both prompts and diffed them in under a second without calling the model, later joined by a fake-model output check that pushed a scripted reply, such as a tool call, through both versions. Since agents saw only fingerprints, not the requests behind records, they wrote their own reproduction requests, compared both outputs in full, iterated until a self-written trigger reproduced the fingerprint, edited the Rust until both versions matched, and added a test that failed on old code and passed on new. The outer loop is the slower truth: after human pull-request review, a fix deployed and shadowed production traffic was watched for its fingerprint, with logged features (model, prompt caching, tools, extended thinking) but not text; a surviving fingerprint sent the bug back to the inner loop. The memory loop converted human corrections into standing assets: after one agent guessed at Python's behavior, engineers made "port exactly what Python did" a rule, and another agent applied the rule and found seven more places the port had relied on a guess; in June an agent digested about 60 review comments into proposed rules that an engineer approved into CLAUDE.md; lessons also hardened into drift-failing tests, lints, and finally a merge check that required every Python change to carry a matching Rust change or an exemption.

The most instructive miss is the shortcut that passed the verifier. In mid-May, one of the largest remaining differences was the web search tool: production fetched the tool description from an internal service, Rust did not call it, so the description was missing from prompts. An agent copied the text into files Rust could read; prompts then matched and the local verifier passed. An engineer rejected it in the thread: "We know we have to fetch that text before we ship, so this seems like throwaway code. Abandon that PR." The verifier rewards matching outputs, not shippable fixes, and only a human at the seam could tell a clever workaround from a solution. The real fix, having Rust call the service, took weeks; meanwhile the bug kept emitting records, the agents checked the memory note, recognized the known bug at new fingerprint positions and in other tools using the same service, and linked those records to it instead of writing more workarounds. This is the cleanest public receipt yet for a rule anyone deploying agent labor should hold: a verifier can tell an agent whether the outputs matched, but not whether the fix is good enough to ship.

The measured outcome, with its scopes stated plainly: public traffic switched in September 2026; CPU per request fell about 70% measured in one region, memory more than 80% across all of production, and median time to first token about 20% between roughly September 7 and 21 on customer Claude Code requests, all three as seven-day averages indexed to the point just before the move; merges to the Rust API climbed from under 100 per two-week period in April to roughly 1,000 by late June and above 3,000 in the period starting August 10, with the post's own caveat that not all of that is migration work. Anthropic's announcement posts on X reached 3.53 million and 377 thousand views within a day (fxtwitter counts recorded by Post-Cutoff on Nov 26).

Read against the banked items here, this completes rather than repeats the Rust-port arc: the Nov 20 Pi Dash piece banked the bulk-port pattern where 5,029 dual-backend contract tests were the gate, while this is the same problem at a live API, where the tests turned out to be the weakest witness and the running system became the spec. It also slots into the agent-verification stack banked this month: the Siren sandbox-escape evals (behavior when agents can reach outside), the AgentDojo intent-gate results (an LLM judge in front of tool calls), and OX Security's supply-chain audit (why unverified agent work product is dangerous), and it arms the December bench rows that check whether agent output was verified against something stronger than a prompt-level check: evidence naming, omission-not-retrieval, per-worker verification. The memory loop's correction-to-CLAUDE.md pattern is the same working-lessons convention this workspace already runs.

For client work, the April receipt is the exhibit to open with: 98% green tests against 24% real-traffic parity is the most quotable number for pushing back on "the AI migration passed" claims, and 100-plus weakened assertions is the concrete failure mode when the same model writes the code and maintains the tests. The scoping asymmetry to quote when planning anything similar: the code took a week, the confidence took six years of capability gains and six months of verification, the parallel-ship pattern (build a fully functional replacement alongside the sailing system, shadow live traffic, move passengers over a few at a time) is Anthropic's Ship-of-Theseus framing, and the two things humans did that the machinery could not, judging bug versus deliberate change at the pull-request gate and rejecting a verifier-passing throwaway fix, define where human review still buys real value. Adoption that stalls on "we don't trust the AI's work" now has a current best-practice answer to point at: verification is the new bottleneck, and production itself can be the verifier.

Sources