# Rewrite Bun

> **TL;DR.** Rewrite Bun refers to the AI-executed migration of the [Bun](https://bun.

- **Category:** AI / Software Engineering / Developer Tools
- **Stage:** emergent
- **Age:** 29 days
- **Origin date:** 2026-05-05
- **First detected:** 2026-05-15
- **Canonical URL:** https://earlyterms.com/term/rewrite-bun
- **Sources:** 7 primary URLs

## Definition

Rewrite Bun refers to the AI-executed migration of the [Bun](https://bun.sh) JavaScript runtime from Zig to Rust — 1,009,257 lines of new code across 6,755 commits, generated almost entirely by Anthropic's Claude Code agents. The branch name, `claude/phase-a-port`, became the shorthand for the event.

On May 5, 2026, Bun creator Jarred Sumner published a [Zig-to-Rust porting guide](https://github.com/oven-sh/bun/commit/46d3bc29f270fa881dd5730ef1549e88407701a5) seeding the rewrite effort; nine days later, [PR #30412](https://github.com/oven-sh/bun/pull/30412) was merged into main, passing 99.8% of the existing test suite. Anthropic had acquired Bun in December 2025 and supplied the Claude Code agents that did the translation.

## Analogy

Think of it as a live organ transplant where the surgical team is an AI and the patient keeps running the whole time.

## Why it's emerging now

On May 14, 2026, Anthropic's Claude Code agents merged 1 million lines of AI-written Rust into Bun in 9 days — making this the first production JavaScript runtime rewritten end-to-end by AI. The merge immediately collided with Rust safety orthodoxy: 13,000+ unsafe blocks and Bun's own CI auto-tagging the deletion PR as 'ai slop.'

## Related terms

- *parent:* agentic-coding
- *related:* ai-slop
- *related:* claude-agent-sdk
- *related:* claude-code
- *parent:* code-agent
- *related:* vibe-coding
- *related:* Zig
- *related:* Rust
- *related:* Bun
- *parent:* rewrite it in Rust

## Sources

1. [PR #30412: Rewrite Bun in Rust — Jarred Sumner](https://github.com/oven-sh/bun/pull/30412)
2. [HN: Rewrite Bun in Rust has been merged (667p, 742c)](https://news.ycombinator.com/item?id=48132488)
3. [HN: Zig → Rust porting guide (723p)](https://news.ycombinator.com/item?id=48016880)
4. [The Register: Anthropic's Bun Rust rewrite merged at speed of AI](https://www.theregister.com/devops/2026/05/14/anthropics-bun-rust-rewrite-merged-at-speed-of-ai/5240381)
5. [ByteIota: The 13,000 Unsafe Block Problem](https://byteiota.com/bun-rust-rewrite-merged-the-13000-unsafe-block-problem/)
6. [Bun blog: Bun joins Anthropic (Dec 2, 2025)](https://bun.com/blog/bun-joins-anthropic)
7. [The Register: Bun team trials port from Zig to Rust (May 5, 2026)](https://www.theregister.com/software/2026/05/05/anthrophics-bun-team-trials-port-from-zig-to-rust/5222094)

---
_Generated by EarlyTerms · https://earlyterms.com/term/rewrite-bun_
