Generated: 2026-06-04 |
claude --versionto confirm installed version
claude [options] [command] [prompt]
Starts an interactive session by default.
Add -p / --print for non-interactive (pipe-friendly) output.
| Flag | Short | Description |
|---|---|---|
--add-dir <directories...> |
Additional directories to allow tool access to | |
--agent <agent> |
Agent for the current session (overrides agent setting) |
|
--agents <json> |
JSON object defining custom agents | |
--allow-dangerously-skip-permissions |
Make bypass-permissions mode available without enabling by default | |
--allowed-tools <tools...> |
--allowedTools |
Comma/space-separated list of tools to allow (e.g. "Bash(git *) Edit") |
--append-system-prompt <prompt> |
Append text to the default system prompt | |
--bare |
Minimal mode: skip hooks, LSP, plugin sync, auto-memory, etc. Sets CLAUDE_CODE_SIMPLE=1 |
|
--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 | |
--continue |
-c |
Continue the most recent conversation in the current directory |
--dangerously-skip-permissions |
Bypass all permission checks (sandboxes only) | |
--debug [filter] |
-d |
Debug mode with optional category filter (e.g. "api,hooks" or "!1p,!file") |
--debug-file <path> |
Write debug logs to a file (implicitly enables debug mode) | |
--disable-slash-commands |
Disable all skills | |
--disallowed-tools <tools...> |
--disallowedTools |
Comma/space-separated list of tools to deny |
--effort <level> |
Effort level: low | medium | high | xhigh | max |
|
--exclude-dynamic-system-prompt-sections |
Move per-machine sections to first user message (improves cross-user cache reuse) | |
--fallback-model <model> |
Comma-separated fallback model(s) when primary is overloaded (only with --print) |
|
--file <specs...> |
File resources at startup — format: file_id:relative_path |
|
--fork-session |
Create a new session ID instead of reusing original (use with --resume/--continue) |
|
--from-pr [value] |
Resume a session linked to a PR number/URL, or open interactive picker | |
--help |
-h |
Display help |
--ide |
Auto-connect to IDE on startup if exactly one valid IDE is available | |
--include-hook-events |
Include hook lifecycle events in output stream (requires --output-format=stream-json) |
|
--include-partial-messages |
Include partial message chunks as they arrive (requires --print + stream-json) |
|
--input-format <format> |
Input format (only with --print): text (default) | stream-json |
|
--json-schema <schema> |
JSON Schema for structured output validation | |
--max-budget-usd <amount> |
Maximum USD to spend on API calls (only with --print) |
|
--mcp-config <configs...> |
Load MCP servers from JSON files or strings | |
--mcp-debug |
(Deprecated — use --debug) Show MCP server errors |
|
--model <model> |
Model alias (sonnet, opus) or full name (claude-opus-4-8) |
|
--name <name> |
-n |
Display name for this session |
--no-chrome |
Disable Claude in Chrome integration | |
--no-session-persistence |
Don't save session to disk (only with --print) |
|
--output-format <format> |
Output format (only with --print): text | json | stream-json |
|
--permission-mode <mode> |
acceptEdits | auto | bypassPermissions | default | dontAsk | plan |
|
--plugin-dir <path> |
Load plugin from directory or .zip for this session (repeatable) |
|
--plugin-url <url> |
Fetch plugin .zip from URL for this session (repeatable) |
|
--print |
-p |
Print response and exit (non-interactive / pipe mode) |
--prompt-suggestions [value] |
Enable next-turn prompt suggestions (true/false/1/0/yes/no/on/off) |
|
--remote-control [name] |
Start interactive session with Remote Control enabled | |
--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 (requires stream-json I/O) |
|
--resume [value] |
-r |
Resume conversation by session ID, or open interactive picker |
--session-id <uuid> |
Use a specific UUID for the conversation | |
--setting-sources <sources> |
Comma-separated setting sources to load: user, project, local |
|
--settings <file-or-json> |
Path to settings JSON file or inline JSON string | |
--strict-mcp-config |
Only use MCP servers from --mcp-config, ignore all others |
|
--system-prompt <prompt> |
Override the system prompt for this session | |
--tmux |
Create a tmux session for the worktree (requires --worktree). Use --tmux=classic for traditional tmux |
|
--tools <tools...> |
Specify available built-in tools ("" = none, "default" = all, or list names) |
|
--verbose |
Override verbose mode from config | |
--version |
-v |
Output version number |
--worktree [name] |
-w |
Create a new git worktree for this session |
Manage background agents (opens an interactive agent view).
claude agents [options]
| Option | Description |
|---|---|
--add-dir <directory> |
Additional directory for dispatched sessions (repeatable) |
--agent <agent> |
Default agent for dispatched sessions |
--allow-dangerously-skip-permissions |
Make bypass-permissions available to dispatched sessions |
--cwd <path> |
Show only background sessions started under <path> |
--dangerously-skip-permissions |
Alias for --permission-mode bypassPermissions |
--effort <level> |
Default effort level for dispatched sessions |
--json |
Print live sessions as JSON array and exit |
--mcp-config <config> |
MCP config for dispatched sessions (repeatable) |
--model <model> |
Default model for dispatched sessions |
--permission-mode <mode> |
Default permission mode for dispatched sessions |
--plugin-dir <path> |
Load plugins for the agent view and dispatched sessions (repeatable) |
--setting-sources <sources> |
Setting sources: user, project, local |
--settings <file-or-json> |
Settings for the agent view and dispatched sessions |
--strict-mcp-config |
Only use --mcp-config servers in dispatched sessions |
Manage authentication.
claude auth <command>
claude auth login [options]
| Option | Description |
|---|---|
--claudeai |
Use Claude subscription (default) |
--console |
Use Anthropic Console (API billing) |
--email <email> |
Pre-populate email on the login page |
--sso |
Force SSO login flow |
claude auth logout
No options. Logs out from your Anthropic account.
claude auth status [options]
| Option | Description |
|---|---|
--json |
Output as JSON (default) |
--text |
Output as human-readable text |
Inspect auto mode classifier configuration.
claude auto-mode <command>
| Subcommand | Description |
|---|---|
config |
Print effective auto mode config as JSON |
defaults |
Print default allow/soft_deny/hard_deny rules as JSON |
critique [--model <model>] |
Get AI feedback on your custom auto mode rules |
Check the health of the Claude Code auto-updater.
claude doctor
No options. Note: workspace trust dialog is skipped; .mcp.json stdio servers are spawned for health checks — only run in trusted directories.
Install Claude Code native build.
claude install [options] [target]
[target]: stable | latest | specific version string
| Option | Description |
|---|---|
--force |
Force installation even if already installed |
Configure and manage MCP servers.
claude mcp <command>
claude mcp add [options] <name> <commandOrUrl> [args...]
| Option | Short | Description |
|---|---|---|
--callback-port <port> |
Fixed port for OAuth callback | |
--client-id <clientId> |
OAuth client ID for HTTP/SSE servers | |
--client-secret |
Prompt for OAuth client secret (or use MCP_CLIENT_SECRET env var) |
|
--env <env...> |
-e |
Set environment variables (e.g. -e KEY=value) |
--header <header...> |
-H |
Set WebSocket headers (e.g. -H "X-Api-Key: abc") |
--scope <scope> |
-s |
local (default) | user | project |
--transport <transport> |
-t |
stdio (default) | sse | http |
Examples:
# HTTP server
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
# HTTP server with auth header
claude mcp add --transport http myserver https://example.com/mcp --header "Authorization: Bearer TOKEN"
# stdio server with env vars
claude mcp add my-server -e API_KEY=xxx -- npx my-mcp-server
# stdio server with subprocess flags
claude mcp add my-server -- my-command --some-flag arg1claude mcp add-json [options] <name> <json>
| Option | Short | Description |
|---|---|---|
--client-secret |
Prompt for OAuth client secret | |
--scope <scope> |
-s |
local (default) | user | project |
claude mcp add-from-claude-desktop [options]
Mac and WSL only.
| Option | Short | Description |
|---|---|---|
--scope <scope> |
-s |
local (default) | user | project |
claude mcp remove [options] <name>
| Option | Short | Description |
|---|---|---|
--scope <scope> |
-s |
Scope to remove from; omit to remove from whichever scope it exists in |
claude mcp get <name>
Show details about an MCP server. Unapproved .mcp.json servers shown as ⏸ Pending.
claude mcp list
List configured MCP servers. Health-checks approved servers.
claude mcp reset-project-choices
Reset all approved/rejected project-scoped (.mcp.json) servers within this project.
claude mcp serve [options]
Start the Claude Code MCP server.
| Option | Short | Description |
|---|---|---|
--debug |
-d |
Enable debug mode |
--verbose |
Override verbose mode from config |
Manage Claude Code plugins.
claude plugin <command>
claude plugin install [options] <plugin>
Use plugin@marketplace to specify a marketplace.
| Option | Description |
|---|---|
--config <key=value> |
Set a userConfig option declared in the plugin manifest (repeatable) |
--scope <scope> |
user (default) | project | local |
claude plugin uninstall [options] <plugin>
| Option | Description |
|---|---|
--keep-data |
Preserve the plugin's persistent data directory |
--prune |
Also remove auto-installed dependencies no longer needed |
--scope <scope> |
user (default) | project | local |
--yes / -y |
Skip --prune confirmation prompt |
claude plugin update [options] <plugin>
Restart required to apply.
| Option | Description |
|---|---|
--scope <scope> |
user (default) | project | local | managed |
claude plugin enable [options] <plugin>
| Option | Description |
|---|---|
--scope <scope> |
user | project | local (default: auto-detect) |
claude plugin disable [options] [plugin]
| Option | Description |
|---|---|
--all / -a |
Disable all enabled plugins |
--scope <scope> |
user | project | local (default: auto-detect) |
claude plugin list [options]
| Option | Description |
|---|---|
--available |
Include available plugins from marketplaces (requires --json) |
--json |
Output as JSON |
claude plugin details <name>
Show a plugin's component inventory and projected token cost.
claude plugin init [options] <name>
Scaffolds to ~/.claude/skills/<name>/.
| Option | Description |
|---|---|
--author <name> |
Author name (default: git config user.name) |
--author-email <email> |
Author email (default: git config user.email) |
--description <text> |
Manifest description |
--force / -f |
Overwrite existing .claude-plugin/ at target |
--with <components...> |
Also scaffold: skills, agents, hooks, mcp, lsp, output-style, channel |
claude plugin validate [options] <path>
| Option | Description |
|---|---|
--strict |
Treat warnings as errors (exit 1) — use in CI |
claude plugin tag [options] [path]
Create a {name}--v{version} git tag for a plugin release.
| Option | Description |
|---|---|
--dry-run |
Print what would be tagged without creating it |
--force / -f |
Skip dirty-working-tree and tag-already-exists checks |
--message <msg> / -m |
Tag annotation message (use %s for the version) |
--push |
Push the tag to --remote after creating |
--remote <name> |
Remote to push to (default: origin) |
claude plugin prune [options]
Remove auto-installed dependencies no longer needed.
| Option | Description |
|---|---|
--dry-run |
List what would be removed without removing |
--scope <scope> |
user (default) | project | local |
--yes / -y |
Skip confirmation prompt |
claude plugin marketplace <command>
| Subcommand | Description |
|---|---|
add [options] <source> |
Add marketplace from URL, path, or GitHub repo |
list [--json] |
List all configured marketplaces |
remove|rm [options] <name> |
Remove a configured marketplace |
update [options] [name] |
Update marketplace(s) from source (all if no name given) |
marketplace add options:
| Option | Description |
|---|---|
--scope <scope> |
user (default) | project | local |
--sparse <paths...> |
Limit git checkout to specific dirs (for monorepos) |
marketplace remove options:
| Option | Description |
|---|---|
--scope <scope> |
Remove declaration from specific scope; omit to remove from every scope |
Manage Claude Code project state.
claude project <command>
claude project purge [options] [path]
Delete all Claude Code state for a project (transcripts, tasks, file history, config entry).
| Option | Description |
|---|---|
--all |
Purge state for every project (mutually exclusive with [path]) |
--dry-run |
List what would be deleted without deleting |
--interactive / -i |
Prompt for each item before deleting |
--yes / -y |
Skip confirmation prompt |
Set up a long-lived authentication token (requires Claude subscription).
claude setup-token
No options.
Run a cloud-hosted multi-agent code review of the current branch (or a PR).
claude ultrareview [options] [target]
[target]: PR number or base branch name.
| Option | Description |
|---|---|
--json |
Print raw bugs.json payload instead of formatted findings |
--timeout <minutes> |
Max minutes to wait for review (default: 30) |
Check for updates and install if available.
claude update
No options.
# Simple one-shot query
claude -p "What is 2+2?"
# JSON output
claude -p "List 3 fruits" --output-format json
# Streaming JSON
claude -p "Explain recursion" --output-format stream-json
# Pipe input
echo "Fix this code: $(cat bug.py)" | claude -p
# Structured output with schema
claude -p "Extract name and age" --json-schema '{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer"}}}'
# Cap spending
claude -p "Summarize this" --max-budget-usd 0.10
# Fallback model
claude -p "Hello" --fallback-model sonnet# Continue last session
claude -c
# Resume by ID
claude -r abc-123-def
# Resume and fork (new session ID)
claude -r abc-123-def --fork-session
# Named session
claude -n "Feature X"
# Resume PR-linked session
claude --from-pr 42claude --model opus
claude --model claude-sonnet-4-6
claude --effort max
claude --effort low -p "quick question"# Allow specific tools
claude --allowed-tools "Bash(git *) Edit Read"
# Deny tools
claude --disallowed-tools "Bash"
# Limit to specific tools
claude --tools "Bash,Edit,Read"
# Disable all tools
claude --tools ""
# Permission modes
claude --permission-mode acceptEdits # auto-accept file edits
claude --permission-mode plan # plan mode only
claude --permission-mode bypassPermissions # skip all prompts (sandboxes only)# Override system prompt
claude --system-prompt "You are a strict code reviewer."
# Append to default system prompt
claude --append-system-prompt "Always respond in Spanish."# Add stdio server
claude mcp add my-tool -e TOKEN=xxx -- npx @acme/mcp-server
# Add HTTP server
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
# List servers
claude mcp list
# Remove server
claude mcp remove my-tool
# Scope: project-level
claude mcp add my-tool -s project -- ./my-mcp# Install from marketplace
claude plugin install my-plugin
# Install at project scope
claude plugin install my-plugin -s project
# List installed plugins
claude plugin list
# List with marketplace availability
claude plugin list --json --available
# Update a plugin
claude plugin update my-plugin
# Disable all plugins
claude plugin disable --all
# Scaffold new plugin
claude plugin init my-plugin --with skills,hooks,mcp
# Validate before publishing
claude plugin validate ./my-plugin --strict
# Tag a release
claude plugin tag --push# New git worktree for this session
claude -w
# Named worktree
claude -w feature-x
# With tmux pane
claude -w feature-x --tmux
# Classic tmux
claude -w feature-x --tmux=classicclaude auth login # Claude subscription (default)
claude auth login --console # API billing
claude auth login --sso # Force SSO
claude auth status # JSON status
claude auth status --text # Human-readable
claude auth logout# Bare mode (no hooks, LSP, plugins, auto-memory, etc.)
claude --bare -p "quick task" \
--system-prompt "You are a helper" \
--add-dir /my/project \
--mcp-config ./mcp.json| Scope | Description |
|---|---|
user |
~/.claude/settings.json — applies everywhere |
project |
.claude/settings.json in the repo — shared with team |
local |
.claude/settings.local.json — machine-local, not committed |
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY |
API key for authentication (required in --bare mode) |
MCP_CLIENT_SECRET |
OAuth client secret for MCP servers |
CLAUDE_CODE_SIMPLE |
Set to 1 by --bare mode |