Build System & Dead Code Elimination
Overview
Claude Code uses Bun for building with a sophisticated dead code elimination (DCE) system. The binary size matters - we need to exclude internal features from external builds.
Plain text
Shared from "Claude-Code" on Inkdown
Claude Code uses Bun for building with a sophisticated dead code elimination (DCE) system. The binary size matters - we need to exclude internal features from external builds.
| File/Directory | Purpose |
|---|---|
package.json | Dependencies, scripts |
tsconfig.json | TypeScript config |
build.ts | Custom build script |
bun.build | Bun bundler config |
features.ts | Feature flag definitions |
macros/ | Bun macro definitions |
Claude Code has internal-only features (assistant mode, bridge, daemon). We don't want these in public builds:
feature() Worksfeature(), MACRO.* evaluated at compile, not runtimerequire() inside if (feature()) vanishes when false