A migration that once demanded four years and $3 million just took two weeks and $160,000.
On July 16, Anthropic published an unassuming blog post — “How Anthropic runs large-scale code migrations with Claude Code” — and the developer community promptly caught fire. The story has two protagonists.
The first is Jarred Sumner, creator of Bun. Alone, in a small Oakland apartment, he spent a year building a JavaScript runtime faster than Node.js. Today Bun’s CLI exceeds 10 million monthly downloads and sits deep in Claude Code’s own dependency stack. But the technical debt from betting on Zig had come due. So he attempted the previously unthinkable: use Claude Code to migrate all of Bun from Zig to the memory-safer Rust.
In under two weeks it produced 1 million lines of code. Before merge, Bun’s entire existing test suite passed 100% in CI; after, 19 regressions surfaced — all fixed. The Rust build quietly shipped with Claude Code in June. The migration burned 5.9 billion input tokens and 690 million output tokens — about $165,000 at API pricing. Not cheap, but against the old ledger of four years and $3 million, it is a rounding error.
The second story belongs to Instagram co-founder Mike Krieger, who moved a Python codebase to 165,000 lines of TypeScript in one weekend: hundreds of agents, eight gates, three rounds of adversarial review, and a consistency pass comparing every command’s output against the Python original — any behavioral drift got treated as a bug. He even had Claude design its own end-to-end test suite, which then ran for four nights straight. Why migrate at all? The Python toolchain took 8 minutes to compile per platform and half an hour per release across the build matrix. After: 2-second compiles, binaries launching 6× faster, and an entire deployment pipeline retired.
Put together, the two stories point at one conclusion: code migration has turned from an uncrossable chasm into a progress bar waiting to be emptied.
Fix the Loop That Produces Code, Not the Code
Anthropic distills the method into one sentence: don’t fix the code — fix the loop that produces the code. Large migrations suit AI for plain reasons:
-
The work is naturally parallel — thousands of files start at once;
-
The old code is itself the best specification;
-
The test suite is a ready-made judge;
-
When a compile or test fails, the next todo surfaces on its own.
The model can grind against that objective truth for days without a human arbitrator. From there, Anthropic offers a reusable six-step framework.
The Six-Step Migration Framework
Step 1: build the judge
Before migrating, make the test suite complete and reliable. Tests are the only objective pass/fail criterion — without them, AI-generated code has no quality anchor.
Step 2: write the rules manual
Define the migration rules: target-language style, naming conventions, error-handling patterns, performance constraints. The manual is not written once — every defect a reviewer catches becomes a new sentence in it, and the affected batch of files gets regenerated.
Step 3: draw the dependency graph
Map module dependencies. Order matters: move the low-level dependencies first so the layers above have something to call.
Step 4: list the gaps
Identify old-code features with no direct counterpart in the target language. This part needs human judgment — and it is exactly where the rules manual needs supplementing.
Step 5: pilot small
Run a mid-sized module as a trial to stress the rule system. Catch the fatal problems before the run spreads to a thousand files.
Step 6: full translation with a multi-agent loop
Start the implement-review-fix agent loop. Compile, run, compare behavior item by item. Throughout, rules are never patched by hand — they are corrected at the source and the work is regenerated.
What It Means
1. Migration cost goes from linear to near-constant. Migrating 100,000 lines used to cost far more than ten times a 10,000-line migration, because human comprehension does not scale. AI’s cost scales roughly with code volume, and the marginal rate keeps falling. Bun’s case shows million-line migrations fit inside two weeks.
2. Technical debt stops being debt and becomes a hedgeable risk. The classic definition: move fast now, repay later — with the founder as the creditor, repayment meaning paused product work. Now technical debt has a quantifiable hedge cost — $165,000 or two weeks. Startups can pick the fastest path early without fearing the future migration bill.
3. The logic of language choice gets rewritten. Choosing a language used to be choosing a spouse — switching cost too high. It is becoming choosing a project tool: if the ecosystem or requirements change, migration is no longer a seven-figure project. Expect more “run first, optimize later” strategies and less over-engineering at architecture time.
4. AI coding’s ROI is quantified at last. $165,000 versus $3 million; two weeks versus four years. This is the most persuasive public AI-coding ROI case on record. The industry’s discussions were previously qualitative — “nice experience,” “better efficiency.” Now there is an anchor: in the language-migration scenario, AI costs 1/20 as much as humans and runs 100× faster.
What To Do Now
Anthropic closes its post with a suggestion: pick a codebase you have tolerated for too long and ask Claude what its migration plan would look like. It is not a joke. Concrete first moves for developers:
-
Inventory the modules you have “wanted to migrate but never dared” — run a small pilot with Claude Code or similar;
-
Build the complete test suite first — no tests, no anchor, no migration;
-
Revisit your technology-selection strategy — if migration cost has collapsed, today’s architecture decisions deserve re-examination.
Four years ago, migration was a chasm developers would not cross. Today it is a progress bar waiting to be emptied. The question is no longer whether you can migrate — it is when you intend to start.