Claude Code ships as a Bun binary — and Bun keeps trading Zig for Rust

4 min read 1 source clear_take
├── "Shipping CLIs as compiled binaries eliminates real distribution and startup friction that Node imposed"
│  ├── Simon Willison (simonwillison.net) → read

Willison frames Bun's --compile output as a meaningful upgrade over the Node + npm install path, pointing to sub-10ms startup versus Node's 40-80ms cold-start tax. For a tool like Claude Code that users invoke constantly, and whose audience often doesn't want to manage a Node install, shipping a single native binary collapses the install story to 'curl one URL.'

│  └── @tosh (Hacker News, 438 pts) → view

By submitting Willison's post with the framing 'Claude Code uses Bun written in Rust now,' tosh signals that the runtime and packaging swap is the newsworthy angle — a quiet but material change in how a heavily-used AI CLI reaches developers' machines.

├── "Bun's quiet migration to Rust in its hot paths undermines the 'one language, one compiler' origin story that defined the project"
│  └── Simon Willison (simonwillison.net) → read

Willison argues the more interesting story is that Bun — pitched as a Zig-first runtime with no C++ — has been progressively replacing bundler, transpiler, and resolver internals with Rust crates like Oxc. He treats the lack of a splashy announcement as telling: the tidy narrative that runtime authors pick one language and stick with it is breaking down in practice.

└── "The Claude Code + Bun + Rust stack marks how far AI tooling has drifted from the pure-JavaScript norms of just a few years ago"
  └── Simon Willison (simonwillison.net) → read

Willison collapses the whole story to a single sentence he calls absurd by 2023 standards: an AI CLI from a research lab now runs on a JavaScript runtime partly written in Rust and shipped as a native binary. He treats this as evidence that every layer of the developer tooling stack — distribution, runtime, and implementation language — is quietly being rebuilt.

What happened

Simon Willison flagged an under-reported change: Anthropic's Claude Code CLI is now distributed as a standalone binary compiled with Bun's `--compile` flag, rather than the previous Node.js + npm install route. The tool that a large chunk of professional developers now run several times an hour has quietly swapped its runtime out from under them.

The second half of Willison's post is arguably the bigger story. Bun — the Zig-first JavaScript runtime whose entire origin myth was 'one language, one compiler, no C++' — has been progressively replacing its own hot-path internals with Rust. Pieces of the bundler, transpiler, and module resolver now lean on Rust crates (Oxc, Rolldown-adjacent code, and a growing collection of internal helpers) rather than Zig. Jarred Sumner and team haven't made a splashy announcement about it; you notice it in commit logs and dependency graphs.

So the headline collapses to a sentence that would have sounded absurd two years ago: Claude Code, an AI coding tool from a research lab, runs on a JavaScript runtime written partly in Rust and shipped as a native binary. Every layer of that is a departure from what those tools looked like in 2023.

Why it matters

CLIs live and die by startup time and distribution friction. A Node-based CLI pays a cold-start tax of roughly 40–80ms before your code runs — small in isolation, painful when it's in your shell prompt or your editor's `on-save` hook. Bun's compiled binaries typically launch in under 10ms and, more importantly, don't require the user to have a specific Node version installed. For a tool like Claude Code, where the target audience includes people who don't want to think about their Node install (or don't have one), that's not a micro-optimization — it's the difference between 'curl one URL' and 'read a five-step install guide'.

The Rust drift inside Bun is the more interesting signal, because it kills the tidy narrative that runtime authors pick a language and marry it. Zig gave Bun a very fast start: small binary size, tight control over memory, an easy FFI story, and a founder who could reason about the whole stack. But Zig's ecosystem is still small. When you need a battle-tested CSS parser, an ES module resolver, or a source-map library, Rust has one and Zig usually doesn't. Bun is doing the pragmatic thing — importing Rust crates for the pieces the JS community has already hardened, and keeping Zig for the core event loop and JSC glue. Ideology loses to Cargo.

There's a comparison worth making with Deno. Deno went Rust-native from day one and got a mature ecosystem for free, at the cost of a heavier binary and a slower startup than Bun. Node.js is stuck defending its install base and shipping SEA (single-executable applications) as an afterthought. Bun is quietly converging on Deno's language choice for the parts that matter, while keeping Node's `require`-compatible ergonomics and its own speed edge — a middle position that's turning out to be strategically strong.

Community reaction on Hacker News (438 points on the linked thread) split predictably. The 'this validates Bun' camp pointed to Claude Code as the first genuinely mainstream CLI to use `bun build --compile` in anger. The skeptical camp asked whether Anthropic is now on the hook for tracking Bun's release cadence and any bugs in its packaging pipeline — a fair question, given Bun's willingness to ship breaking changes and its still-thin Windows story. Nobody had a great answer for what happens the first time a Bun regression breaks `claude` in production.

What this means for your stack

If you author or maintain a developer CLI, the argument for `bun build --compile` just got materially stronger. You can now point at a shipped, widely-used binary from a serious company as prior art, which is often the missing ingredient in the internal 'why are we picking a niche runtime' conversation. The workflow is genuinely one command: no pkg, no nexe, no fighting with Node's SEA APIs, no dragging along a 60MB Node binary. Cross-compilation to macOS-arm64, macOS-x64, Linux-x64, Linux-arm64 works out of the box; Windows is the weak spot, though it's improved sharply in the last two releases.

If you *consume* CLI tools, the practical implication is that `npm install -g` is on its way out for anything user-facing. Expect more tools to ship as `curl | sh` binaries in the next 12 months, and expect your `~/.local/bin` to grow. Version pinning gets easier (it's a file, not a global npm state); update discipline gets harder (there's no `npm outdated` for random binaries in your PATH). If you run a lot of Anthropic/OpenAI/Cursor-style CLIs, it's worth setting up a `mise` or `asdf`-style tool manager now rather than later.

For Bun users specifically: the Rust adoption inside Bun should reassure you rather than worry you. It means the maintainers are picking the best tool per problem instead of forcing everything through Zig, which reduces the long-term risk that a rarely-touched Zig library becomes an unmaintained bottleneck. It also means that if you contribute to Bun, you'll want Rust chops as well as Zig.

Looking ahead

The interesting question isn't whether Bun eats a chunk of Node's CLI market — it clearly will. The question is whether Node responds by making SEA a first-class product with real cross-compilation and startup work, or whether it doubles down on the server side and cedes the CLI bracket entirely. Node has done the latter before (see: front-end tooling, where esbuild and swc ate its lunch while it argued about `--experimental` flags). Claude Code isn't the reason for the shift, but it's the kind of adoption that turns a trend into a default. In 2027, 'what runtime is your CLI built on' will be a question you stop asking because everyone will have quietly moved.

Hacker News 583 pts 782 comments

Claude Code uses Bun written in Rust now

→ read on Hacker News

// share this

// get daily digest

Top 10 dev stories every morning at 8am UTC. AI-curated. Retro terminal HTML email.