~64 AI agents rebuilt Bun in 11 days. Millions ran it for a month.

2 months ago

For a month, millions of machines have run a JavaScript runtime that AI agents rewrote into another language. Nobody noticed. That was the point.

Ask

Ask about this presentation

Answers are generated from this presentation.

Chapters

  1. 0:00~64 AI agents rebuilt Bun in 11 days. Millions ran it for a month.
  2. 0:09The problem was never speed. It was memory.
  3. 0:24It has been shipping inside Claude Code since June.
  4. 0:38Nobody read a million lines. So they built a machine to check it.
  5. 1:10The argument isn't about Rust.
  6. 1:23Syntactically identical. Semantically different.
  7. 1:36When a machine writes the code, the thing you review is the checker.
Show transcript

~64 AI agents rebuilt Bun in 11 days. Millions ran it for a month.

535,496 lines ported out of Zig in 11 days — and it shipped for a month before anyone looked
Zig → Rust 535,496 lines 11 days ~64 agents

For a month, millions of machines have run a JavaScript runtime that AI agents rewrote into another language. Nobody noticed. That was the point.

The problem was never speed. It was memory.

0 2 GB 4 GB 6 GB 500 1,000 1,500 2,000 times the same project was bundled in one process
v1.3.14 · the old Zig build v1.4.0 · the Rust rewrite
6,745 MB
609 MB
same 60-module project, bundled again and again in one process · about 3 MB leaked every build
bun.com/blog/bun-in-rust

Bun is a JavaScript runtime, and Claude Code's engine. The problem was never speed. It was memory. Bundle one project two thousand times. The old build climbs to six and a half gigabytes. The rewrite stays at six hundred megabytes.

It has been shipping inside Claude Code since June.

in Claude Code since June 17, 2026 · noticed a month later
$ strings ~/.local/bin/claude | grep -m1 'Bun v1'
Bun v1.4.0 (macOS arm64)
Bun's latest tagged stable release: bun-v1.3.14 (2026-05-13). The Rust build reached users through Claude Code before Bun published it.
11 days ~64 agents 6,502 commits +1,009,272 lines 223 unique src/*.rs · macOS arm64 ~$165k in tokens (author's accounting)

They ran it in eleven days, with about sixty agents at once. A million lines landed. It has shipped inside Claude Code since June. Run strings on the binary. It prints Bun version one point four. Bun never released it.

Nobody read a million lines. So they built a machine to check it.

1,386,826
expect() assertions
60,624
tests
0
skipped
The test suite is written in TypeScript. The rewrite couldn't touch it.
Debian 13 x64 · author manually verified the tests ran, not skipped
one agent
writes the code
↓the diff only, not the reasoning
two reviewers
see only the diff
told to assume the code is wrong
// compiles clean, frees the same memory twice:
StdioResult::Buffer(mut pipe) => {
    // pipe: Box<uv::Pipe>, handed to async uv_close
    pipe.close(Subprocess::on_pipe_close)  // UAF, then double-free
}
// fix: leak the Box so libuv owns the handle
Box::leak(pipe).close(Subprocess::on_pipe_close)
commit f0a454376c7 · caught in adversarial review · bun.com/blog/bun-in-rust

Nobody read a million lines. Nobody could. So the story isn't the writing. It's the checking. Bun's test suite is TypeScript. The rewrite couldn't touch it. One point four million assertions, sixty thousand tests, none skipped. Then the review. One agent writes the code. Two more see only the diff, not the writer's reasoning. They must assume the code is wrong. This code compiled cleanly. It frees the same memory twice. Rust was built to prevent that bug. A reviewer caught it by hand.

The argument isn't about Rust.

It's about how much proof ‘the tests pass’ really is.
Bun · acquired by Anthropic, December 2025 · no published governance document
Is that enough to trust a million lines nobody read?

The pushback isn't really about Rust. Bun has belonged to Anthropic since December. There is still no published governance document. The tests pass. Nobody noticed for a month. Is that enough to trust a million lines nobody read?

Syntactically identical. Semantically different.

19 regressions introduced, all since fixed
Zig · assert is a function
// argument runs in every build
assert(insertStale(src, false)
       == refresh_index);
Rust · debug_assert! is a macro
// whole line erased in release
debug_assert!(insert_stale(src, false)?
             == refresh_index);
That call registers files for hot reloading. In release it never ran, so hot reloading broke in release builds only.
bun.com/blog/bun-in-rust · issue #30678

Nineteen regressions got through. Zig's assert is a function, so its argument always runs. Rust's is a macro, erased in release. That call registered files for hot reloading. So reloading broke in release builds only.

When a machine writes the code, the thing you review is the checker.

The part worth keeping has nothing to do with Rust.
They built that first.
Rust v1.4.0 shipping in Claude Code latest stable tag v1.3.14
bun.com/blog/bun-in-rust · github.com/oven-sh/bun

The part worth keeping has nothing to do with Rust. When a machine writes the code, the thing you review is the checker. They built that first.