---
title: 'The Most Controversial Rewrite in History Just Shipped'
source: 'https://youtube.com/watch?v=CXSvKcLovAk'
video_id: 'CXSvKcLovAk'
date: 2026-07-15
duration_sec: 352
---

# The Most Controversial Rewrite in History Just Shipped

> Source: [The Most Controversial Rewrite in History Just Shipped](https://youtube.com/watch?v=CXSvKcLovAk)

## 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.

### Key Points

- **The Rewrite** [00:02] — Bun used 64 parallel Claude agents to refactor 535,000 lines of Zig to Rust in 11 days, costing $165,000 in compute.
- **Results** [00:17] — 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.
- **Andrew Kelly's Response** [00:42] — Zig creator Andrew Kelly claimed benchmarks are misleading, and the Zig team was relieved to see Bun go, citing poor Zig practices.
- **Historical Context** [01:10] — Joel Spolsky's famous blog post claimed rewriting is the single worst strategic mistake a software company can make, using Netscape as an example.
- **Why Zig Was Problematic** [01:36] — 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.
- **Anthropic's Motivation** [02:14] — 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.
- **How the Rewrite Worked** [02:58] — 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.
- **Andrew's Criticism** [04:02] — 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.

### Conclusion

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.

## Transcript

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
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
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
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
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
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,
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.
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
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
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
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-
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
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
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
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
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
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
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
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
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
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
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
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
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,
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
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
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.
