Skip to content

Commands and flags

This page reverse-engineers the user-facing command surface built by CommanderRoot, the Commander root setup function in the analyzed cli.renamed.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 aliasAnchorMeaning
CommanderRootasync function w4ACommander root construction and mode routing.
ClaudeRootCommandH.name("claude")Root command name and description.
PrintModeFlag-p, --printSelects non-interactive print/headless mode.
ToolAllowListFlag--allowedTools, --allowed-tools <tools...>Tool allow-list flag.
PermissionModeFlag--permission-mode <mode>Session permission mode selector.
ContinueSessionFlag-c, --continueContinue the most recent conversation in the current directory.
ResumeSessionFlag-r, --resume [value]Resume by session ID or open picker/search.
AuthCommandFamilyH.command("auth")Authentication command family.
McpCommandRegistrarfunction rR4(H)mcp command-family registrar.
PluginCommandRegistrarfunction fC4(H)plugin/plugins command-family registrar.

Bundle module in cli.renamed.js

Semantic aliasLoader lineRepresentative renamed exportsAtlas entry
PluginCommandHandlers644148pluginInstallHandler, pluginUninstallHandler, pluginListHandler, pluginInitHandler, pluginTagHandler, pluginPruneHandler, pluginValidateHandler, pluginUpdateHandlerBundle module map — integrations (MCP, plugins, MCPB, LSP)

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.