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.
| Command | Status | What it does |
|---|---|---|
claude agents | Documented | Opens the agent view to watch and start background sessions, and -- prints the active sessions. |
claude attach <id|name> | Documented | Opens a background session. |
claude logs <id|name> | Documented | Prints the recent output of a background session. |
claude stop <id> (alias kill) | Documented | Stops a background session and keeps the conversation. |
claude respawn <id> or -- | Documented | Restarts a background session on the current binary. |
claude rm <id> | Documented | Deletes a background session and its worktree when that is safe. |
claude daemon [run|status|logs|stop|uninstall] | Documented | Controls the supervisor of background sessions, which the root help does not list. |
claude auth login|logout|status | Documented | Signs you in and out, and status exits with 1 when you are not signed in. |
claude setup- | Documented | Makes a long-lived token, and it needs a subscription. |
claude auto- | Documented | Shows or resets the rules of the auto mode classifier. |
claude doctor | Documented | Checks your setup and changes nothing. |
claude gateway -- | Documented | Runs the enterprise gateway. |
claude import [codex|gemini|cursor] | Documented | Imports the config of another agent, with -- and --. |
claude install [stable|latest|version] | Documented | Installs the native build, with --. |
claude update (alias upgrade) | Documented | Updates Claude Code. Package-manager installs update through the package manager. |
claude mcp ... | Documented | Manages MCP servers (see MCP). |
claude plugin ... (alias plugins) | Documented | Manages plugins (see Plugins). |
claude plugin test [dir] | Documented | Runs the tests of a mod. |
⚠️ claude purge [path] | Documented | Deletes the state of a project, with --, --, -, and -. |
claude remote- (alias rc) | Documented | Lets you control local sessions from claude. or the mobile app. |
claude ultrareview [target] | Documented | Starts a cloud review with many agents, with --, --, and --. |
claude self- | Documented | Runs cloud sessions on your machine, and the root help does not list it. |
claude sandbox | Undocumented | A hidden command, and the docs have no help for it. |
claude edit-, edit-, edit-, edit-, edit-, edit-, drop-, design- | Undocumented | Hidden commands that read one JSON edit from stdin with --, and their text says they serve the VS Code extension. |
claude import- | Undocumented | A hidden command that archives an export, with -- and --. |
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.
Related Pages
- CLI Overview
- All Flags
- Auto Mode covers the
claude auto-modecommands in depth.