add developer docs

This commit is contained in:
Osman Mehmood
2026-03-31 16:04:03 +05:00
parent 35408dd369
commit 51fa1eeca5
17 changed files with 468 additions and 46 deletions

View File

@@ -0,0 +1,26 @@
# 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')` — lazy `require` of `assistant/` (assistant / Agent SDKoriented paths).
- `feature('COORDINATOR_MODE')` — lazy `require` of `coordinator/coordinatorMode`.
- `feature('VOICE_MODE')` — conditional `useVoiceIntegration` in `REPL.tsx`.
## What `feature()` means here
In Anthropics 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** Anthropics bundler will not reproduce:
- The same dead-code elimination.
- The same `bun:bundle` API semantics.
- The same proprietary dependency closure.
That is one reason [Reproducibility and limits](../reproducibility.md) states you cannot rebuild the shipping binary from this mirror.
## See also
- [System design: layers](../system-design/layers.md)
- [CLI entry reference](../reference/cli-entry.md)