Skip to content

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 aliasMinified anchorScope
Runtime lifecycle sectionN/A — navigation pageGroups package bootstrap, root command routing, flags, subcommands, headless mode, and interactive mode.
Runtime implementation pagesSee linked source-anchor tablesConcrete 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

OrderPageRuntime question answered
1Package and Bun bootstrapHow does the npm/native/Bun module graph reach cli.js, and what else is embedded?
2CLI main pathsHow do outer bootstrap, top-level main, Commander root, headless, interactive, resume, remote, and MCP paths connect?
3Commands and flagsWhich root flags and top-level command families define the user-facing CLI surface?
4Command-line referenceWhich source-visible flags, subcommands, aliases, and mode-specific CLI surfaces exist?
5Runtime lifecycle architectureHow is bootstrap → main → Commander composed, what is the public interface, and what design decisions drive mode dispatch and shutdown?

Handoffs

Created and maintained by Yingting Huang.