Runtime lifecycle
This section documents package/Bun startup, command-line routing, runtime mode selection, and high-level session entry paths reconstructed from extracted Claude Code artifacts.
Source-anchor policy
This page is a section guide. Linked implementation pages carry concrete cli.js or Bun-graph anchors.
| Semantic alias | Minified anchor | Scope |
|---|---|---|
| Runtime lifecycle section | N/A — navigation page | Groups package bootstrap, root command routing, flags, subcommands, headless mode, and interactive mode. |
| Runtime implementation pages | See linked source-anchor tables | Concrete bundle anchors live in destination pages. |
Runtime map
flowchart TD Package[Package/native Bun executable] --> Bootstrap[Outer bootstrap] Bootstrap --> Main[Top-level main] Main --> Commander[Commander root] Commander --> Headless[Headless runner and control loop] Commander --> Interactive[Interactive session loop and picker] Commander --> Commands[mcp / plugin / auth / agents / doctor / update]Pages
| Order | Page | Runtime question answered |
|---|---|---|
| 1 | Package and Bun bootstrap | How does the npm/native/Bun module graph reach cli.js, and what else is embedded? |
| 2 | CLI main paths | How do outer bootstrap, top-level main, Commander root, headless, interactive, resume, remote, and MCP paths connect? |
| 3 | Commands and flags | Which root flags and top-level command families define the user-facing CLI surface? |
| 4 | Command-line reference | Which source-visible flags, subcommands, aliases, and mode-specific CLI surfaces exist? |
| 5 | Runtime lifecycle architecture | How is bootstrap → main → Commander composed, what is the public interface, and what design decisions drive mode dispatch and shutdown? |
Handoffs
- Prompt/context and model/provider state continue in Context and model loop.
- Tool and permission boundaries continue in Tools, integrations, and security.
- Resume, transcripts, remote, and Remote Control continue in Sessions, persistence, and remote.
Navigation
Created and maintained by Yingting Huang.