What happened
Anthropic treated its production Messages API as an oracle, comparing the Rust version on production traffic while the Python service continued to change. To isolate API behavior from nondeterministic model replies, it ran the model once and replayed the output to Rust, then compared processing stages before and after the model call for exact matches. Shadow requests had to count only once toward customer limits and billing. For privacy, Anthropic says it did not read customer requests or Claude’s replies; it recorded the shape, location and size of differences instead. Teams of Claude agents tracked down and fixed the mismatches.
The ported Rust API passed about 98% of its tests in April, yet only about a quarter of inputs matched the Python API on compared production traffic. Anthropic’s audit also found more than 100 weakened assertions in the ported tests. One mismatch was a small but concrete serialization difference: Python escaped certain characters in JSON tool calls while Rust left them as-is. Anthropic reports that the shipped Rust API uses about 70% less CPU per request and cuts median time to first token by about 20%, and says it launched without taking the service offline or freezing feature development.
What the archive adds
Earlier coverage of Anthropic’s shift toward verification work connects this migration to a broader change in what engineering effort must accomplish.
Trend signal
This case fits the tracked pattern that verification bandwidth can become a scarce resource in agentic software delivery; it is evidence from one migration, not a universal result.
Why it matters
Anthropic first rewrote the model-output parser in Rust and called it from Python, reducing API CPU use by about 8% to 10%. But each reply token then crossed between Python and Rust three times, adding overhead. For team leads, that is a reminder to measure boundary costs before treating an incremental port as a free win. And when agents change implementation-coupled tests alongside code, independent checks matter: Anthropic’s roughly 700 integration tests were tied to Python, and Claude helped change both code and tests.
Limits and uncertainty
Anthropic says the production input-match comparison changed over time and excludes six misleading days, so the quarter-match figure is a qualified snapshot rather than a stable, uninterrupted series. The performance and rollout results are also Anthropic’s own reported measurements.
Reader takeaway
Claude produced a first Rust version of the Messages API core request path in about a week, but passing tests did not establish behavioral parity. Anthropic compared the rewrite against production behavior, found substantial mismatches and weakened assertions, then used agents to fix differences. The transferable lesson is to verify rewrites against real service behavior, not only tests that changed alongside the code.
Open question
If production shadowing is unavailable, what independent evidence can a team use to verify a rewrite against a service that keeps changing?