Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 56 additions & 26 deletions catalog/cli-reference.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"source": "https://code.claude.com/docs/en/cli-reference.md",
"fetchedAt": "2026-05-18T12:35:00.301Z",
"commandCount": 25,
"flagCount": 64,
"fetchedAt": "2026-06-15T15:17:32.236Z",
"commandCount": 27,
"flagCount": 68,
"commands": [
{
"name": "cat file | claude -p \"query\"",
Expand Down Expand Up @@ -41,8 +41,8 @@
},
{
"name": "claude agents",
"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",
"example": "`claude agents`"
"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 active sessions as a JSON array for scripting (`--json --all` also includes completed background sessions). 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",
"example": "`claude agents --json`"
},
{
"name": "claude attach <id>",
Expand All @@ -69,6 +69,16 @@
"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",
"example": "`claude auto-mode defaults > rules.json`"
},
{
"name": "claude daemon status",
"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",
"example": "`claude daemon status`"
},
{
"name": "claude daemon stop --any",
"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)",
"example": "`claude daemon stop --any --keep-workers`"
},
{
"name": "claude install [version]",
"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)",
Expand Down Expand Up @@ -101,12 +111,12 @@
},
{
"name": "claude respawn <id>",
"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",
"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",
"example": "`claude respawn 7c5dcf5d`"
},
{
"name": "claude rm <id>",
"description": "Remove a [background session](/en/agent-view#manage-sessions-from-the-shell) from the list",
"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`",
"example": "`claude rm 7c5dcf5d`"
},
{
Expand Down Expand Up @@ -136,6 +146,11 @@
"description": "Add additional working directories for Claude to read and edit files. Grants file access; most `.claude/` configuration is [not discovered](/en/permissions#additional-directories-grant-file-access-not-configuration) from these directories. Validates each path exists as a directory. To persist these directories across sessions, set [`permissions.additionalDirectories`](/en/settings#permission-settings) in settings",
"example": "`claude --add-dir ../apps ../lib`"
},
{
"name": "--advisor <model>",
"description": "{/* min-version: 2.1.98 */}Enable the server-side [advisor tool](/en/advisor) for this session with a model alias: `opus`, `sonnet`, or `fable` ({/* min-version: 2.1.170 */}v2.1.170+), or a full model ID. Takes precedence over the `advisorModel` setting for the session. Requires Claude Code v2.1.98 or later",
"example": "`claude --advisor opus`"
},
{
"name": "--agent",
"description": "Specify an agent for the current session (overrides the `agent` setting)",
Expand All @@ -151,11 +166,6 @@
"description": "Add `bypassPermissions` to the `Shift+Tab` mode cycle without starting in it. Lets you begin in a different mode like `plan` and switch to `bypassPermissions` later. See [permission modes](/en/permission-modes#skip-all-checks-with-bypasspermissions-mode)",
"example": "`claude --permission-mode plan --allow-dangerously-skip-permissions`"
},
{
"name": "--allowedTools",
"description": "Tools that execute without prompting for permission. See [permission rule syntax](/en/settings#permission-rule-syntax) for pattern matching. To restrict which tools are available, use `--tools` instead",
"example": "`\"Bash(git log *)\" \"Bash(git diff *)\" \"Read\"`"
},
{
"name": "--append-system-prompt",
"description": "Append custom text to the end of the default system prompt",
Expand All @@ -178,7 +188,7 @@
},
{
"name": "--bg",
"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",
"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",
"example": "`claude --bg \"investigate the flaky test\"`"
},
{
Expand Down Expand Up @@ -216,11 +226,6 @@
"description": "Disable all skills and commands for this session",
"example": "`claude --disable-slash-commands`"
},
{
"name": "--disallowedTools",
"description": "Tools that are removed from the model's context and cannot be used",
"example": "`\"Bash(git log *)\" \"Bash(git diff *)\" \"Edit\"`"
},
{
"name": "--effort",
"description": "Set the [effort level](/en/model-config#adjust-effort-level) for the current session. Options: `low`, `medium`, `high`, `xhigh`, `max`; available levels depend on the model. Overrides the [`effortLevel`](/en/settings#available-settings) setting for this session and does not persist",
Expand All @@ -236,10 +241,15 @@
"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",
"example": "`claude -p --exclude-dynamic-system-prompt-sections \"query\"`"
},
{
"name": "--exec",
"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",
"example": "`claude --bg --exec 'pytest -x'`"
},
{
"name": "--fallback-model",
"description": "Enable automatic fallback to specified model when default model is overloaded (print mode only)",
"example": "`claude -p --fallback-model sonnet \"query\"`"
"description": "Enable automatic fallback to the specified model(s) when the primary model is overloaded or not available, for example a retired model. Accepts a comma-separated list tried in order. See [Fallback model chains](/en/model-config#fallback-model-chains). To persist a chain across sessions, use the [`fallbackModel` setting](/en/settings#available-settings), which this flag overrides",
"example": "`claude --fallback-model sonnet,haiku`"
},
{
"name": "--fork-session",
Expand All @@ -259,12 +269,12 @@
{
"name": "--include-hook-events",
"description": "Include all hook lifecycle events in the output stream. Requires `--output-format stream-json`",
"example": "`claude -p --output-format stream-json --include-hook-events \"query\"`"
"example": "`claude -p --output-format stream-json --verbose --include-hook-events \"query\"`"
},
{
"name": "--include-partial-messages",
"description": "Include partial streaming events in output. Requires `--print` and `--output-format stream-json`",
"example": "`claude -p --output-format stream-json --include-partial-messages \"query\"`"
"example": "`claude -p --output-format stream-json --verbose --include-partial-messages \"query\"`"
},
{
"name": "--init",
Expand Down Expand Up @@ -308,7 +318,7 @@
},
{
"name": "--model",
"description": "Sets the model for the current session with an alias for the latest model (`sonnet` or `opus`) or a model's full name. Overrides the [`model`](/en/settings#available-settings) setting and [`ANTHROPIC_MODEL`](/en/model-config#environment-variables)",
"description": "Sets the model for the current session with an alias for the latest model (`sonnet`, `opus`, `haiku`, or `fable`) or a model's full name. Overrides the [`model`](/en/settings#available-settings) setting and [`ANTHROPIC_MODEL`](/en/model-config#environment-variables)",
"example": "`claude --model claude-sonnet-4-6`"
},
{
Expand Down Expand Up @@ -346,6 +356,11 @@
"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",
"example": "`claude --plugin-url https://example.com/plugin.zip`"
},
{
"name": "--prompt-suggestions",
"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)",
"example": "`claude -p --prompt-suggestions --output-format stream-json --verbose \"query\"`"
},
{
"name": "--remote",
"description": "Create a new [web session](/en/claude-code-on-the-web) on claude.ai with the provided task description",
Expand All @@ -359,7 +374,12 @@
{
"name": "--replay-user-messages",
"description": "Re-emit user messages from stdin back on stdout for acknowledgment. Requires `--input-format stream-json` and `--output-format stream-json`",
"example": "`claude -p --input-format stream-json --output-format stream-json --replay-user-messages`"
"example": "`claude -p --input-format stream-json --output-format stream-json --verbose --replay-user-messages`"
},
{
"name": "--safe-mode",
"description": "{/* min-version: 2.1.169 */}Start with all customizations disabled to troubleshoot a broken configuration: CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, custom keybindings, status line and file-suggestion commands, LSP servers, and auto-memory do not load. Authentication, model selection, built-in tools, and permissions work normally, which differs from [`--bare`](/en/headless#start-faster-with-bare-mode). Managed settings policy still applies, including policy-configured hooks, status line, and file-suggestion commands; managed plugins, managed skills, managed CLAUDE.md, and policy-configured MCP servers do not. Useful for checking whether a customization is what triggers [automatic fallback from Fable 5](/en/model-config#automatic-model-fallback). Sets [`CLAUDE_CODE_SAFE_MODE`](/en/env-vars)",
"example": "`claude --safe-mode`"
},
{
"name": "--session-id",
Expand Down Expand Up @@ -408,19 +428,29 @@
},
{
"name": "--tools",
"description": "Restrict which built-in tools Claude can use. Use `\"\"` to disable all, `\"default\"` for all, or tool names like `\"Bash,Edit,Read\"`",
"description": "Restrict which built-in tools Claude can use. Use `\"\"` to disable all, `\"default\"` for all, or tool names like `\"Bash,Edit,Read\"`. MCP tools are not affected; to deny those too, use `--disallowedTools \"mcp__*\"`, or pass `--strict-mcp-config` without `--mcp-config` so no MCP servers load",
"example": "`claude --tools \"Bash,Edit,Read\"`"
},
{
"name": "--verbose",
"description": "Enable verbose logging, shows full turn-by-turn output. Overrides the [`viewMode`](/en/settings#available-settings) setting for this session",
"example": "`claude --verbose`"
},
{
"name": "`--allowedTools`, `--allowed-tools`",
"description": "Tools that execute without prompting for permission. See [permission rule syntax](/en/settings#permission-rule-syntax) for pattern matching. To restrict which tools are available, use `--tools` instead",
"example": "`\"Bash(git log *)\" \"Bash(git diff *)\" \"Read\"`"
},
{
"name": "`--continue`, `-c`",
"description": "Load the most recent conversation in the current directory. Includes sessions that added this directory with `/add-dir`",
"example": "`claude --continue`"
},
{
"name": "`--disallowedTools`, `--disallowed-tools`",
"description": "Deny rules. A bare tool name removes the matching tools from the model's context: `\"Edit\"` removes Edit, `\"*\"` removes every tool, and `\"mcp__*\"` removes every MCP tool. A scoped rule such as `Bash(rm *)` leaves the tool available and denies only matching calls",
"example": "`\"Bash(git log *)\" \"Bash(git diff *)\" \"Edit\"`"
},
{
"name": "`--name`, `-n`",
"description": "Set a display name for the session, shown in `/resume` and the terminal title. You can resume a named session with `claude --resume <name>`. <br /><br />[`/rename`](/en/commands) changes the name mid-session and also shows it on the prompt bar",
Expand All @@ -438,7 +468,7 @@
},
{
"name": "`--resume`, `-r`",
"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`",
"description": "Resume a specific session by ID or name, or show an interactive picker to choose a session. The picker and name search include sessions that added this directory with `/add-dir`; passing a session ID searches only the current project directory and its git worktrees. As of v2.1.144, [background sessions](/en/agent-view) appear in the picker marked with `bg`",
"example": "`claude --resume auth-refactor`"
},
{
Expand Down
Loading