1.3 KiB
1.3 KiB
Bun bundle and feature flags
The shipping Claude Code CLI is built with Bun and internal bun:bundle integration. In the recovered source, src/main.tsx uses compile-time feature gates such as:
feature('KAIROS')— lazyrequireofassistant/(assistant / Agent SDK–oriented paths).feature('COORDINATOR_MODE')— lazyrequireofcoordinator/coordinatorMode.feature('VOICE_MODE')— conditionaluseVoiceIntegrationinREPL.tsx.
What feature() means here
In Anthropic’s pipeline, feature('…') is almost certainly a constant resolved at bundle time: dead branches are stripped from the published cli.js. The reconstruction contains all branches as TypeScript, so you can read “internal” code paths that might not ship in every npm artifact.
Implications for “building from source”
A normal tsc or bun build without Anthropic’s bundler will not reproduce:
- The same dead-code elimination.
- The same
bun:bundleAPI semantics. - The same proprietary dependency closure.
That is one reason Reproducibility and limits states you cannot rebuild the shipping binary from this mirror.