Bun creator Jarred Sumner, now at Anthropic, explains at AI Engineer Code Summit how his team tested a new compiler for the JavaScript runtime behind Claude Code.
Pick a project whose results you can check
- Bun had already moved from Zig to Rust using the same TypeScript tests for both implementations. A Rust rewrite of Claude Code would also have required porting its tests.
- The team kept Claude Code in TypeScript and moved some compilation work out of each running session. The ahead-of-time compiler does that work before the program starts.
- They reused Bun and WebKit tests, the JavaScript conformance suite Test262, and application tests. They also made Bun’s test runner work in the new mode.
Compare ways to run the same program
- Run it with the just-in-time compiler, with the new compiler, and without TypeScript annotations. Matching results are evidence for the cases exercised.
- Use generated inputs to exercise more behaviors, and check that the tests actually catch faults. The compiler treats TypeScript annotations as hints and retains checks when it cannot establish a safe shortcut.
Generate in batches, then measure relentlessly
- Sumner says one iteration used 140 agents at once to get the initial code written. After a shared build, he favored focused, long-lived agents that could retain context while fixing failures.
- Early versions missed different targets. One consumed too much memory; another used brittle shortcuts. A later version compiled Claude Code in about 50 seconds. Sumner says the fifth brought that below 20 seconds.
- Hourly Slack scorecards compared revisions across several metrics. Sumner reported roughly one-quarter of the memory use and twice-as-fast startup for Claude Code in internal testing. Those figures describe that workload, and programs that generate code at runtime can fare worse.
“You’re really constrained by how you test that the code works.”