• Sources: primary, discussion
  • Summary: Anthropic migrated the Messages API, which serves customers and its own apps such as Claude Code, from Python to Rust, and reports about 70% less CPU per request and about 20% lower median time to first token without taking the service offline. The Rust version passed about 98% of roughly 700 integration tests in April while only about a quarter of production inputs matched, and an audit of ported tests found over 100 weakened assertions. Anthropic replayed one model output to both versions, compared each step at checkpoints, recorded only the position and size of each difference, and had a coordinating Claude agent dispatch worker agents to reproduce and fix each new fingerprint, with engineers reviewing every fix before deployment.
  • Why it matters: For a large rewrite of a live service, production shadowing with privacy-preserving diff fingerprints can serve as the verifier where a test suite cannot.
  • Background: Shadowing sends the same production request through old and new code and compares results, a standard way to validate rewrites, but common tools assume requests are safe to run twice and outputs are deterministic. LLM replies are nondeterministic and requests are billed, so Anthropic ran the model once and fed the same output to both versions. An earlier partial rewrite of only the output parser in Rust saved 8% to 10% of CPU but made each token cross the Python and Rust boundary three times.