|
1 | 1 | { |
2 | 2 | "source": "https://code.claude.com/docs/en/cli-reference.md", |
3 | | - "fetchedAt": "2026-05-18T12:35:00.301Z", |
4 | | - "commandCount": 25, |
5 | | - "flagCount": 64, |
| 3 | + "fetchedAt": "2026-06-08T13:09:24.510Z", |
| 4 | + "commandCount": 27, |
| 5 | + "flagCount": 66, |
6 | 6 | "commands": [ |
7 | 7 | { |
8 | 8 | "name": "cat file | claude -p \"query\"", |
|
41 | 41 | }, |
42 | 42 | { |
43 | 43 | "name": "claude agents", |
44 | | - "description": "Open [agent view](/en/agent-view) to monitor and dispatch parallel background sessions. Use `--cwd <path>` to show only sessions started under that directory", |
45 | | - "example": "`claude agents`" |
| 44 | + "description": "Open [agent view](/en/agent-view) to monitor and dispatch parallel background sessions. Use `--cwd <path>` to show only sessions started under that directory, or `--json` to print live sessions as a JSON array for scripting. Pass `--permission-mode`, `--model`, `--effort`, or `--agent` to set [defaults for dispatched sessions](/en/agent-view#permission-mode-model-and-effort). Accepts `--settings`, `--add-dir`, `--plugin-dir`, and `--mcp-config` like the top-level `claude` command. Opening agent view requires an interactive terminal", |
| 45 | + "example": "`claude agents --json`" |
46 | 46 | }, |
47 | 47 | { |
48 | 48 | "name": "claude attach <id>", |
|
69 | 69 | "description": "Print the built-in [auto mode](/en/permission-modes#eliminate-prompts-with-auto-mode) classifier rules as JSON. Use `claude auto-mode config` to see your effective config with settings applied", |
70 | 70 | "example": "`claude auto-mode defaults > rules.json`" |
71 | 71 | }, |
| 72 | + { |
| 73 | + "name": "claude daemon status", |
| 74 | + "description": "Print the background-session [supervisor's](/en/agent-view#the-supervisor-process) state, version, socket directory, and worker count for diagnostics. Exits 1 if the supervisor isn't running", |
| 75 | + "example": "`claude daemon status`" |
| 76 | + }, |
| 77 | + { |
| 78 | + "name": "claude daemon stop --any", |
| 79 | + "description": "Stop the background-session [supervisor](/en/agent-view#the-supervisor-process) and the sessions it hosts. Pass `--keep-workers` to leave background sessions running so the next supervisor reconnects to them. `--any` confirms stopping an on-demand supervisor, which is the default. Use this to recover from an [unresponsive supervisor](/en/agent-view#agent-view-says-the-background-service-did-not-respond)", |
| 80 | + "example": "`claude daemon stop --any --keep-workers`" |
| 81 | + }, |
72 | 82 | { |
73 | 83 | "name": "claude install [version]", |
74 | 84 | "description": "Install or reinstall the native binary. Accepts a version like `2.1.118`, or `stable` or `latest`. See [Install a specific version](/en/setup#install-a-specific-version)", |
|
101 | 111 | }, |
102 | 112 | { |
103 | 113 | "name": "claude respawn <id>", |
104 | | - "description": "Restart a stopped [background session](/en/agent-view#manage-sessions-from-the-shell) with its conversation intact. Use `--all` to restart every stopped session", |
| 114 | + "description": "Restart a [background session](/en/agent-view#manage-sessions-from-the-shell), running or stopped, with its conversation intact. Use `--all` to restart every running session, e.g. to pick up an updated Claude Code binary", |
105 | 115 | "example": "`claude respawn 7c5dcf5d`" |
106 | 116 | }, |
107 | 117 | { |
108 | 118 | "name": "claude rm <id>", |
109 | | - "description": "Remove a [background session](/en/agent-view#manage-sessions-from-the-shell) from the list", |
| 119 | + "description": "Remove a [background session](/en/agent-view#manage-sessions-from-the-shell) from the list. The conversation transcript stays on your local machine, available through `claude --resume`", |
110 | 120 | "example": "`claude rm 7c5dcf5d`" |
111 | 121 | }, |
112 | 122 | { |
|
178 | 188 | }, |
179 | 189 | { |
180 | 190 | "name": "--bg", |
181 | | - "description": "Start the session as a [background agent](/en/agent-view) and return immediately. Prints the session ID and management commands. Combine with `--agent` to run a specific subagent", |
| 191 | + "description": "Start the session as a [background agent](/en/agent-view) and return immediately. Prints the session ID and management commands. Combine with `--exec` to run a shell command as a background job instead of a Claude session, or with `--agent` to run a specific subagent", |
182 | 192 | "example": "`claude --bg \"investigate the flaky test\"`" |
183 | 193 | }, |
184 | 194 | { |
|
218 | 228 | }, |
219 | 229 | { |
220 | 230 | "name": "--disallowedTools", |
221 | | - "description": "Tools that are removed from the model's context and cannot be used", |
| 231 | + "description": "Deny rules. A bare tool name removes that tool from the model's context. A scoped rule such as `Bash(rm *)` leaves the tool available and denies only matching calls", |
222 | 232 | "example": "`\"Bash(git log *)\" \"Bash(git diff *)\" \"Edit\"`" |
223 | 233 | }, |
224 | 234 | { |
|
236 | 246 | "description": "Move per-machine sections from the system prompt (working directory, environment info, memory paths, git-repo flag) into the first user message. Improves prompt-cache reuse across different users and machines running the same task. Only applies with the default system prompt; ignored when `--system-prompt` or `--system-prompt-file` is set. Use with `-p` for scripted, multi-user workloads", |
237 | 247 | "example": "`claude -p --exclude-dynamic-system-prompt-sections \"query\"`" |
238 | 248 | }, |
| 249 | + { |
| 250 | + "name": "--exec", |
| 251 | + "description": "Run a shell command as a PTY-backed background job instead of starting a Claude session. Use with `--bg` to launch from the shell", |
| 252 | + "example": "`claude --bg --exec 'pytest -x'`" |
| 253 | + }, |
239 | 254 | { |
240 | 255 | "name": "--fallback-model", |
241 | | - "description": "Enable automatic fallback to specified model when default model is overloaded (print mode only)", |
| 256 | + "description": "Enable automatic fallback to a specified model when the default model is overloaded or not available, for example a retired model. Takes effect in print mode (`-p`) and in [background sessions](/en/agent-view), which run non-interactively; ignored in an interactive session", |
242 | 257 | "example": "`claude -p --fallback-model sonnet \"query\"`" |
243 | 258 | }, |
244 | 259 | { |
|
259 | 274 | { |
260 | 275 | "name": "--include-hook-events", |
261 | 276 | "description": "Include all hook lifecycle events in the output stream. Requires `--output-format stream-json`", |
262 | | - "example": "`claude -p --output-format stream-json --include-hook-events \"query\"`" |
| 277 | + "example": "`claude -p --output-format stream-json --verbose --include-hook-events \"query\"`" |
263 | 278 | }, |
264 | 279 | { |
265 | 280 | "name": "--include-partial-messages", |
266 | 281 | "description": "Include partial streaming events in output. Requires `--print` and `--output-format stream-json`", |
267 | | - "example": "`claude -p --output-format stream-json --include-partial-messages \"query\"`" |
| 282 | + "example": "`claude -p --output-format stream-json --verbose --include-partial-messages \"query\"`" |
268 | 283 | }, |
269 | 284 | { |
270 | 285 | "name": "--init", |
|
346 | 361 | "description": "Fetch a plugin `.zip` archive from a URL for this session only. Repeat the flag for multiple plugins, or pass space-separated URLs in a single quoted value", |
347 | 362 | "example": "`claude --plugin-url https://example.com/plugin.zip`" |
348 | 363 | }, |
| 364 | + { |
| 365 | + "name": "--prompt-suggestions", |
| 366 | + "description": "Emit a `prompt_suggestion` message after each turn with a predicted next user prompt. Requires `--print`, `--output-format stream-json`, and `--verbose`. See [Prompt suggestions](/en/interactive-mode#prompt-suggestions)", |
| 367 | + "example": "`claude -p --prompt-suggestions --output-format stream-json --verbose \"query\"`" |
| 368 | + }, |
349 | 369 | { |
350 | 370 | "name": "--remote", |
351 | 371 | "description": "Create a new [web session](/en/claude-code-on-the-web) on claude.ai with the provided task description", |
|
359 | 379 | { |
360 | 380 | "name": "--replay-user-messages", |
361 | 381 | "description": "Re-emit user messages from stdin back on stdout for acknowledgment. Requires `--input-format stream-json` and `--output-format stream-json`", |
362 | | - "example": "`claude -p --input-format stream-json --output-format stream-json --replay-user-messages`" |
| 382 | + "example": "`claude -p --input-format stream-json --output-format stream-json --verbose --replay-user-messages`" |
363 | 383 | }, |
364 | 384 | { |
365 | 385 | "name": "--session-id", |
|
438 | 458 | }, |
439 | 459 | { |
440 | 460 | "name": "`--resume`, `-r`", |
441 | | - "description": "Resume a specific session by ID or name, or show an interactive picker to choose a session. Includes sessions that added this directory with `/add-dir`", |
| 461 | + "description": "Resume a specific session by ID or name, or show an interactive picker to choose a session. Includes sessions that added this directory with `/add-dir`. As of v2.1.144, [background sessions](/en/agent-view) appear in the picker marked with `bg`", |
442 | 462 | "example": "`claude --resume auth-refactor`" |
443 | 463 | }, |
444 | 464 | { |
|
0 commit comments