How to Ship Millions of Lines of Agent-Written Code — Jarred Sumner, Anthropic
Summary
Jarred Sumner describes landing a multi-million-line, agent-authored ahead-of-time compiler for Bun after five rewrites in roughly a month, cutting memory about 4x and doubling startup speed. The central argument is that pre-existing test suites — not model quality alone — are what make machine-written code at this scale reviewable and safe to merge. He also explains why the team optimized the JavaScript toolchain instead of porting Claude Code to Rust, and how a workflow of ~140 concurrent agents plus hourly scorecards and fuzzing changes what a human engineer actually does.
Key takeaways
- Treat a legacy test suite as the contract: tests written before agents existed are the strongest signal that generated code preserves intended behavior.
- Keep multiple independent implementations (e.g. interpreter, JIT, and AOT paths) in agreement so differential testing catches divergence the agents introduce.
- Run agents in batches — generate broadly, then reconcile and fix — rather than expecting a single long pass to converge on correct code.
- Measure the bottleneck before choosing a rewrite: profiling pointed at toolchain memory and startup cost, so improving JavaScript beat a Rust port in effort and risk.
- Operate agents as long-lived subagents with hourly scorecards and fuzzing so regressions surface continuously instead of at merge time.