This Anthropic Rust paper is f*cking gold
Anthropic let Claude agents move their own Messages API from Python to Rust: about 70% less CPU per request. Claude wrote the first version in about a week. Proving it worked was the hard part.
The upgrade: the old API became the test for the new one.
replay → checkpoint → fingerprint → fix → rule
The 6 parts of a shadow migration:
Part 1 → the old API is the test
The Rust API passed about 98% of its tests.
On real traffic, only about a quarter of inputs matched.
Part 2 → run the model once
Claude's replies vary, so the model runs once.
The same reply is replayed into Python and Rust.
Part 3 → fingerprint every diff
Each diff is logged as step, piece, first differing byte and both lengths.
Never the text. One bug leaves one fingerprint.
Part 4 → one agent per kind of bug
A script groups the diffs every 10 to 30 minutes.
A coordinator hands each new kind to its own worker agent.
Part 5 → fast loop, then real traffic
In the sandbox, an input check takes under a second.
Fixes ship after review, and real traffic confirms the fingerprint is gone.
Part 6 → corrections become rules
An agent turned about 60 review comments into CLAUDE.md rules.
One rule found seven more places where the port had guessed.
Green tests said the rewrite was done. Real traffic said 1 in 4. The old API checking the new one closed the gap.
I packed all 6 parts into one prompt. Drop it into Claude Code and it runs your next migration the same way.
6 parts. 1 prompt. 70% less CPU.
Then read the enhanced edition of agent engineering below ↓