Skip to main content

Subcommands

A subcommand is a word after claude that starts a separate job, such as claude doctor. claude --help lists 18 commands. Several more work but the root help does not show them. Each command has its own --help.

Run claude <command>, or claude <command> --help for its options. Each command has its own flags. A command runs only when you call it.

Example​

claude --bg "run the full test suite" # prints a short id
claude agents # list background sessions
claude logs <id> # read recent output
claude stop <id> # stop it, keep the conversation

Commands​

Source: the text of claude <command> --help in 2.1.304.

CommandStatusWhat it does
claude agentsDocumentedOpens the agent view to watch and start background sessions, and --json prints the active sessions.
claude attach <id|name>DocumentedOpens a background session.
claude logs <id|name>DocumentedPrints the recent output of a background session.
claude stop <id> (alias kill)DocumentedStops a background session and keeps the conversation.
claude respawn <id> or --allDocumentedRestarts a background session on the current binary.
claude rm <id>DocumentedDeletes a background session and its worktree when that is safe.
claude daemon [run|status|logs|stop|uninstall]DocumentedControls the supervisor of background sessions, which the root help does not list.
claude auth login|logout|statusDocumentedSigns you in and out, and status exits with 1 when you are not signed in.
claude setup-tokenDocumentedMakes a long-lived token, and it needs a subscription.
claude auto-mode config|critique|defaults|resetDocumentedShows or resets the rules of the auto mode classifier.
claude doctorDocumentedChecks your setup and changes nothing.
claude gateway --config <yaml>DocumentedRuns the enterprise gateway.
claude import [codex|gemini|cursor]DocumentedImports the config of another agent, with --dry-run and --yes.
claude install [stable|latest|version]DocumentedInstalls the native build, with --force.
claude update (alias upgrade)DocumentedUpdates Claude Code. Package-manager installs update through the package manager.
claude mcp ...DocumentedManages MCP servers (see MCP).
claude plugin ... (alias plugins)DocumentedManages plugins (see Plugins).
claude plugin test [dir]DocumentedRuns the tests of a mod.
⚠️ claude purge [path]DocumentedDeletes the state of a project, with --all, --dry-run, -i, and -y.
claude remote-control (alias rc)DocumentedLets you control local sessions from claude.ai or the mobile app.
claude ultrareview [target]DocumentedStarts a cloud review with many agents, with --json, --post, and --timeout.
claude self-hosted-runnerDocumentedRuns cloud sessions on your machine, and the root help does not list it.
claude sandboxUndocumentedA hidden command, and the docs have no help for it.
claude edit-hook, edit-permission-rules, edit-memory-settings, edit-skill-overrides, edit-sandbox-settings, edit-chrome-settings, drop-worktree-registrations, design-loginUndocumentedHidden commands that read one JSON edit from stdin with --json, and their text says they serve the VS Code extension.
claude import-conversations <exportPath>UndocumentedA hidden command that archives an export, with --cwd and --dry-run.
Hidden Commands

The edit-* commands, drop-worktree-registrations, and design-login read one JSON edit from stdin. Their own text says they serve the VS Code extension. Do not build scripts on them.