中文 | English
Why is Claude Code not just an interactive REPL? Why does it also support print mode, MCP serve, direct connect, bridge, and other runtime surfaces?
l1-startupl12-repl-ui
main.tsxcli/print.tsreplLauncher.tsxsetup.tsbridge/bridgeMain.ts
runHeadlesslaunchReplmcp serveCLAUDE_CODE_ENTRYPOINTbridgeMain
- how one core system is wrapped into multiple entry surfaces
- why some capabilities make more sense in REPL while others fit headless/print
- why bridge behaves more like a long-lived session service than a one-shot CLI command
main.tsx: entry detection for--print,mcp serve, connect/ssh/assistant, and other early argv rewritesreplLauncher.tsx: interactive REPL launch wrappersetup.ts:86-92: messaging server and bare/simple mode differencesbridge/bridgeMain.ts:1980:export async function bridgeMain
Claude Code’s core behavior is not bound to the REPL. It is consumed by multiple runtime surfaces. Once you understand this, it becomes clearer why so much initialization logic lives in main.tsx and setup.ts instead of being hardcoded into the REPL screen.
- Why is
--printnot just a quiet version of the REPL? - What is fundamentally different about a long-lived mode like
bridgeMainversus a normal one-shot CLI run? - If you added a new runtime entrypoint, which files would you expect to change first?