Anthropic Rewrote Millions of Lines of Code With AI. That Should Terrify You.

You know that feeling when a junior engineer submits a pull request that touches 47 files and you immediately want to revoke their commit access? Anthropic just did that. At scale. With a language model. And they’re calling it progress.

Here’s what happened: Anthropic used Claude Code — their own AI coding agent — to execute large-scale code migrations, including a high-profile Zig-to-Rust rewrite. Millions of lines of code, rewritten autonomously by the same type of model that might have helped generate the original code in the first place. If that sentence doesn’t make you at least slightly uneasy, you haven’t been in software long enough.

When the tool that wrote your code is also the tool rewriting your code, you’re not refactoring — you’re playing telephone with yourself at industrial scale.

Let’s be clear about what this actually is. Yes, the engineering is real. Yes, AI-assisted migration can theoretically turn a two-year death march into a two-week sprint. That’s genuinely exciting. But let’s not pretend the Zig-to-Rust rewrite was chosen at random. It wasn’t. It was chosen because it’s cinematic. It’s the kind of before-and-after that looks spectacular in a tweet, in a blog post, in an investor deck. A rewrite from a niche systems language to the industry’s darling? That’s not just engineering — that’s a product narrative wearing a hard hat.

And honestly? That’s fine. Companies showcase their best work. The problem isn’t the marketing. The problem is what happens when every engineering leader sees this demo and thinks, “We should do that too.”

Because here’s what the tweet doesn’t show you: the bug that only manifests at 3 AM when a specific edge case in the rewritten memory management interacts with a kernel update nobody documented. The cascading failure that looks nothing like the original bug because the AI “fixed” the symptom and invented a new disease in the process.

AI doesn’t accumulate technical debt the way humans do — it accumulates it the way compound interest does: invisibly, exponentially, and with a balloon payment waiting at the end.

I’ve talked to engineers who’ve lived through botched migrations. The ones done by humans, with months of planning, test harnesses, and gradual rollouts — those still produced hair-pulling bugs that took weeks to diagnose. Now imagine the same migration executed in hours by an AI that doesn’t actually understand your business logic, doesn’t know why that weird hack exists in line 2,847, and has no institutional memory of the three previous attempts to rewrite this module that all failed for reasons nobody wrote down.

The promise is real. I’m not denying that. AI-assisted refactoring is going to change how we think about technical debt. Legacy systems that were previously considered “too expensive to touch” are suddenly back on the table. That’s a genuine shift, and it matters.

But the calculus has changed in both directions. The upside is faster. The downside is faster too.

Speed without understanding isn’t engineering — it’s demolition with a deadline.

What worries me isn’t that AI can do this. What worries me is the governance gap. Most organizations don’t have review processes designed for AI-generated migrations. Their code review workflows assume a human author who can explain their choices in a meeting. Their rollback strategies assume changes that happen at human speed. Their testing frameworks assume that the person writing the code also has context on what the code is supposed to do in production.

None of those assumptions hold when Claude Code rewrites your authentication layer overnight.

So here’s where I land: Anthropic’s migration work is both a genuine engineering breakthrough and a marketing masterclass, and pretending it’s only one of those things is dishonest. The real question isn’t whether AI can rewrite your codebase. It clearly can. The question is whether your organization is mature enough to survive the rewrite.

Because the AI will happily rewrite your code. It won’t rewrite your incident response plan, your testing culture, or your understanding of why your system works the way it does. That’s still on you.

The scariest part of AI-driven migration isn’t that the machine might break something — it’s that we’ll trust it to fix what it broke.

FAQ

Q: Is the Zig-to-Rust rewrite actually a real engineering achievement or just a PR stunt?

A: It's both. The engineering is legitimate — AI-assisted migration at this scale is genuinely new. But the choice of project was clearly strategic: a visually impressive, high-profile rewrite that showcases Claude's capabilities. The technical achievement and the marketing narrative are inseparable here, and pretending otherwise is naive.

Q: Should engineering leaders start planning AI-driven migrations now?

A: Only if your testing, review, and rollback infrastructure is already mature. AI migration compresses timelines dramatically, which means the margin for catching cascading bugs shrinks just as dramatically. If your organization can't handle a human-driven migration safely, AI won't fix that — it'll just make the failure faster.

Q: Isn't there a circular risk in using AI to rewrite code that AI may have helped write?

A: Absolutely. When the same class of tool generates and rewrites code, you lose the independent verification layer that human-authored rewrites provide. The AI isn't catching bugs it's predisposed to make — it's pattern-matching against its own output. That's not refactoring; that's an echo chamber with a compiler.

📎 Source: View Source