Usage: claude [options] [command] [prompt]
Claude Code - starts an interactive session by default, use -p/--print for
non-interactive output
Arguments:
prompt Your prompt
Options:
--add-dir <directories...> Additional directories to allow tool
access to
--agent <agent> Agent for the current session. Overrides
the 'agent' setting.
--agents <json-or-file> JSON object defining custom agents, or
with --print the path to a file that
holds one (e.g. '{"reviewer":
{"description": "Reviews code",
"prompt": "You are a code reviewer"}}')
--allow-dangerously-skip-permissions Enable bypassing all permission checks
as an option, without it being enabled
by default. Recommended only for
sandboxes with no internet access.
--allowedTools, --allowed-tools <tools...>
Comma or space-separated list of tool names to allow (e.g. "Bash(git *)
Edit")
--append-system-prompt <prompt> Append a system prompt to the default
system prompt
--autocompact <auto|tokens> Auto-compact window size (auto, or
100k–1M tokens)
--ax-screen-reader Render screen-reader friendly output
(flat text, no decorative borders or
animations).
--bg, --background Start the session in the background and
return immediately. Prints the id that
`claude attach`, `logs`, `stop` and `rm`
take; `claude agents` lists them. With
--resume <session-id>, continues that
session in the background under the same
ID, or starts a copy and says so when
the session is already running
--bare Minimal mode: skip hooks (those defined
in settings and by installed plugins;
features built into Claude Code are
unaffected), LSP, plugin sync,
attribution, auto-memory, background
prefetches, keychain reads, and
CLAUDE.md auto-discovery. Sets
CLAUDE_CODE_SIMPLE=1. Anthropic auth is
strictly ANTHROPIC_API_KEY or
apiKeyHelper via --settings (OAuth and
keychain are never read). 3P providers
(Bedrock/Vertex/Foundry) use their own
credentials. Skills still resolve via
/skill-name. Explicitly provide context
via: --system-prompt[-file],
--append-system-prompt[-file], --add-dir
(CLAUDE.md dirs), --mcp-config,
--settings, --agents, --plugin-dir.
--betas <betas...> Beta headers to include in API requests
(API key users only)
--brief Enable SendUserMessage tool for
agent-to-user communication
--chrome Enable Claude in Chrome integration
--cloud [description|session_id|url] Create a cloud session with the given
description, or attach to an existing
one by session ID or claude.ai/code URL
-c, --continue Continue the most recent conversation in
the current directory
--dangerously-skip-permissions Bypass all permission checks.
Recommended only for sandboxes with no
internet access.
-d, --debug [filter] Enable debug mode with optional category
filtering (e.g., --debug=hooks,mcp or
--debug='!hooks,!mcp')
--debug-file <path> Write debug logs to a specific file path
(implicitly enables debug mode)
--desktop Open in the Claude Desktop app instead
of the terminal (with --continue or
--resume <id> to pick the session)
--disable-slash-commands Disable all skills and commands
--disallowedTools, --disallowed-tools <tools...>
Comma or space-separated list of tool names to deny (e.g. "Bash(git *)
Edit")
--effort <level> Effort level for the current session
(low, medium, high, xhigh, max)
--environment <environment_id> Create a new cloud session that runs on
the given self-hosted environment
(ccpool_...).
--exclude-dynamic-system-prompt-sections
Move per-machine sections (cwd, env info, memory paths, git status) from
the system prompt into the first user message. Improves cross-user
prompt-cache reuse. Only applies with the default system prompt (ignored
with --system-prompt). (default: false)
--fallback-model <model> Enable automatic fallback to specified
model(s) when the default model is
overloaded or not available. Accepts a
comma-separated list to try each in
order. Re-tries the primary at the start
of each user turn.
--file <specs...> File resources to download at startup.
Format: file_id:relative_path (e.g.,
--file file_abc:doc.txt
file_def:img.png)
--fork-session When resuming, create a new session ID
instead of reusing the original (use
with --resume or --continue)
--forward-subagent-text Forward subagent text and thinking
blocks as assistant/user messages with
parent_tool_use_id set (only works with
--print and --output-format=stream-json)
--from-pr [value] Resume a session linked to a PR by PR
number/URL, or open interactive picker
with optional search term
-h, --help Display help for command
--ide Automatically connect to IDE on startup
if exactly one valid IDE is available
--include-hook-events Include all hook lifecycle events in the
output stream (only works with
--output-format=stream-json)
--include-partial-messages Include partial message chunks as they
arrive (only works with --print and
--output-format=stream-json)
--input-format <format> Input format (only works with --print):
"text" (default), or "stream-json"
(realtime streaming input) (choices:
"text", "stream-json")
--json-schema <schema> JSON Schema for structured output
validation (only works with --print).
Example:
{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}
--max-budget-usd <amount> Maximum dollar amount to spend on API
calls (only works with --print)
--mcp-config <configs...> Load MCP servers from JSON files or
strings (space-separated)
--model <model> Model for the current session. Provide
an alias for the latest model (e.g.
'fable', 'opus', or 'sonnet') or a
model's full name.
-n, --name <name> Set a display name for this session
(shown in the prompt box, /resume
picker, and terminal title)
--no-chrome Disable Claude in Chrome integration
--no-session-persistence Disable session persistence - sessions
will not be saved to disk and cannot be
resumed (only works with --print)
--output-format <format> Output format (only works with --print):
"text" (default), "json" (single
result), or "stream-json" (realtime
streaming) (choices: "text", "json",
"stream-json")
--permission-mode <mode> Permission mode to use for the session
(choices: "acceptEdits", "auto",
"bypassPermissions", "manual",
"dontAsk", "plan")
--permission-prompts <target> Who answers permission prompts with
--print: "host" (the SDK host or
--permission-prompt-tool) or "none"
(nobody: anything that would prompt is
denied automatically; the permission
mode still decides everything else)
(choices: "host", "none", default:
"host")
--plugin-dir <path> Load a plugin from a directory or .zip
for this session only; a folder of
plugins loads each child (repeatable:
--plugin-dir A --plugin-dir B.zip)
(default: [])
--plugin-url <url> Fetch a plugin .zip from a URL for this
session only (repeatable: --plugin-url A
--plugin-url B) (default: [])
-p, --print Print response and exit (useful for
pipes). Note: The workspace trust dialog
is skipped when Claude is run in
non-interactive mode (via -p, or when
stdout is not a TTY, e.g. piped or
redirected output). Only use this in
directories you trust. Settings files
that fail validation are silently
ignored in this mode (no error dialog is
shown).
--prompt-suggestions [value] Enable prompt suggestions. In print/SDK
mode, emits a prompt_suggestion message
after each turn with a predicted next
user prompt (choices: "true", "false",
"1", "0", "yes", "no", "on", "off",
preset: "true")
--remote-control [name] Start an interactive session with Remote
Control enabled (optionally named)
--remote-control-session-name-prefix <prefix>
Prefix for auto-generated Remote Control session names (default: hostname)
--replay-user-messages Re-emit user messages from stdin back on
stdout for acknowledgment (only works
with --input-format=stream-json and
--output-format=stream-json)
--restricted Restricted mode: removes the built-in
tools that run commands or code (Bash,
PowerShell and the other code-running
tools) and WebFetch unless --tools names
them, and ignores user, project and
local settings files (managed settings
and --settings still apply; add
--strict-mcp-config to skip MCP servers
too). Also confines the file tools to
the working directories (--add-dir
included), refuses bypassPermissions,
and lets only a person or the configured
permission handler approve writes to
settings, git and tool-configuration
files.
-r, --resume [value] Resume a conversation by session ID or
name, or open interactive picker with
optional search term
--safe-mode Start with all customizations
(CLAUDE.md, skills, installed plugins,
hooks, MCP servers, custom commands and
agents, output styles, workflows, custom
themes, keybindings, and more) disabled
— useful for troubleshooting a broken
configuration. Admin-managed (policy)
settings still apply. Auth, model
selection, built-in tools and plugins,
and permissions work normally. Sets
CLAUDE_CODE_SAFE_MODE=1.
--session-id <uuid> Use a specific session ID for the
conversation (must be a valid UUID)
--setting-sources <sources> Comma-separated list of setting sources
to load (user, project, local).
--settings <file-or-json> Path to a settings JSON file or a JSON
string to load additional settings from
--strict-mcp-config Only use MCP servers from --mcp-config,
ignoring all other MCP configurations
--system-prompt <prompt> System prompt to use for the session
--system-prompt-snapshot <on|off> Record the system prompt once per
conversation and reuse it verbatim on
every request and resume. on (the
default, except under --bare outside
cloud and background sessions): the
prompt is rendered on the conversation's
first request — a --system-prompt or
--append-system-prompt included — sent,
and recorded; every later request and
resume sends the record as-is, even when
a later launch passes different text,
until the conversation is compacted.
off: never record; the prompt is
rendered fresh every request (for
iterating on prompt text). (choices:
"on", "off")
--teleport [session] Resume a teleport session, optionally
specify session ID
--tmux Create a tmux session for the worktree
(requires --worktree). Uses iTerm2
native panes when available; use
--tmux=classic for traditional tmux.
--tools <tools...> Specify the list of available tools from
the built-in set. Use "" to disable all
tools, "default" to use the default set,
or specify tool names (e.g.
"Bash,Edit,Read").
--verbose Override verbose mode setting from
config
-v, --version Output the version number
-w, --worktree [name] Create a new git worktree for this
session (optionally specify a name)
Commands:
agents [options] Manage background agents
attach <id|name> Open a background session in this
terminal. <id> is the short id that
`claude --bg` prints and `claude agents`
lists. Part of the session name works
too
auth Manage authentication
auto-mode Inspect or reset auto mode configuration
doctor Check the health of your Claude Code
installation. Reads settings files in
the current directory without a trust
prompt. For a full checkup that can also
fix issues, run /doctor in a session.
gateway [options] Run the enterprise auth/telemetry
gateway
import [options] [source] Import config from another AI coding
agent into Claude Code
install [options] [target] Install Claude Code native build. Use
[target] to specify version (stable,
latest, or specific version)
logs <id|name> Print a background session's recent
terminal output
mcp Configure and manage MCP servers
plugin|plugins Manage Claude Code plugins
purge [options] [path] Delete a project's Claude Code data
(transcripts, tasks, file history, and
its entry in ~/.claude.json) from this
computer only
respawn [options] [id] Restart a background session, or all of
them with --all, so it runs the current
Claude Code version
rm <id> Delete a background session, and its
worktree when that is safe. Works on
sessions that have already exited
setup-token Set up a long-lived authentication token
(requires Claude subscription)
stop|kill <id> Stop a background session. Its
conversation is kept: `claude attach
<id>` opens it again, `claude --resume`
works once it is stopped
ultrareview [options] [target] Run a cloud-hosted multi-agent code
review of the current branch (or a PR
number / base branch) and print the
findings
update|upgrade Check for updates and install if
available; package-manager installs
update through the package manager
Options (66)
| Option | Description | Source |
|---|
--add-dir directories... | Additional directories to allow tool access to | help |
--agent agent | Agent for the current session. | help |
--agents json-or-file | JSON object defining custom agents, or with --print the path to a file that holds one (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}') | help |
--allow-dangerously-skip-permissions | Enable bypassing all permission checks as an option, without it being enabled by default. | help |
--allowedTools, --allowed-tools tools... | Comma or space-separated list of tool names to allow (e.g. "Bash(git *) Edit") | help |
--append-system-prompt prompt | Append a system prompt to the default system prompt | help |
--autocompact auto|tokens | Auto-compact window size (auto, or 100k–1M tokens) | help |
--ax-screen-reader | Render screen-reader friendly output (flat text, no decorative borders or animations). | help |
--bg, --background | Start the session in the background and return immediately. | help |
--bare | Minimal mode: skip hooks (those defined in settings and by installed plugins; | help |
--betas betas... | Beta headers to include in API requests (API key users only) | help |
--brief | Enable SendUserMessage tool for agent-to-user communication | help |
--chrome | Enable Claude in Chrome integration | help |
--cloud description|session_id|url | Create a cloud session with the given description, or attach to an existing one by session ID or claude.ai/code URL | help |
-c, --continue | Continue the most recent conversation in the current directory | help |
--dangerously-skip-permissions | Bypass all permission checks. | help |
-d, --debug filter | Enable debug mode with optional category filtering (e.g., --debug=hooks,mcp or | help |
--debug-file path | Write debug logs to a specific file path (implicitly enables debug mode) | help |
--desktop | Open in the Claude Desktop app instead of the terminal (with --continue or | help |
--disable-slash-commands | Disable all skills and commands | help |
--disallowedTools, --disallowed-tools tools... | Comma or space-separated list of tool names to deny (e.g. "Bash(git *) Edit") | help |
--effort level | Effort level for the current session (low, medium, high, xhigh, max) | help |
--environment environment_id | Create a new cloud session that runs on the given self-hosted environment (ccpool_...). | help |
--exclude-dynamic-system-prompt-sections | Move per-machine sections (cwd, env info, memory paths, git status) from the system prompt into the first user message. | help |
--fallback-model model | Enable automatic fallback to specified model(s) when the default model is overloaded or not available. | help |
--file specs... | File resources to download at startup. | help |
--fork-session | When resuming, create a new session ID instead of reusing the original (use with --resume or --continue) | help |
--forward-subagent-text | Forward subagent text and thinking blocks as assistant/user messages with parent_tool_use_id set (only works with | help |
--from-pr value | Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term | help |
-h, --help | Display help for command | help |
--ide | Automatically connect to IDE on startup if exactly one valid IDE is available | help |
--include-hook-events | Include all hook lifecycle events in the output stream (only works with | help |
--include-partial-messages | Include partial message chunks as they arrive (only works with --print and | help |
--input-format format | Input format (only works with --print): "text" (default), or "stream-json" (realtime streaming input) (choices: "text", "stream-json") | help |
--json-schema schema | JSON Schema for structured output validation (only works with --print). | help |
--max-budget-usd amount | Maximum dollar amount to spend on API calls (only works with --print) | help |
--mcp-config configs... | Load MCP servers from JSON files or strings (space-separated) | help |
--model model | Model for the current session. | help |
-n, --name name | Set a display name for this session (shown in the prompt box, /resume picker, and terminal title) | help |
--no-chrome | Disable Claude in Chrome integration | help |
--no-session-persistence | Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print) | help |
--output-format format | Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming) (choices: "text", "json", "stream-json") | help |
--permission-mode mode | Permission mode to use for the session (choices: "acceptEdits", "auto", "bypassPermissions", "manual", "dontAsk", "plan") | help |
--permission-prompts target | Who answers permission prompts with | help |
--plugin-dir path | Load a plugin from a directory or .zip for this session only; | help |
--plugin-url url | Fetch a plugin .zip from a URL for this session only (repeatable: --plugin-url A | help |
-p, --print | Print response and exit (useful for pipes). | help |
--prompt-suggestions value | Enable prompt suggestions. | help |
--remote-control name | Start an interactive session with Remote Control enabled (optionally named) | help |
--remote-control-session-name-prefix prefix | Prefix for auto-generated Remote Control session names (default: hostname) | help |
--replay-user-messages | Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and | help |
--restricted | Restricted mode: removes the built-in tools that run commands or code (Bash, PowerShell and the other code-running tools) and WebFetch unless --tools names them, and ignores user, project and local… | help |
-r, --resume value | Resume a conversation by session ID or name, or open interactive picker with optional search term | help |
--safe-mode | Start with all customizations (CLAUDE.md, skills, installed plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, keybindings, and more) disabled —… | help |
--session-id uuid | Use a specific session ID for the conversation (must be a valid UUID) | help |
--setting-sources sources | Comma-separated list of setting sources to load (user, project, local). | help |
--settings file-or-json | Path to a settings JSON file or a JSON string to load additional settings from | help |
--strict-mcp-config | Only use MCP servers from --mcp-config, ignoring all other MCP configurations | help |
--system-prompt prompt | System prompt to use for the session | help |
--system-prompt-snapshot on|off | Record the system prompt once per conversation and reuse it verbatim on every request and resume. | help |
--teleport session | Resume a teleport session, optionally specify session ID | help |
--tmux | Create a tmux session for the worktree (requires --worktree). | help |
--tools tools... | Specify the list of available tools from the built-in set. | help |
--verbose | Override verbose mode setting from config | help |
-v, --version | Output the version number | help |
-w, --worktree name | Create a new git worktree for this session (optionally specify a name) | help |
Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.