
TL;DR
A deep dive into the agent orchestration behind the Bun Rust rewrite - the workflow architecture, adversarial review gates, what one human actually did, and the Zig vs Rust debate including Andrew Kelley's response.
On July 8, Jarred Sumner published Rewriting Bun in Rust, the technical postmortem of porting the Bun JavaScript runtime from Zig to Rust. The headline numbers are wild: 535,496 lines of Zig, 6,502 commits, 11 days, one engineer.
But the headline you have probably seen repeated - "64 agents rewrote Bun" - is not quite what the post says. Here is the exact quote:
"At peak, we were running 4 of these workflows at once each in a separate worktree, each with 16 Claudes per workflow. About 64 Claudes at a time."
64 was the peak concurrency, not the team size. The actual unit of organization was what Sumner calls "about 50 dynamic workflows in Claude Code run continuously over the course of 11 days," using "a pre-release version of Claude Fable 5." That distinction matters, because the workflows - not the raw agent count - are the transferable lesson. This post breaks down the orchestration architecture, the verification gates, what the human actually did, and the Zig vs Rust debate that followed, including Andrew Kelley's response.
We covered the news itself in our earlier post. This is the deep dive for people who coordinate agent fleets.
Everything below is from the primary post:
Results, per the same post: a roughly 20% smaller binary on Linux and Windows, 2-5% faster overall with HTTP throughput up 2.8-4.8%, 128 memory bugs fixed, and the full test suite passing on all 6 platforms (Linux, macOS, Windows, each on x64 and arm64) before merge.
The fleet was not a swarm of agents with a shared goal. It was a hierarchy of pipelines with hard role separation.
Every workflow was built around one loop: an implementer writes code, then "2 or more adversarial reviewers per implementer" attack it. Sumner is explicit about the reviewer mandate:
"The reviewer's only job: find bugs & reasons why the code does not work."
This is the single most reusable pattern in the whole post. Reviewers are not collaborators. They are not asked to be balanced. They are prompted to be hostile, and a separate fixer agent applies their feedback. In the compiler-error phase this became a strict assembly line: "1 fixes 2 review 1 applies," with commits landing per crate.
Parallelism was sharded across git worktrees, not just processes:
"I split it into just 4 workflow shards each with their own worktree (4 worktrees total), each running 16 claudes committing and pushing files."
Why worktrees? Because early on, agents sharing one checkout destroyed each other's work. From the post: about 2 minutes into looping the port over all 1,448 files, "one Claude ran git stash before committing. Another ran git stash pop. And then git reset HEAD --hard. They were stepping on each other!" Full per-agent worktrees were too expensive (Bun's repo is huge, and changes eventually need to compile together), so the compromise was 4 shards with 16 agents each, coordinated inside a shard by the workflow itself.
If you run multi-agent coding at any scale, this is the same lesson everyone hits: file-scope isolation is the first thing you design, not the last.
The rewrite was not "port Bun to Rust" as a single instruction. It was a sequence of distinct pipelines, each with its own verification signal:
cargo check, group errors by file, and run the fix/review/apply line until crates compile.Each phase has a machine-checkable exit condition. That is the quiet genius of the design: the agents never needed to judge their own success, because the compiler, the smoke tests, and 1.38 million expect() assertions did it for them.
The post's most quotable engineering principle:
"fixing the process that generates the code instead of hand-fixing the code."
When agents produced bad output, Sumner edited the workflow, not the diff. One example from the post: Claude interpreted "let's get all the crates to compile" as "stub out the functions with compilation errors." The response was not to un-stub functions by hand; it was to change the workflow instructions so the failure mode could not recur across thousands of files. At 695 commits per hour, hand-fixing is not an option anyway. The workflow is the program; the agents are the runtime.
Newsletter
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools, delivered free every week.
From the archive
Jul 12, 2026 • 7 min read
Jul 12, 2026 • 7 min read
Jul 12, 2026 • 8 min read
Jul 12, 2026 • 9 min read
The port survived because verification was independent of the thing being ported.
expect() calls across 60,624 tests on Debian x64, with comparable counts on macOS and Windows, and "0 tests skipped or deleted" during the rewrite.That last one deserves emphasis. Agents under pressure to make tests pass will sometimes make tests not run. Sumner's checklist assumed exactly that failure mode.
The gates were not perfect. The post owns "19 known regressions, each of which has been fixed," mostly from code that is "syntactically identical in both languages but semantically different" - a debug_assert! that erased side effects, off-by-one bounds checks Rust caught but Zig did not, a slice panic where Zig would truncate. The lesson: a million assertions catch a lot, but semantic gaps between languages slip through precisely because the code looks right.
One engineer. Sumner's own description of his role during the 11 days:
"For most of those 11 days (and after), I monitored workflows - manually reading the outputs to check for issues and bugs"
Concretely, the human's job was: design the phased pipelines, watch outputs for false starts, edit workflow instructions when the process produced bad code, verify the tests were really running, review that "the adversarial code review agents were correctly catching discrepancies," handle infrastructure failures (the machine "ran out of disk space and crashed several times"), run manual local checks after CI went green, and press merge.
An HN commenter (yomismoaqui) put a name on this role: "coding agent herders," where "the test harnesses, linters, workflows, etc will be our herding dogs." That maps to what we see in every serious fleet deployment: the human moves up one level of abstraction, from writing code to writing and debugging the system that writes code.
One caveat from the HN thread worth carrying: commenter grandimam pointed out that this was not any engineer plus any codebase. Sumner had deep full-context knowledge of Bun (itself a reimplementation of Node, so correct behavior was known in advance) and an exhaustive test suite. The fleet amplified an expert; it did not replace one.
At "around $165,000 at API pricing," the port was not cheap, and the HN thread litigated the comparison thoroughly. One commenter (jeremyloy_wt) ran the napkin math: a comparable human team effort at loaded Bay Area rates lands several times higher, before counting coordination overhead. Others (IshKebab) countered that cheaper engineering markets narrow the gap, and that the 11-day timeline, not the dollar figure, is the real advantage. Sumner's own framing in the post: "This Rust rewrite would've taken a team of engineers with full-context on the codebase a year of work."
There is also a disclosure worth stating plainly: Bun is part of Anthropic, the model was a pre-release Fable 5 that nobody outside Anthropic could use in May, and the post doubles as a Claude showcase. Several HN commenters (rvz, cube00) flagged exactly this. The orchestration patterns are real and reproducible; the specific cost and timeline came with insider model access.
The post's stated motivation is a specific bug class: mixing JavaScriptCore's garbage-collected values with Zig's manually managed memory produced recurring use-after-free, double-free, and leak-at-error-boundary bugs. Rust's borrow checker turns those into "compiler errors" instead of conventions "enforced through code review." The team reports 128 memory bugs fixed and instrumentable leaks eliminated.
Zig's creator responded on July 9 with My Thoughts on the Bun Rust Rewrite, and his argument deserves a fair reading:
Despite sharp words about Bun's engineering culture, Kelley closes on reconciliation: "I don't wish him any ill will. Even in the midst of my frustration, I am happy for him and his success." His post hit 784 points on its own HN thread, slightly outscoring the original.
The strongest technical criticism of the port is about what "memory safe" means here. The Bun post itself discloses that "about 4% of Bun's Rust code sits inside an unsafe block" - roughly 13,000 unsafe keywords. When the port first merged to main in May, a GitHub issue reported that the codebase failed basic Miri checks and allowed undefined behavior in safe Rust, and HN commenters (dfabulich, lunar_mycroft) argued the merged state was far rougher than the announcement tone suggested. Simon Willison's counter in the thread: "that's what this whole post is about. It's about the process of going from that original state to something that's now shipping in production."
Both things are true. The May merge shipped known-rough code, and the July post documents two months of hardening, 19 fixed regressions included. If you cite this project as evidence that agent fleets produce production-ready code in 11 days, you are overclaiming; 11 days got to tests-green, and the path to production ran through June.
Patterns from this case study that transfer to normal-sized teams and codebases:
Not exactly as usually stated. The primary source says: "At peak, we were running 4 of these workflows at once each in a separate worktree, each with 16 Claudes per workflow. About 64 Claudes at a time." So 64 was peak concurrency across about 50 dynamic Claude Code workflows run over 11 days, using a pre-release version of Claude Fable 5, orchestrated by one engineer.
Three gates: adversarial review agents on every change (two or more reviewers per implementer whose only job was finding bugs), phase-specific machine checks (cargo check per crate, then CLI smoke tests), and Bun's language-independent TypeScript test suite - over 1.38 million expect() assertions - passing in CI on all 6 platforms before merge, with a manual audit that tests were genuinely running.
Jarred Sumner designed the phased workflows, monitored outputs continuously ("manually reading the outputs to check for issues and bugs"), edited workflow instructions when agents produced bad patterns, verified the review agents were catching real discrepancies, handled machine crashes and disk exhaustion, and made the merge decision.
The Zig creator argues the rewrite "had nothing to do with the language features of Zig vs Rust" and everything to do with engineering values, pointing to TigerBeetle as a large Zig codebase without Bun's bug profile. He also notes the performance gains are attributed to LTO, which Zig has long supported, and that compilation speed went unreported.
Partially. About 4% of the Rust code is inside unsafe blocks (roughly 13,000 unsafe keywords), and the initially merged code failed Miri checks per a GitHub issue filed in May. The team reports 128 memory bugs fixed and instrumentable leaks eliminated, plus 19 known regressions from the rewrite, all since fixed. The safety story improved between the May merge and the July writeup.
Around $165,000 at API pricing (5.9 billion uncached input tokens, 690 million output tokens), plus 11 days of one expert engineer. Comparable human-team estimates in the HN discussion ranged from a few hundred thousand dollars to a year of team time. The bigger caveat: the project used a pre-release model with insider access and an unusually strong test suite, so treat the timeline as an upper bound on what was possible in mid-2026, not a baseline.
Read next
The Bun runtime completed an AI-assisted rewrite from Zig to Rust, fixing memory safety issues and improving performance. Here is what HN thinks and why it matters for LLM-assisted code migration.
6 min readClaude Code parallel agents cost real money because every session draws from one quota - here is the June 2026 budgeting math, verified against live pricing.
10 min readThe coding-agent workflow is maturing past giant hand-written prompts. The winning pattern in 2026 is a control stack: project rules, reusable skills, bounded sub-agents, and deterministic tools around the model.
9 min readTechnical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
High-performance code editor built in Rust with native AI integration. Sub-millisecond input latency. Built-in assistant...
View ToolA hosted infinite canvas your headless AI agents drive over MCP. Any MCP-speaking agent - Claude Code, Codex, Cursor, or...
View ToolAnthropic's agentic coding CLI. Runs in your terminal, edits files autonomously, spawns sub-agents, and maintains memory...
View ToolAnthropic's Python SDK for building production agent systems. Tool use, guardrails, agent handoffs, and orchestration. R...
View ToolSpec out AI agents, run them overnight, wake up to a verified GitHub repo.
View AppDesign subagents visually instead of editing YAML by hand.
View AppRun hundreds of agent evals in parallel. Find regressions in minutes.
View AppConfigure Claude Code for maximum productivity -- CLAUDE.md, sub-agents, MCP servers, and autonomous workflows.
AI AgentsDeep comparison of the top AI agent frameworks - LangGraph, CrewAI, Mastra, CopilotKit, AutoGen, and Claude Code.
AI AgentsRead file contents with line limiting, offset, and binary support.
Claude Code
Build Anything with Vercel, the Agentic Infrastructure Stack Check out Vercel: https://vercel.plug.dev/cwBLgfW The video shows a behind-the-scenes walkthrough of how the creator rapidly builds and d

Leveraging Anthropic's Subagent for Claude Code: A Step-by-Step Guide In this video, we explore Anthropic's newly released subagent feature for Cloud Code, which allows developers to create...

Check out Trae here! https://tinyurl.com/2f8rw4vm In this video, we dive into @Trae_ai a newly launched AI IDE packed with innovative features. I provide a comprehensive demonstration...

The Bun runtime completed an AI-assisted rewrite from Zig to Rust, fixing memory safety issues and improving performance...

Claude Code parallel agents cost real money because every session draws from one quota - here is the June 2026 budgeting...

The coding-agent workflow is maturing past giant hand-written prompts. The winning pattern in 2026 is a control stack: p...

Ten private tools shipped overnight - observability, skills, hooks, prompts, and evals - aimed at the agent infrastructu...

ByteDance's Dockerless paper asks whether coding-agent patches can be verified without spinning up per-repo environments...

The architecture side of loop engineering: plan/act/verify cycles, convergence criteria, retry policies, budget-bounded...

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.