We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Anthropic's Rust migration: build the verifier first
Anthropic published how it moved the Messages API from Python to Rust. The post is about verification more than code generation. Claude wrote a first version of the core request path in about a week. The hard part was proving parity, because the Python API kept changing, Claude replies nondeterministically, and engineers couldn't read customer requests . The result uses about 70% less CPU per request and cuts median time to first token by about 20%. The service never went offline and feature work never froze . An earlier podcast-sourced post put the CPU drop at 40–50% . The blog's 70% figure covers one region .
Techniques you can reuse:
- Don't trust ported tests. The Rust port passed about 98% of tests in April, but only about a quarter of production inputs matched . Claude had changed tests along with the code, and an audit found more than 100 weakened assertions .
- Shadow production with one model call. They ran the model once and replayed its output to Rust. Every stage before and after the model call had to match exactly .
- Give agents a signal they can act on. Checkpoints find the first step and prompt piece that differ. Fingerprints (where the difference starts and the length gap) tell one bug from another without storing any text .
- Coordinate with a script and a coordinator agent. Every 10–30 minutes a script grouped diff records. A coordinating agent was alerted only for new kinds of record, assigned a worker to each one and opened a Slack thread so engineers could steer .
- Run three loops. In the inner loop, each agent works in a sandbox with both codebases. It writes its own request to reproduce a fingerprint, then edits the Rust until a local check (under a second) shows a match, and adds a regression test . In the outer loop, PR review happens first, then shadowed production traffic confirms the fingerprint is gone . The memory loop turns review corrections into rules for CLAUDE.md, lints, and a merge check that requires matching Rust changes .
One warning from the post: an agent "fixed" a web-search mismatch by copying text into files. The verifier passed it and an engineer rejected it. "A verifier can tell an agent whether the outputs matched, but not whether the fix is good enough to ship" .
Using /ship without surprises
Addy Osmani's guide to Claude Ship adds practical caveats the launch coverage didn't have:
-
Run
/code-reviewbefore pushing. Low effort returns only the findings it is most sure of; higher levels give a broader set. Edits from--fixmay not be undoable with/rewind, so commit first. Local review reads CLAUDE.md but not REVIEW.md . -
/shipcommits as if you rangit add -A, so rungit statusfirst. In public repos it won't commit anything for you . - The watch runs as you, on your machine and your quota. It needs its own checkout or worktree . Anyone who can land changes on the base branch can run commands on your machine during the watch, so only use it in repos where you trust them .
- It pushes at most three times per issue before escalating to you .
-
Make a review rule only after the same comment shows up on at least two PRs . Put repeated setup in
.claude/skills/verify/SKILL.md: start the stack, wait for a health check, sign in, exercise the changed flow, and report the steps and what you saw .
DHH's version of a merge gate is the prompt "Merge when green and free of greptiles" .
Cheap prototypes, human taste
Karpathy asked Claude to build a Civilization-style US map. Using Claude Code desktop with Opus 5.5 on medium and ultracode turned on, it pulled 31 public data sources onto one 25 km hex grid. The run took 7 hours and 45K lines of code, and Claude skipped a few states . It is live at karpathy.ai/usaciv .
ThePrimeagen used to reason about what would feel good and then build one prototype. Now he builds five and tries them all . On Latent Space, Thariq Shihipar, who is leaving Anthropic for OpenAI , described a /human folder in his game. Its lint rules require dense comments, no single-character variable names and limited line length, so the files read like specs but are the real code he tweaks by hand . He also connects several assistants to one shared Markdown scratchpad, which took about 30 seconds to set up .
Models: how practitioners split work
Matthew Berman still uses Opus 5.5 for most of his work . He uses Gemini Neon for easy to medium-hard tasks and Opus for anything harder . Fable 5.2 is costly, so he saves it for his hardest work and for checking other models . He ranks GPT-6.2 Sol as the best model for computer use but doesn't use it for coding .
OpenAI fixed a launch billing error that had undercounted GPT-6.2 usage. Compared with last week, you'll hit plan limits 40% faster on Astra and 25% faster on Sol. Past usage won't be charged . Go, Plus, Pro and Business users get one banked reset .
Tools
-
T3 Code 0.1.12: one project can now span several repos (a folder of repos, a
.code-workspacefile or submodules). One worktree branches all of them, and one turn can change them all . A tracking claim against T3 Code was withdrawn: the author's--deeptrace had counted Claude Code's Datadog/Grafana traffic as T3 Code's . A separate review of 25 open-source coding GUIs and agent harnesses found only 1 that cleanly honorsDO_NOT_TRACK, and gave 6 an F . - Rex + OSC 7577: a new escape sequence lets terminal programs resume after a server restart. Claude Code support comes via a session-start hook, and Lua config lets you opt in per program .
- Gemini API CLI: open source and needs only an API key, so any coding agent can call Neon: google-gemini/gemini-api-cli .
- Antigravity plugin marketplace: installs any plugin that follows the Agent Plugins Specification .
-
Google Workspace: Peter Steinberger reads a new Google change, which adds MCP servers and usage tiers, as forbidding CLIs like
gogunless you pay more . - Deep Agents subagents: use them to keep the main agent's context clean and to run tasks in parallel. Give each one only the tools it needs. Skip them for single-step tasks .
Direct answer: The team used the changing Python production API as the behavioral oracle for Rust, compared both versions on shadowed traffic using the same model output, and routed privacy-preserving mismatch records through agent repair and production-verification loops.
- Oracle and comparison: Because models and features kept changing, the existing API provided a moving parity target rather than a fixed specification. They ran the model once, replayed its output to Rust to avoid nondeterministic reply differences, and compared every stage before and after the model call exactly; they also ensured a shadow request counted only once toward customer limits and billing.
- Privacy-preserving diffs: They did not read customer requests or replies. Checkpoints recorded the first differing service step and prompt piece; fingerprints captured the difference’s position and length so recurring mismatches could be grouped without storing the text.
- Agent team setup: A script ran every 10–30 minutes, grouped diff records by differing fields, and alerted a coordinating Claude agent only for a new kind of record. The coordinator assigned a worker to each kind and opened a shared Slack thread for engineers to follow and steer the work.
- Inner loop: In a cloud sandbox with both codebases, an agent used the fingerprint to hypothesize a cause and write its own reproducing request or model reply. Fast input checks compared prompts without calling a model (under a second); output checks used a fake model. The agent iterated until the versions matched, then added a regression test and opened a PR.
- Human review and outer loop: Engineers reviewed fixes before they entered production verification. The outer loop compared shadowed production traffic on builds with and without a fix, using request metadata (not text) to compare like kinds and track the fingerprint; if it persisted, work returned to the inner loop. A sandbox pass was not sufficient because its requests and configuration could differ from production.
- Memory loop: Review corrections and agent lessons became reusable rules, tests, and lints; a later merge check required Python changes to be matched in Rust or receive an exemption.
- Results and caveats: In April, Rust passed about 98% of tests while only about a quarter of production inputs matched; the reported input-match series later ended at 99.6%, but the comparison changed over time and six misleading days were excluded. They report about 70% less CPU per request and about 20% lower median time to first token; the CPU figure was for one region, while the latency measure covered Claude Code customer requests over a shorter period, and its decline before the first plotted point occurred while almost all those requests were still on Python. The migration was shipped without taking the service offline or freezing feature development.
- Lessons: Tests alone were not a dependable parity oracle: they were coupled to the Python implementation, and auditing ported tests found more than 100 weakened assertions; the test set also missed production cases. Matching outputs did not establish that a fix was suitable to ship—the verifier could reward a shortcut—so human review remained a gate.
-
For agent-built game code, create a
/humanfolder with stricter lint rules—dense comments, no single-character variable names, and limited line lengths—so its files act as readable specs while remaining the actual code. Let the model build underlying primitives, then play and adjust them yourself; the speaker links insufficient human testing to “slop.” - Treat rapid prototypes as a way to discover what you want, not just to produce a finished app: trying a build can reveal what feels wrong and what to change. For game ideas, the speaker’s Claude-folder instructions ask it to research how other games handle an idea, ground suggestions in game-design principles, and help mock up or design it.
- For multiple assistants, connect them to a shared plain-text or Markdown scratchpad; have one start it and ask the assistants to introduce themselves so they share context. The speaker said this took about 30 seconds.
- When introducing an unfamiliar decision-model tool to an agent, explicitly ask it to research the concept and write project docs, and provide the relevant API key; the speaker cautions that an agent may otherwise not know to use the class. For a support bot, he suggests using a decision model for the main behavior and switching to inference when needed.
-
Claude Ship splits post-PR work across Code Review, which performs multi-lens review and adversarially verifies findings; PR Steward, which handles failing checks, conflicts and review feedback but does not approve or merge; and Claude Approvals, which applies a repository policy to approve routine changes or require human sign-off. Code Review is generally available, the other agents are in beta, and
/shipis available in the latest Claude Code without admin enablement. -
Run
/code-reviewbefore pushing: it checks branch commits and uncommitted changes for correctness bugs; lower effort prioritizes higher-confidence findings, while higher effort returns a broader, less-certain set. Try it repeatedly to learn what it catches and misses. With/ship, pending changes may be committed as though you rangit add -A, then the command can push/create the PR, review and fix findings it judges valid, and watch the PR for up to seven days; checkgit statusfirst, and commit pending changes yourself in public repositories. The local watch uses your machine and quota, stops if your laptop closes, and should only run in repositories where you trust people who can land changes on the base branch, since commands run under your credentials. -
Turn recurring friction into repo guidance: consider making a review rule only after a pattern appears on at least two PRs, have a person approve the rule change, and remove outdated rules. Use
CLAUDE.mdfor local review guidance and rootREVIEW.mdfor Code Review rules. For repeated app setup, create.claude/skills/verify/SKILL.mdwith customized, explicit steps (start the stack, check health, sign in, exercise the changed flow, and report observed results); run it repeatedly and fix flaky steps so the verification remains trustworthy.
- For his coding work, Opus 5.5 is the go-to for most tasks, valued for its quality, cost, and usability; he also says its subscription quota is generous and efficient.
- His task split is Neon for easy through medium-hard work and Opus for harder tasks: Neon is less capable, but inexpensive and especially easy and enjoyable to use.
- He reserves Fable 5.2 for the most challenging or important problems and for checking other models; he rates it highest in quality but says it is costly and consumes substantially more subscription quota than Opus.
- DeepSeek V4.1 Flash is another coding/building option he rates highly, citing its low cost and open-source/open-weights status, though he uses it infrequently because he already has ample usage from other subscriptions.
Karpathy used Claude Code desktop with Opus 5.5 on medium plus ultracode to build a Civilization-style U.S. map: after his request, Claude downloaded and parsed 31 public data sources, including Census, BEA, BLS and NOAA, producing 45K lines of code in 7 hours and reconciling real-world measures onto a 25-km hex grid. A reusable pattern is to unify varied data on a shared grid and translate it into an intuitive domain model—for example, GDP as Civilization Gold. The prototype includes 19 data lenses and an Explorer with tables and scatter plots for 3,100+ counties, but Claude skipped some states and territories. The project is deployed at karpathy.ai/usaciv.
-
Simon Willison built the
datasette-chartsplugin with substantial help from Fable 5.2; it aims to automatically select credible visualizations for varied data. -
datasette-chartsintegrates with Datasette Agent, which can add chart annotations such as custom lines, shaded areas, and labels. Try it in the Datasette Agent demo (GitHub sign-in required) or Datasette Lite, which runs Datasette in the browser.
For model and coding-agent evaluation, weigh human attention rather than cost per task alone; two-metric Pareto charts can hide severe reliability issues. Public AI benchmarks can also fail correct work and measure what is easy rather than what matters.
Simon Willison reports that, in roughly two weeks after Claude Fable 5.2’s release, he made 194 commits to his open-source projects co-authored by the model; the post gives an output metric but no details about his workflow.
- The video reports that a 41-day Claude-assisted effort produced 17 million lines of Lean and was compiled, but reviewers found a helper used 118 times that always returned true; others later said almost nothing depended on it and it was probably leftover code. The author reportedly called the Lean code garbage, and no human-readable proof was available, illustrating the gap between compilable agent output and an artifact people can readily audit.
- Sponsor CodeRabbit pitched Explain for reviewing large agent-generated PRs: it summarizes intent and risk, presents changes in ordered layers, maps affected files and services, flags what it cannot infer, and syncs comments and approvals with GitHub.
In response to a question about whether Google's Workspace API change affects gog and OpenClaw, Peter Steinberger characterized Google's introduction of an MCP as forbidding CLIs such as gog unless users pay more; this is his interpretation of the change, not a detailed account of the policy.
Anthropic rewrote its Messages API in Rust without Rust developers: Claude wrote the code, while humans wrote the plan and checked old versus new against real traffic; CPU dropped 40–50%. The migration workflow used the Python API as an oracle, verification loops, and a team of agents fixing diffs until Rust matched production’s observable behavior.
Google's open-source Gemini API CLI is designed to let developers connect their coding agent of choice to Gemini Neon and Gemini API models; getting started requires only an API key.
ThePrimeagen worked from his phone on adding web testing to his Odin application; what started as a simple task was “closer to two,” and he began developing with a couple of different ideas.
ThePrimeagen says Google went from “the actual worst model to the best,” expressing a strong positive impression of its model quality; the post does not identify which model or a coding-agent use case.
LangChain’s meetup with @typesafeai included a session on building agent harnesses with Jev . Other sessions discussed Jev as a “system one” model rather than a decision model and its use as an agent-evaluation judge compared with frontier LLMs on accuracy, consistency, latency, and cost .
-
Use a file-first workflow for long-running agents: list files, search with
glob/grep, then read only relevant content; write notes and results to files, and read long files in sections. Deep Agents includels, read/write/edit,glob, andgrep, and can connect to a real folder or database. Large context windows make important details easier to miss and increase latency and cost; Deep Agents summarize older messages at about 85% capacity, save originals to files, and can offload large tool results. - Separate thread scratch space from durable memory: files in thread state belong to that conversation, and a new thread starts fresh; a checkpointer lets the same thread ID resume. Route selected folders to a store for cross-thread memory, optionally with a composite backend, and save only information likely to be useful later while telling the agent when to use its memory folder.
-
Put risky tools behind human approval and run agent-written code in a sandbox:
interrupt onpauses before a selected tool runs so a person can approve, edit, or reject its arguments; a checkpoint lets the agent wait, but approvals should be limited to consequential tools. - Evaluate changes consistently and debug from traces: run the same dataset and evaluators against each candidate, compare experiments, and start with about 10 carefully chosen examples. LangSmith traces show model/tool inputs and outputs, timing, and errors; tracing can be enabled for LangChain/LangGraph agents with environment variables, and traces can be added to a dataset for future tests.
- Use code-based evaluators for deterministic trace checks—such as verifying an agent actually searched the web—because they are fast, cheap, and reliable; use an LLM judge for semantic questions such as whether the answer addressed the user’s request, while accounting for added cost, latency, and the need to compare judgments with human feedback.
- A repeatable LangSmith evaluation pattern: freeze five traces from a toy Deep Agents weather agent, score them through the LangSmith SDK 100 times using binary pass/fail and continuous 0–1 rubrics, then query the stored runs; LangSmith records latency and cost automatically. In that small experiment, Jev was the most consistent evaluator and the quickest and cheapest. The presenters cautioned that the test was small and did not assess alignability; Jev’s probability scores might help, while its lack of explanatory text or reasoning might make alignment harder.
ThePrimeagen’s prototyping workflow shifted from carefully predicting what would feel good and building one prototype to building five alternatives and trying them all .
Jess Weng made a videogame to teach LangChain’s open-source Deep Agents agent harness; she says it includes additional educational content hidden in the game and invites developers to try it at https://github.com/JessWeng18/out-of-context .
A telemetry accusation against T3 Code was withdrawn after its author found that --deep rolled child-process activity into the parent scorecard, attributing Claude Code’s boot-time Datadog/Grafana probes to T3 Code; check child-process attribution when interpreting parent-level agent telemetry.
Many problems have a generator–verifier gap: it’s often far easier to verify that a solution is correct than to come up with one. Sudoku is a classic example. It’s simple to check the solution (just count the numbers in each row, column, and box), but finding that solution can take a long time. Many ambitious Claude projects have relied on this gap: formalizing proofs (opens in new tab) in mathematics or migrating (opens in new tab) large, well-tested codebases are tasks Claude can take on as long as it has a reliable way to verify its work.
But as Claude has become more capable, it’s begun to take on projects in live systems, where generating the work is easier than verifying it. In these systems, users often rely on edge cases and quirks that fall outside the test suite (opens in new tab), and it’s hard to write a definition of “correct” that covers everything (opens in new tab). Without a reliable way to check Claude’s work, the migration of a live system is hard to trust—however quickly Claude can generate the code for it.
We ran into this problem when we migrated our Messages API (opens in new tab) from Python to Rust. This API is the primary way that customers—as well as our own apps, like Claude Code and Cowork—reach Claude. From early 2024 to fall 2026, API traffic grew roughly 1,800 times. Rust would allow us to use far less CPU per request. Claude wrote a first version of the API’s core request path in about a week. But building trust in the migration required us to find a way to verify that our Rust API was at parity with our production API. This proved hard for several reasons, including that the Python API continued changing throughout the migration, so parity was a moving target; Claude can reply nondeterministically to the same request, so a difference between two outputs didn’t necessarily mean a bug; and we couldn’t read customer requests, so we weren’t able to easily see where the two versions diverged.
In this post, we share how we turned the production Messages API itself into a verifier—and how that helped us test the new Rust version on production traffic, find where it differed, and automatically dispatch agents to fix those differences. This allowed us to ship an API on Rust that uses about 70% less CPU per request and cuts median time to first token by about 20% without ever taking the service offline or freezing feature development.
Why migrate?
We built the Messages API in 2023 and wrote it in Python, which was widely used internally for much of our research code. At first, it was simple. The Messages API passed requests to the model and sent back what the model wrote. (One engineer at the time called it “basically a request forwarder.”) But as the Messages API became more capable and deeply integrated with our codebases, it also developed shared dependencies with Python libraries that were owned by our research and inference teams, which made it hard to move. If we ever wanted to move to another language, it would mean building logging, metrics, and tools all over again.
This calculus gradually began to change. By late 2025, every Messages API request had to be validated, converted into the prompt, tokenized, and screened by our safety classifiers. As each reply arrived, the stream of tokens had to be sorted into text, thinking, and tool calls, and Python added overhead to every one of those steps each time it created an object, freed memory, or handed its work to the next task. Traffic eventually grew far beyond what the initial Python service was built for (Figure 1), and we quickly needed to find a way to make the service much more efficient.

The monthly average of API requests per day on our own platform, including our own use.
Incremental or all at once?
Full rewrites of large production systems are often approached cautiously, for at least two reasons. First, there is no guarantee that test suites cover 100% of production code behavior, and rewriting it is risky. Second, the sheer effort required often makes such work intractable. (In 2024, after one of our engineers suggested migrating to Go or Rust, another temporarily settled the question: “ We are not rewriting the API in go or rust!”)
The standard advice if you’re looking for performance gains is thus to rewrite only the parts that are slowing the system down, so that’s where we started. In Rust, we rewrote the code that parses a model’s output and called it from Python. This reduced the API’s CPU usage by about 8% to 10%. However, incremental solutions often incur added complexity, and it’s important to make sure that incremental improvements justify those costs. In our case, the gains didn’t justify the added complexity. Each token now crossed between Python and Rust three times (Figure 2), creating new sources of overhead.

After the incremental rewrite, each token of a reply crossed between Python and Rust three times.
As Claude became increasingly capable, we began to question whether the usual reasons to avoid a full migration still held. The effort required to undertake the project was dropping fast: by May 2026, Claude was writing more than 80% of the code Anthropic merged (opens in new tab). We wondered if Claude could now help us write code that would empirically capture every behavior and fix in the production system. But the question became: how could we verify that the behavior of our migration was correct? Verification, not generation, had become the bottleneck.
How we verified the migration
General approaches
To verify the migration, we first needed to define what “correct” meant. You can do this in a few ways (Figure 3). If you’re lucky, you can simply write a rule. A theorem in mathematics (opens in new tab) is a precise statement, and a proof assistant (like Lean) can check each step of a proof against a fixed set of rules. Other times—and more frequently in software engineering—you define “correct” with a set of examples, like tests. For instance, when Bun moved (opens in new tab) from Zig to Rust, its test suite was written in TypeScript, so the same tests could judge both versions. In our case, neither approach was sufficient, so we used the existing system as an oracle to test parity during the migration. In this case, our existing system (the Messages API) kept changing. We were releasing new models and shipping new features regularly, which made the definition of “correct” a moving target.

Three common sources of “correctness.”
Tests
Tests were the easiest place for us to start, since we already had an existing set of about 700 integration tests. However, two problems limited our ability to trust them to verify the correctness of a migration as high stakes as this (Figure 4).
The tests were coupled to the Python implementation. An integration test sends a request, then checks the reply and what was sent to other services. Our tests ran the Python API inside the test’s process and mocked services, like billing and rate limiting, in Python’s memory. The tests had to change along with the code, and Claude helped with both. Now, a “pass” could mean that the code was right, or that the test had been changed in a way that let wrong code through. We saw this happen: when we audited the ported tests, we found more than 100 weakened assertions.
The tests were incomplete. The Messages API has dozens of features, and there are far too many configurations to test them exhaustively. Just 20 binary options make over a million combinations—that translates to 12 days of tests at a second each, for one model, before we even vary the prompts inside them. In practice, engineers test a subset that tries to approximate production, but that process inevitably misses cases. Some projects, like Bun, have an independent suite that’s extensive enough to judge a rewrite. Many production services don’t; what counts as correct depends as much on how they behave as on what’s in their tests or documentation.

A ported test may check less than the original (dashed), and tests cover only the combinations someone thought of.
Detecting parity with production
Production data is sometimes “ the only true test (opens in new tab) ” that new code behaves like the old code. Running requests through old and new code and comparing the results is often called shadowing. To understand what we needed to compare, it helps to walk through what happens to a single request on the Messages API (Figure 5). The API validates each request, converts it into a prompt a model can read (the prompt for inference), tokenizes it, and runs it through safety classifiers. A model then writes a reply, one token at a time. On the output side, the API sorts those tokens into text, thinking, and tool calls, streams them to the customer, and counts usage for limits and billing.

The Messages API’s input and output paths. Filled dots are examples of differences we found between Python and Rust. The hollow dot is a risk we had to prevent.
The migration covered both the input and output paths. Some differences were obvious, such as when the Rust API rejected a request that Python had accepted. But many were subtle. For instance, if the Rust API left out part of a prompt, the request would still succeed and the model would still answer, though sometimes with minor differences.
Our Rust API passed about 98% of its tests in April, yet only about a quarter of inputs matched on production traffic (Figure 6). The gap came partly from cases in production traffic that our tests didn’t cover. For example, when Python writes JSON tool calls, it escapes certain characters (e.g., an emoji) by replacing them with text codes. Rust wrote those characters as is, so the two prompts differed by a few bytes. Production also weighted bugs differently. In a test suite, each case counts once, but in live traffic, a bug will show up in each request where it’s triggered, which means a single common bug can cause many mismatches.

How often Rust’s input matched Python’s on the requests we compared. Replies were compared separately. Each dot is a day, and the line is a seven-day median. What we compared changed over time, and six misleading days are left out.
Common (opens in new tab) tools (opens in new tab) for shadowing often assume that a request can safely run twice, or that a service is deterministic. These assumptions didn’t apply in our case. We had to ensure that a request only counted once toward a customer’s limits and bill. In addition, Claude is nondeterministic, meaning that replies can differ for the same input (opens in new tab) (Figure 7). To address this, we ran the model once and replayed the model output to Rust.
With both versions working from the same model output, we still had to compare every stage before and after the model call, and the results had to match exactly. In many systems, bad input causes an error somewhere down the stack. But since Claude accepts almost any prompt, even a small deviation can change its reply without triggering an error. We compared each step before and after the model call, so that we could pin down any deviation that might change what a customer received.

Diff tools often run the old code twice to learn what varies on its own, then ignore it. Claude’s replies vary, so those tools would ignore them, along with any bugs in them.
It was important to us to do this in a way that protected user privacy. To do that we had to work without reading user requests or Claude’s replies to them, which means we couldn’t easily see where the Rust and Python versions of the API differed. So instead of looking at text, we recorded the shape of each difference, such as where it happened in the service and how big it was. We did this using a few different approaches:
- Checkpointing. Both API versions handle a request using the same steps: accept or reject it, resolve its settings, build the prompt. Every step produces some result, such as an error or the pieces of the prompt, that we could compare step by step, and within the prompt, piece by piece. The first place they differed indicated roughly where the migration code differed from production code (Figure 8).

Comparing at checkpoints, simplified, with made-up values. The first step to differ shows where to look. The record gives the piece, the lengths, and where they first differ, but not the text.
- Fingerprint. Once we knew roughly where each diff resided, we still needed a way to distinguish one bug from another. We recorded where each difference began in the prompt, as well as the length difference between the two versions. Combined with the step and piece of the prompt isolated in checkpointing, we found that bugs presented with a specific fingerprint. That is, one bug tends to leave the same fingerprint on every request it affects (Figure 9). We could then group errors by fingerprint, which helped us triage the fixes.

Fingerprints from one kind of request. A, at the start of the prompt, hid older differences. Once it was fixed, they appeared as B and C. Dots are illustrative.
The result was a shadowing system that produced a small record of each difference between our Rust and Python APIs. Here is an example, with made-up values:
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 ← fingerprintWe could then pass this record to an agent to fix it.
Verification loops
Each request that differed left a record in our logs. A single bug could produce hundreds of thousands of nearly identical diff records. Rather than send each to an agent, we ran a script every 10 to 30 minutes that grouped them by which fields differed, then alerted a coordinating Claude agent only when it saw a new kind of record. This coordinator assigned a worker agent to own each new kind of record. It also created a new thread in a shared Slack channel where human engineers could follow along and steer it when necessary.
To tackle the many bugs, we set up a series of verification loops. A fast inner loop gave agents a sandbox in which they could test ideas and propose fixes. A slower outer loop then validated fixes in production. In addition, a memory loop recorded any mistakes along the way, saving them so that agents could learn over time (Figure 10).

Verification loops. An edit is checked in a sandbox, and then on shadowed live traffic. People’s corrections become rules. Each loop can catch what the one inside it misses.
Inner loop
When we first started testing this in April, we gave each agent a record that showed where the Rust and Python versions differed. Agents would guess the root cause from the code and open a pull request. Once the fix was reviewed and merged, they deployed it to staging, a preproduction copy of the Rust API where we ran the same shadow comparison on test traffic. The agents checked whether the difference was eliminated. Since every hypothesis needed a review and a deployment, feedback was taking hours or days.
We needed agents to get a signal from verification much sooner, so we moved them into their own workspace. We redesigned the inner loop so that agents could have a place to test ideas quickly and fail safely. Each agent ran in a cloud sandbox with both codebases and fast, local checks for what happens before and after the model call. The input check took a request, built the prompt that each version would send to the model, and showed what differed. Because this check never actually called the model, comparing the versions took under a second. We later added an output check, which ran both versions against a fake model. The output check passed a scripted reply, such as a tool call, through each version and compared the results.
The main limitation was that agents could only see the fingerprint, not the request behind each record. So an agent would hypothesize what had caused the difference, then write its own request or model reply to try to reproduce the difference. Since each agent was writing these itself, it could read both results in full. If the results matched, its guess was wrong and the agent tried again. If they differed the same way the record described, the agent edited the Rust until the two versions matched, then added a test that failed on the old code and passed on the new (Figure 11).

Inner loop. From a fingerprint, an agent guesses the cause and writes a request or reply that should trigger it. Local checks run it through both versions until an edit makes them match.
The seam between the inner and outer loops was a good checkpoint for human review. Inside the sandbox, a wrong guess cost an agent only a few seconds and had no impact on users. Agents could iterate on their own. We allowed a fix to cross into the outer loop only after it had undergone PR review; this allowed engineers to focus their attention on proposed fixes (rather than on guesses) and on the questions the verifiers couldn’t answer, such as whether a difference between the Rust and Python APIs was the result of a bug or a deliberate change.
Agents posted their fixes and evidence to their Slack threads for engineers to review. In mid-May, one of the largest remaining differences between the Rust and Python APIs came from web search. The production API retrieved the web search tool’s description from an internal service. The Rust API didn’t call this service yet, so the tool description was missing from the prompts. An agent proposed a shortcut to copy the text into files that would be readable by Rust. The prompts then matched, and the fix passed the local verifier. But an engineer turned it down because it didn’t solve the problem: Rust would still need to call the service before launch, at which point the workaround would be thrown out (Figure 12).
But the verifier rewarded matching outputs, and the agent found the cheapest way to produce them. A verifier can tell an agent whether the outputs matched, but not whether the fix is good enough to ship. That’s why human review was an important gate.

Agents trace a mismatch to the web search tool across four Slack threads and propose a fix, which an engineer rejects as throwaway code. We shortened and reworded the messages and added the thread names and agent labels.
Outer loop
In the inner loop, agents debugged differences and proposed fixes. At the seam between the inner loop and the outer loop, engineers reviewed the proposed fixes, gave feedback, and approved them to deploy. The outer loop then compared Rust API deployments with and without each fix.
To make that comparison fair, we logged facts about each request we compared, but not its text, including which model and API features it used—for example, prompt caching, tools, or extended thinking. These details let agents compare requests of the same kind (Figure 13) and ask how often the bug’s fingerprint appeared on builds with and without the fix. This way, agents could monitor the new builds for the bug.

Outer loop. An engineer reviews the fix, it deploys, and shadowed traffic shows whether its fingerprint is gone. If not, the task returns to the inner loop.
We designed the outer loop to catch problems that the inner loop missed. The inner loop simulated production quickly but imperfectly: agents could test a hypothesis in seconds, but only on requests they had written, and with a local verifier that wasn’t always configured exactly like production.
This means that sometimes a fix passed in the sandbox and production still showed the difference. The agent assigned to the bug would either see the difference in the new build’s records, or be alerted by the coordinating agent. It then went back to the inner loop and used that evidence to form a new hypothesis.
Memory loop
The inner and outer loops fixed one difference at a time. The memory (opens in new tab) loop improved how agents made those fixes. We didn’t want engineers to have to make the same correction twice, so we recorded what came out of reviews and agents’ own work and applied it to every agent that followed.
For example, when an engineer turned down the web search shortcut (Figure 12), the agent saved a note to memory explaining the decision, the reason for it, and the correct fix, which was to have Rust call the service that supplies tool descriptions.
Building that call took our team weeks, and in the meantime the bug kept producing records. Some had new fingerprints, because the missing text fell at other positions in the prompt or belonged to another tool that used the same service. Agents checked the memory note, recognized the known bug, and linked those records to it, instead of writing another workaround (Figure 14).
Other lessons became general rules for porting and writing Rust. After one agent guessed at Python’s behavior, an engineer made it a rule to port exactly what Python did. An agent then compared the existing code with that rule and found seven more places where the port had relied on a guess.
In June, an agent also went through about 60 of the team’s review comments, grouped the recurring problems and proposed rules, which an engineer edited and approved for CLAUDE.md (opens in new tab) (Figure 14).
The memory loop also encoded some lessons in permanent checks. This included new tests that failed when Rust drifted from Python, lints that banned patterns reviewers kept flagging, and later a merge check that required anyone changing the Python code to make a matching change in Rust or request an exemption.

Memory loop. An engineer’s correction becomes three things: a rule that each new agent reads, a search for the same mistake, and a test.
Looking ahead
It’s increasingly feasible to migrate production systems with Claude, either for better performance or security, without taking an API offline or slowing feature development. Now that the hard part is no longer writing new code, we need to build sufficient confidence that the new system behaves like the old one.
The usual approach to migration is a bit like rebuilding the Ship of Theseus, in which the old ship was replaced plank by plank. Generally it’s been possible to replace planks while the ship still sails, but changing too many planks at once requires coming into dock. To fully stretch the metaphor, Claude now makes it possible to build an identically functioning ship alongside the first—even as the first keeps sailing and having its planks replaced. Agents kept the new ship in step as the old one changed, and we kept checking that the two behaved the same. Once we trusted that they did, we moved the passengers over a few at a time. The new ship sails faster and more efficiently than the old one.
Lessons learned
Verification is the new bottleneck. Previously, large software projects like migrations were hard to justify because they took too much effort and carried too much risk. But if writing code is no longer the bottleneck, the main constraint becomes how quickly you can verify results. In general, ambition can be increased as long as there’s a way for Claude to verify correctness.
Verification is how you earn confidence. In math, we use a proof assistant to verify that each step of a proof Claude wrote is valid. For software, tests or formal verification (opens in new tab) can help us gain similar confidence. But when these checks aren’t enough, a production system itself can also be a verifier.
Carefully design the verification signal. A verifier provides a signal that Claude can act on. We can calibrate this signal to show Claude where things went wrong. Where a proof assistant points to the failing step or a test names the failing case, a production system often offers no such signal by default. Much of our effort for this project went to building such a signal. In this case, checkpoints located each difference in the code and fingerprints helped tell one bug from another.
Build loops that let Claude autonomously act on the signal. Our inner loop was fast and ran locally in a sandbox. Agents tested hypotheses in seconds using requests they wrote themselves. The outer loop was slower and checked fixes on shadowed production traffic. The outermost loop was just prose, with corrections saved as rules in memory that could be read by every agent later in the process. Together, these loops allowed us to migrate the Messages API to Rust, which uses about 70% less CPU per request and reduces median time to first token by about 20% (Figure 15).

CPU and memory used per request, and median time to first token, as requests moved from Python (gray) to Rust (blue). Lines are seven-day averages, 100 is about the level just before the move, and each arrow shows the change from the first dot to the second. CPU is one region, memory is all of production, and time to first token is customers’ Claude Code requests over a shorter period. In the third panel, the fall before the first dot came while almost all of those requests were still on Python.
Keep the loops simple, so they scale with Claude’s capability. We tried to put human judgment only into what counted as correct; otherwise we left it up to Claude how to get there. Agents chose which hypotheses to test, how to reproduce each bug, and how to fix it. The verifiers judged the result. Simple loops around strong verifiers allowed us to move productively over time (Figure 16).

Changes merged to our API’s Rust code in each two-week period, from April until public traffic moved to Rust in September 2026. Not all of them are migration work.
Move toward outer loops. At first, we had our engineers working inside the inner loop, running Claude and chasing differences themselves. Later, they moved to the seam between loops, helping to steer agents and reviewing fixes in Slack. But as the system matured, they increasingly moved to the edge, where they could provide the highest leverage, writing the rules and checks that agents worked within. As Claude grew more intelligent (and as we grew more intelligent at working with it), we evolved from directing Claude to Claude directing itself, relying on humans mainly for important judgment calls.
Direct answer: The team used the changing Python production API as the behavioral oracle for Rust, compared both versions on shadowed traffic using the same model output, and routed privacy-preserving mismatch records through agent repair and production-verification loops.
- Oracle and comparison: Because models and features kept changing, the existing API provided a moving parity target rather than a fixed specification. They ran the model once, replayed its output to Rust to avoid nondeterministic reply differences, and compared every stage before and after the model call exactly; they also ensured a shadow request counted only once toward customer limits and billing.
- Privacy-preserving diffs: They did not read customer requests or replies. Checkpoints recorded the first differing service step and prompt piece; fingerprints captured the difference’s position and length so recurring mismatches could be grouped without storing the text.
- Agent team setup: A script ran every 10–30 minutes, grouped diff records by differing fields, and alerted a coordinating Claude agent only for a new kind of record. The coordinator assigned a worker to each kind and opened a shared Slack thread for engineers to follow and steer the work.
- Inner loop: In a cloud sandbox with both codebases, an agent used the fingerprint to hypothesize a cause and write its own reproducing request or model reply. Fast input checks compared prompts without calling a model (under a second); output checks used a fake model. The agent iterated until the versions matched, then added a regression test and opened a PR.
- Human review and outer loop: Engineers reviewed fixes before they entered production verification. The outer loop compared shadowed production traffic on builds with and without a fix, using request metadata (not text) to compare like kinds and track the fingerprint; if it persisted, work returned to the inner loop. A sandbox pass was not sufficient because its requests and configuration could differ from production.
- Memory loop: Review corrections and agent lessons became reusable rules, tests, and lints; a later merge check required Python changes to be matched in Rust or receive an exemption.
- Results and caveats: In April, Rust passed about 98% of tests while only about a quarter of production inputs matched; the reported input-match series later ended at 99.6%, but the comparison changed over time and six misleading days were excluded. They report about 70% less CPU per request and about 20% lower median time to first token; the CPU figure was for one region, while the latency measure covered Claude Code customer requests over a shorter period, and its decline before the first plotted point occurred while almost all those requests were still on Python. The migration was shipped without taking the service offline or freezing feature development.
- Lessons: Tests alone were not a dependable parity oracle: they were coupled to the Python implementation, and auditing ported tests found more than 100 weakened assertions; the test set also missed production cases. Matching outputs did not establish that a fix was suitable to ship—the verifier could reward a shortcut—so human review remained a gate.