Bun’s creator Jarred Sumner merged a staggering rewrite this week. Over one million lines of Rust code now sit in the project’s main repository. The change marks the end of the JavaScript runtime’s reliance on Zig. Version 1.3.14 shipped as the final Zig-based release.
Memory leaks had plagued Bun for months. They hit hardest at its biggest user. That user? Claude Code, the AI-powered coding tool from Anthropic. Spikes reached 14GB or even 23GB in some sessions. Something had to give.
Anthropic acquired Bun in December 2025. The move aimed to supercharge Claude Code. It also handed the Bun team access to vast compute and Claude agents. Those agents didn’t waste time.
The Rewrite That Defied Normal Timelines
In just six days a cluster of high-memory nodes produced 6,755 commits. The branch, claude/phase-a-port, translated roughly 960,000 lines from Zig to Rust. Tests passed at 99.8 percent on Linux x64 glibc. Sumner shared the numbers on X days before the merge. He noted a high chance the code might get thrown out. Events moved faster than expected.
The final pull request landed on May 14, 2026. Binary size dropped between 3 and 8 MB. Performance held steady or improved slightly. Architecture and data structures stayed the same. No async Rust appeared in the port. Yet the real win came elsewhere.
“Most importantly, we now have compiler-assisted tools for catching and preventing memory bugs, which have cost the team an enormous amount of development and debugging time over the years,” Sumner wrote in a comment attached to the merge. Rust turns use-after-free, double-free, and forgotten frees into compile errors or automatic cleanup. Some leaks remain. References held too long or JS boundary re-entries still demand human attention. But a large percentage of past headaches simply vanish.
Sumner had long championed Zig. He built Bun with it. The language delivered speed and simplicity. Yet Zig maintains a strict no-AI policy on contributions. Bun’s workflow already leaned heavily on AI. Even before the acquisition, Sumner said, the team rarely typed code by hand. “This is already the status quo; we haven’t been typing code ourselves for many months now. Even pre-acquisition this was pretty much accurate,” he posted on X.
The mismatch proved fatal for the Zig version. Bun relied on a forked Zig that incorporated AI-generated changes. Upstream maintainers made clear those contributions would not be welcome. A Rust port solved the tension. It also aligned with Anthropic’s internal practices.
Critics wasted no time. The Rust code contains more than 13,000 unsafe blocks. One GitHub comment on the merge quipped, “What a nice reviewable little commit. I’m sure it will not contain any bugs.” Another pull request that deleted 600,000 lines of Zig was flagged by GitHub as “AI slop” and automatically closed. Humans cannot review million-line changes in any traditional sense. Trust in the test suite and in Claude’s output became the only practical path.
Yet the numbers tell a story. The port followed a detailed PORTING.md guide with roughly 300 rules for mapping Zig idioms to Rust. Phase A focused on faithful logic translation. Later phases handle compilation and optimization. Robobun, an internal Claude-powered agent, generated and submitted most of the changes. Human engineers reviewed, adjusted, and merged. The process blended AI generation with targeted oversight.
Community reaction split along familiar lines. Some developers mourned the loss of Zig’s elegance and the project’s independent spirit. Others saw validation for AI-augmented systems programming. Threads on Reddit and Hacker News filled with debate. One post asked why not rewrite Claude Code itself in Rust from scratch. The answer appears practical. Bun already powered the tool. Fixing the foundation delivered faster returns than a full client rewrite.
Version 1.3.14 brought more than the language switch. A new built-in image processing API handles decoding, transformation, and encoding. It serves as a drop-in replacement for the Sharp library used in Node.js projects. Experimental HTTP/3 support arrived for the integrated server. Installation sped up. These features landed on the back of the stable Zig foundation even as the Rust transition accelerated.
The Register first reported the merge and its implications hours after it happened (The Register). DevClass had covered the earlier trial port and noted Zig’s no-AI policy might embarrass its new owner (DevClass). NeedHelp detailed the six-day timeline, 99.8 percent pass rate, and the 13,000 unsafe calls that sparked backlash (NeedHelp).
Recent discussions on X highlight the surprise. “Bun got acquired by Anthropic. I interpret this rewrite as cynical, designed to juice the meme value of both rust and Claude,” one user posted. Another noted the irony: core devs who joined for Zig now work under Anthropic with a Claude-generated Rust codebase. Sumner himself has stayed mostly quiet beyond the merge announcement and test results.
This episode exposes larger shifts in how complex runtimes get built. Traditional hand-crafted code in low-level languages demanded years and large teams. AI agents, given clear rules, exhaustive tests, and sufficient compute, can produce functional equivalents at astonishing speed. The Bun port did not invent new algorithms. It translated existing ones. That distinction matters. Faithful porting plays to current AI strengths while sidestepping hallucination risks on novel designs.
Memory safety gains alone justify the move for many observers. Production users of Bun as a server runtime had grown frustrated. Claude Code, running thousands of sessions daily, amplified every leak. Rust’s borrow checker now stands guard. Future debugging time should drop. Follow-up PRs will clean up unsafe blocks and optimize further. The team expects those changes to arrive incrementally.
But questions linger. Can AI-generated systems code prove reliable at scale over years? Will the Rust version attract outside contributors who previously avoided Zig? Or does ownership by Anthropic deter open-source purists? The project remains under active development. Its test suite, once the benchmark for the port, will now guard against regression as humans and agents continue to evolve the codebase together.
Sumner built Bun to make JavaScript development faster. The runtime bundled bundler, package manager, and test runner into one lightning-quick binary. That speed helped it carve out users from Node.js and Deno. Now the same drive for velocity has turned inward. The tools that made Bun popular helped rewrite Bun itself.
Industry watchers will track adoption of the Rust edition. Early canary releases already circulate. Stability looks promising. If the memory improvements hold and performance edges higher, Bun could cement its place as essential infrastructure for AI-driven coding environments. The experiment that started as curiosity became production code in record time. And the agents that wrote it show no sign of slowing down.
