Skip to main content
The claude command starts an interactive session by default. Pass a prompt as an argument to send a single message, or use -p / --print for non-interactive pipeline usage.

Global flags

-p, --print
boolean
Print the response to stdout and exit immediately. Skips the workspace trust dialog. Only use this flag in directories you trust.
--model <model>
string
Model to use for the current session. Accepts a short alias (e.g. sonnet, opus) or a full model ID (e.g. claude-sonnet-4-6).
-d, --debug [filter]
string | boolean
Enable debug mode. Optionally pass a comma-separated category filter (e.g. "api,hooks" or "!1p,!file" to exclude categories).
--verbose
boolean
Override the verbose mode setting from config.
--permission-mode <mode>
string
Permission mode for the session. Choices: default, acceptEdits, bypassPermissions, dontAsk, plan.
--dangerously-skip-permissions
boolean
Bypass all permission checks. Recommended only for sandboxes with no internet access.
--settings <file-or-json>
string
Path to a settings JSON file, or a JSON string, to load additional settings from.
-r, --resume [session-id]
string | boolean
Resume a conversation. Provide a session ID to resume directly, or omit the value to open an interactive picker. Optionally pass a search term to pre-filter the picker.
-c, --continue
boolean
Continue the most recent conversation in the current directory.
--max-turns <turns>
number
Maximum number of agentic turns in non-interactive mode. Causes an early exit after the specified number of turns. Only works with --print.
--output-format <format>
string
Output format. Only works with --print. Choices:
  • text (default) — plain text
  • json — single JSON result
  • stream-json — realtime streaming JSON
--input-format <format>
string
Input format. Only works with --print. Choices:
  • text (default) — plain text
  • stream-json — realtime streaming JSON input
--add-dir <directories...>
string[]
Additional directories to allow tool access to.
--allowedTools, --allowed-tools <tools...>
string[]
Comma- or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit").
--disallowedTools, --disallowed-tools <tools...>
string[]
Comma- or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit").
--mcp-config <configs...>
string[]
Load MCP servers from JSON files or inline JSON strings (space-separated).
-n, --name <name>
string
Set a display name for this session (shown in /resume and the terminal title).
--plugin-dir <path>
string
Load plugins from a directory for this session only. Repeatable: --plugin-dir A --plugin-dir B.
--system-prompt <prompt>
string
System prompt to use for the session.
--append-system-prompt <prompt>
string
Append text to the default system prompt.
--no-session-persistence
boolean
Disable session persistence — sessions will not be saved to disk and cannot be resumed. Only works with --print.
--fallback-model <model>
string
Enable automatic fallback to the specified model when the default model is overloaded. Only works with --print.
--effort <level>
string
Effort level for the session. Choices: low, medium, high, max.
--bare
boolean
Minimal mode: skips hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and CLAUDE.md auto-discovery. Sets CLAUDE_CODE_SIMPLE=1. Auth is strictly ANTHROPIC_API_KEY or apiKeyHelper via --settings.

Usage examples

Subcommands

Subcommands for auth, doctor, and others follow the same help flag convention: use -h or --help to see their options.