Skip to content

Commands and flags

This page documents the user-facing command surface built by CommanderRoot, the Commander root setup function in the extracted cli.js.

Use Command-line reference for the canonical table of flags, subcommands, aliases, and mode surfaces. This page remains the narrative explanation of how those surfaces route runtime behavior.

Source anchors

Semantic aliasSource fileApproximate locationAnchorMeaning
CommanderRootcli.jsline ~19525, byte 0xdbf0e0async function w4ACommander root construction and mode routing.
ClaudeRootCommandcli.jsline ~19525, byte 0xdbf678H.name("claude")Root command name and description.
PrintModeFlagcli.jsline ~19525, byte 0xdbf921-p, --printSelects non-interactive print/headless mode.
ToolAllowListFlagcli.jsline ~19525, byte 0xdc09bd--allowedTools, --allowed-tools <tools...>Tool allow-list flag.
PermissionModeFlagcli.jsline ~19525, byte 0xdc10d9--permission-mode <mode>Session permission mode selector.
ContinueSessionFlagcli.jsline ~19525, byte 0xdc114e-c, --continueContinue the most recent conversation in the current directory.
ResumeSessionFlagcli.jsline ~19525, byte 0xdc11af-r, --resume [value]Resume by session ID or open picker/search.
AuthCommandFamilycli.jsline ~19550, byte 0xdcb973H.command("auth")Authentication command family.
McpCommandRegistrarcli.jsline ~9173, byte 0xbf3c40function rR4(H)mcp command-family registrar.
PluginCommandRegistrarcli.jsline ~9297, byte 0xbfca96function fC4(H)plugin/plugins command-family registrar.

Root command

The root command is named claude and describes itself as an interactive session by default, with -p/--print for non-interactive output. Its root action is the main decision point for:

  • headless/print versus interactive TUI;
  • JSON/text/stream output validation;
  • prompt/stdin ingestion;
  • session resume/continue/remote selection;
  • settings, MCP, plugins, tools, and agents loaded for the selected mode.

Root flag families

FamilyRepresentative flagsRuntime implication
Diagnostics--debug, --debug-file, --mcp-debug, --verboseEnables debug logging, specific log files, or deprecated MCP debug output.
Headless/SDK output-p, --print, --output-format, --input-format, --json-schema, --sdk-url, --include-partial-messages, --session-mirrorSelects the scriptable print/SDK path and result framing.
Thinking/budget--thinking, --thinking-display, --max-thinking-tokens, --max-turns, --max-budget-usd, --task-budgetControls thinking mode, turn limits, and spending/token budget constraints.
Tools/permissions--tools, --allowedTools, --disallowedTools, --permission-mode, --permission-prompt-tool, --dangerously-skip-permissionsShapes model-visible tools and approval behavior.
Prompt/context--system-prompt, --system-prompt-file, --append-system-prompt, --append-system-prompt-file, --add-dir, --exclude-dynamic-system-prompt-sections, --plan-mode-instructionsOverrides or extends system prompts and workspace context.
Sessions--continue, --resume, --fork-session, --no-session-persistence, --resume-session-at, --rewind-files, --session-id, --nameControls local transcript restore, session IDs, fork/rewind, and persistence.
Models/auth--model, --fallback-model, --betasSelects model aliases, fallback model behavior, and beta headers.
Settings/integrations--settings, --managed-settings, --setting-sources, --mcp-config, --strict-mcp-config, --plugin-dir, --plugin-url, --agents, --ide, --chrome, --fileAdds runtime settings, MCP/plugin/agent definitions, IDE/browser/file integrations.
Remote hidden paths--teleport, --remote, --remote-control, --rc, --remote-control-session-name-prefix, --prefill, --deep-link-originUsed by remote sessions, teleport, Remote Control, and deep-link launch flows.

Main command families

CommandAnchorRuntime role
mcpMcpCommandRegistrarManages MCP servers and starts the Claude Code MCP server.
plugin / pluginsPluginCommandRegistrarManages plugins, marketplaces, local/session plugins, and plugin capabilities.
authH.command("auth")login, status, and logout subcommands for authentication.
project purge [path]H.command("project")Deletes project-scoped Claude Code state.
setup-tokenH.command("setup-token")Sets up long-lived authentication token flow.
agentsH.command("agents")Opens/manages background agents and dispatched sessions.
ultrareview [target]H.command("ultrareview [target]")Runs cloud-hosted multi-agent code review.
auto-modeH.command("auto-mode")Inspects or critiques auto-mode classifier configuration.
remote-control / rcH.command("remote-control", {hidden: true}).alias("rc")Starts local-session Remote Control bridge.
doctorH.command("doctor")Checks auto-updater and related health state.
update / upgradeH.command("update").alias("upgrade")Checks for and installs updates.
install [target]H.command("install [target]")Installs a stable/latest/specific native build.

Parse-time optimization

CommanderRoot has a fast path for -p/--print: when the process is in print mode and no cc:// or cc+unix:// URI argument is present, it parses after root options are built and returns before registering heavier subcommands. This keeps common headless runs lighter.

Created and maintained by Yingting Huang.