This repository has been archived on 2026-04-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
claude-code-2026-04-02/docs-site/docs/reference/cli-entry.md
2026-03-31 15:38:58 +05:00

962 B

CLI entry and parsing

Primary paths: src/main.tsx, src/cli/*, src/commands.ts

main.tsx registers the claude Commander program: global options (model, permissions, worktree, teammate flags, MCP, teleport, etc.), subcommands (MCP, plugins, agents, auth utilities), and a preAction hook that runs trust checks, settings load, telemetry initialization, prefetch (MCP URLs, referral, fast mode), and policy gates before any handler executes.

Side effects at module top intentionally run before other imports: startup profiler, MDM subprocess reads (utils/settings/mdm/rawRead.ts), and macOS keychain prefetch to overlap I/O with the rest of module evaluation.

Feature-gated dynamic require() loads coordinator/coordinatorMode.js when COORDINATOR_MODE is true in the Bun bundle, and assistant/ when KAIROS is true.

See also: CLI reference, Architecture.