TubeSum ← Transcribe a video

The Most Controversial Rewrite in History Just Shipped

0h 05m video Published Jul 15, 2026 Transcribed Jul 15, 2026 F Fireship
Intermediate 4 min read For: Software developers and engineers interested in AI-assisted coding, language migration, and community dynamics.

AI Summary

Bun, a JavaScript toolkit acquired by Anthropic, spent $165,000 running 64 parallel Claude agents to rewrite its entire codebase from Zig to Rust in 11 days. The port fixed 128 bugs, shrunk the binary by 20%, and improved performance, but sparked controversy with Zig creator Andrew Kelly, who claimed the benchmarks were misleading.

[00:02]
The Rewrite

Bun used 64 parallel Claude agents to refactor 535,000 lines of Zig to Rust in 11 days, costing $165,000 in compute.

[00:17]
Results

The port fixed 128 old bugs, shrunk the binary by 20%, and made everything a few percent faster. It has been powering Claude code since June.

[00:42]
Andrew Kelly's Response

Zig creator Andrew Kelly claimed benchmarks are misleading, and the Zig team was relieved to see Bun go, citing poor Zig practices.

[01:10]
Historical Context

Joel Spolsky's famous blog post claimed rewriting is the single worst strategic mistake a software company can make, using Netscape as an example.

[01:36]
Why Zig Was Problematic

Bun's manual memory management in Zig led to bugs like use-after-free and memory leaks. The dev server was leaking 3 MB per request.

[02:14]
Anthropic's Motivation

After acquisition, most future code would be written by Claude. Zig is anti-AI, refusing LLM-generated PRs, and models are poor at writing Zig.

[02:58]
How the Rewrite Worked

Claude studied the codebase, traced lifetimes into a spreadsheet, then used 64 agents across 4 git worktrees, generating 1300 lines of Rust per minute with adversarial reviewers.

[04:02]
Andrew's Criticism

Andrew claimed performance gains came from LTO (which Zig supports), binary size reduction wasn't due to Rust, and compile times favor Zig. He also made personal attacks.

The rewrite succeeded technically but ignited a public feud between Bun and Zig communities. The debate highlights tensions between manual memory management and AI-assisted development.

Clickbait Check

85% Legit

"Title accurately describes a controversial rewrite; content delivers on the promise."

Mentioned in this Video

Study Flashcards (10)

How many lines of code were rewritten from Zig to Rust?

easy Click to reveal answer

535,000 lines.

02:43

How many parallel Claude agents were used in the rewrite?

easy Click to reveal answer

64 agents.

03:10

How long did the rewrite take?

easy Click to reveal answer

11 days.

03:36

How many bugs were fixed by the rewrite?

easy Click to reveal answer

128 bugs.

03:48

What was the estimated cost of the rewrite in compute?

easy Click to reveal answer

$165,000.

03:36

What was the binary size reduction percentage?

easy Click to reveal answer

20%.

03:48

What did Andrew Kelly claim was the real source of performance gains?

medium Click to reveal answer

Link time optimization (LTO), which Zig supports.

04:27

Why did Anthropic want to move away from Zig?

medium Click to reveal answer

Zig is anti-AI (refuses LLM-generated PRs) and models are poor at writing Zig.

02:14

What was the memory leak issue in Bun's dev server?

medium Click to reveal answer

It was leaking three megabytes per request.

02:01

What did Joel Spolsky's famous blog post claim about rewriting?

medium Click to reveal answer

It is the single worst strategic mistake a software company can make.

01:10

💡 Key Takeaways

🔧

AI-Powered Rewrite

Demonstrates a novel approach to codebase migration using multiple AI agents.

00:02
⚖️

Spolsky's Warning

Classic software engineering wisdom that rewrites are risky.

01:10
💡

Zig's Anti-AI Stance

Highlights cultural clash between AI-assisted development and language community values.

02:14
💬

Andrew Kelly's Response

Illustrates personal and technical fallout from the rewrite.

04:02

✂️ Creator Tools: Viral Hooks

AI-generated clip ideas for Shorts based on the transcript

AI rewrote 535k lines of code in 11 days

43s

Shocking speed and scale of AI-powered code rewrite sparks debate on AI replacing human developers.

▶ Play Clip

Why memory bugs forced Bun to rewrite

45s

Relatable technical struggle with memory management in Zig leads to dramatic codebase overhaul.

▶ Play Clip

Zig creator attacks Bun founder publicly

48s

Drama and personal insults between tech leaders fuel controversy and viewer engagement.

▶ Play Clip

128 bugs fixed in controversial rewrite

48s

Tangible results from the rewrite challenge the 'never rewrite' dogma in software engineering.

▶ Play Clip

[00:02] JavaScript toolkit that was acquired by Anthropic late last year, announced that they spent the equivalent of $165,000 running 64 parallel clot agents to refactor their entire codebase from Zigg to Rust in just 11 days. Usually, a full

[00:17] rewrite to Rust is the swan song of any startup about to get Rick James by the invisible hand of the market, but in this case, it may have actually worked. The millionline port fixed 128 old bugs, shrunk the binary by 20%, made

[00:30] everything a few% faster, and has already been powering Claude code since June without anyone noticing. But not everyone is celebrating. Andrew Kelly, the creator of Zigg, responded claiming the benchmarks are misleading, and the

[00:42] Zig team is actually relieved to see Bun go because internally they used its codebase as an example of how not to write Zigg and that Jared, Bun's founder, was producing SLOP long before LLM existed. In today's video, we'll

[00:55] find out how the biggest AI powered rewrite in history actually went down public opinion in the divorce. It is July 15th, 2026, and you're watching the was throwing Japan airs in the warehouse, Joel Spolski wrote one of the

[01:10] most famous blog posts in software history where he claimed that rewriting strategic mistake a software company can make. His example was Netscape, who browser while Microsoft stole their women and pillaged their village. So,

[01:24] what led Bun to fall to the temptation of the single word strategic mistake they could make? Well, it's actually the same thing that led you to fail CS 101, switch majors, and become a JavaScript developer, but poor memory management.

[01:36] With Zigg, the language Bun was originally written in, you manually from the compiler. That's usually a feature of a low-level language because Bun embeds JavaScript core, which is Safari's garbage collected JavaScript

[01:49] engine. Half of Bun's objects were owned by the garbage collector, while the other half lived in manually managed Zig memory, and the two had to constantly manage pointers to each other, which led to a codebase that looked like it had an

[02:01] change logs are full of bugs stemming from this, where code was reading memory that had already been freed, or freeing the same memory twice, or just never freeing it at all. At one point, the dev server was leaking three megabytes every

[02:14] error path forgot to clean up after itself. And though memory bugs alone there was still a bigger problem. Once Anthropic acquired Bun, the majority of its future code was going to be written by Claude. And Zigg is famously anti-

[02:29] AI. So much so that they refuse LLM generated pull requests and they'll even close your security report if you admit AI found the bug. On top of that, the internet to train on, and the language itself hasn't hit 1.0 yet, so

[02:43] models just aren't very good at writing it compared to more established languages. And so in early May, Jared decided to fix both problems at once by porting all 535,000 lines of Zigg to Rust, whose borrow checker would move

[02:58] memory management into the type system, which made most memory mismanagement a compile time error rather than a runtime error. But the most interesting part is how they did it. They first had Claude spend hours studying the codebase to

[03:10] workflow that traced the lifetime of every struck field into a giant spreadsheet, essentially documenting years of tribal knowledge about who frees what and when. From there, they used 64 parallel CLA agents across four

[03:23] git workrelate all, 1448 files, at one point cranking out 1300 lines of Rust per minute. And to keep the agents honest, every implementer was paired with two adversarial reviewer clouds running in

[03:36] separate context windows whose only job was to assume the code was wrong and was to assume the code was wrong and find out why. 11 days, 6,52 commits and what would have been $165,000 in spend if they didn't own the token

[03:48] casino later. Bun's entire test suite was passing on every platform. The port fixed 128 long-standing bugs. The dev servers memory leak issues resolved, but binaries got 20% smaller. and Andrew Kelly, the creator of Zigg, lost his

[04:02] mind. In his response, Andrew makes it clear that this divorce was years in the making. According to him, the Zigg team spent years watching Bun embarrassed their language with a codebase they privately used as the example of how not

[04:14] personal swings, pointing out that Jared skipped college at 18 to take Peter Teal's money and Chase startup glory, which Andrew blames for his beginner energy and passing along secondhand reports that Jared wasn't exactly a

[04:27] great manager to work under. But buried under the resentment are some legitimate performance gains mostly came from link time optimization which Zig has supported the whole time that the binary size reduction had nothing to do with

[04:40] Rust and that Jared conveniently left out any reference to compile times which Zigg almost certainly wins. So the question is who gets custody of public opinion? Well, probably nobody. Zigg lost its most famous user. Andrew lost

[04:52] his cool and Jared got publicly diagnosed with beginner energy by a compiler engineer. But if you're looking to rewrite your own codebase in Rust or you need to know about Code Rabbit, the sponsor of today's video. Writing

[05:05] thousands of lines of code with AI feels great until you have to review all that unholy slop by hand. Code Rabbit Review turns your pull requests into guided walkthroughs you'll actually finish. It groups related changes into cohorts,

[05:17] orders them into layers, and adds AI summaries so you can move through all the changes quickly in the right order. Instead of one giant flat diff, it feels like an IDE for your pull requests. Your comments and approvals still go back to

[05:29] GitHub natively. And when it helps, the Code Rabbit can generate inline diagrams for your call flows, state changes and schema updates. Over 100,000 open- source projects like Bun and Nex.js use Code Rabbit, and you can try it out for

[05:42] been the Code Report. Thanks for watching, and I will see you in the next watching, and I will see you in the next one.

⚡ Saved you 0h 05m reading this? Transcribe any YouTube video for free — no signup needed.