Code migrations — porting a whole codebase to a new language — used to be multi-year efforts. Expensive, risky, and often only 90% done at the end. Anthropic just published a detailed post on what this looks like now. And the numbers make a statement.
Two examples that stick
Jarred Sumner, Bun co-founder and now at Anthropic, ported Bun from Zig to Rust using Claude Code. A million lines of code in under two weeks, 100% of the existing test suite green in CI before merge. Nineteen regressions surfaced afterwards — all fixed. The Rust port shipped in June.
Mike Krieger, co-lead of Anthropic Labs, migrated a Python codebase to 165,000 lines of TypeScript over a single weekend. Hundreds of agents, eight phase gates, three adversarial review rounds, and a final parity check that diffed every command’s output against the Python original.
It isn’t free: the Bun migration consumed 5.9 billion uncached input tokens and 690 million output tokens — around $165,000 at API pricing. But compared to three to four million dollars over a four-year project? A different math entirely.
The one sentence that carries it all
The core idea sits early in the post: you don’t fix the code. You fix the loop that produces it.
Large migrations are a good fit for models like Fable 5 and Opus 4.8 because the work is parallel: thousands of independent files, with agents working on them at the same time. The old code is the perfect spec. The test suite is a built-in referee. And the queue writes itself — every compiler or test failure becomes the next to-do.
Six steps, roughly
Anthropic describes a six-step process. Very compressed: first you build a judge — tests that run against both the old and new codebase equally. Then come the rulebook, dependency map, and gap inventory. A stress test on a few files catches mistakes before they fan out across thousands. Then everything gets translated, compiled, run, and its behavior matched.
The interesting detail: smaller models do the high-volume grunt work, larger ones handle reviews and anything that writes rules other agents follow. And when a reviewer keeps catching the same mistake, you don’t patch the file — you add one sentence to the rulebook and regenerate the affected batch.
My take
What sticks with me is the shift in perspective. The old worst case was two parallel codebases running for quarters and a result at 90% parity. Today? You delete the branch and try again.
That doesn’t just lower cost, it lowers career risk. Migrations used to have to be existential to be worth it. Now a chronic bottleneck is enough. Mike’s compile step dropped from eight minutes per platform to two seconds.
Anthropic dropped a migration starter kit on GitHub for this. If you’ve got a codebase you’ve been tolerating for years — maybe it’s worth running the math again.
Sources: