Terminal CLI Commands and Flags
All 34 invocation forms and 79 common flags from the official Claude Code CLI reference, plus recent subcommand options
Key takeaways
- Includes 34 invocation forms and 79 common flags.
- Check plugin/runner additions and constraints through v2.1.278.
Checked against the official CLI reference on September 22, 2026. The 34 rows are invocation forms, not distinct top-level commands. The 79 common flags include removed/deprecated entries. Use each command’s --help and the linked official reference for specialized options.
All slash commands · Official CLI reference
34 invocation forms
| Command | Use |
|---|---|
claude | Start a conversation |
claude "query" | Start with an initial request |
claude -p "query" | Print a result and exit |
cat file | claude -p "query" | Process piped input |
claude -c | Continue the latest local conversation |
claude -c -p "query" | Continue in print mode |
claude -r "<session>" "query" | Resume by session ID or name |
claude update | Update the installation |
claude gateway | Run the administrator gateway with --config |
claude install [version] | Install a native version or channel |
claude auth login | Sign in; supports --email, --sso, and --console |
claude auth logout | Sign out |
claude auth status | Inspect authentication; --text for readable output |
claude agents | Monitor and dispatch background sessions |
claude attach <id> | Attach to a background session |
claude auto-mode defaults | Inspect default classifier rules; filter with --label |
claude auto-mode reset | Reset user autoMode settings; retain managed rules |
claude daemon status | Inspect the background supervisor |
claude daemon stop --any | Stop the supervisor; --keep-workers preserves workers |
claude doctor | Read-only installation and configuration diagnostics |
claude import [source] | Import another agent's configuration |
claude logs <id> | Read recent background output |
claude mcp | Configure MCP servers |
claude mcp login <name> | Authenticate MCP OAuth; supports --no-browser |
claude mcp logout <name> | Clear MCP OAuth credentials |
claude plugin | Manage plugins; alias: plugins |
claude project purge [path] | Purge project records; preview with --dry-run |
claude remote-control | Run a Remote Control server without a local TUI |
claude respawn <id> | Restart a background session with its conversation |
claude rm <id> | Remove background entries/worktrees; retain transcripts |
claude self-hosted-runner | Run cloud sessions on your infrastructure |
claude setup-token | Generate an OAuth token for CI |
claude stop <id> | Stop a background session; alias: kill |
claude ultrareview [target] | Run a cloud review; supports --json and --timeout |
79 common flags
| Flag | Use and constraints |
|---|---|
--add-dir | Additional directory access |
--advisor <model> | Advisor model |
--agent | Session agent |
--agents | Subagent definitions as JSON |
--allow-dangerously-skip-permissions | Make bypassPermissions selectable |
--allowedTools, --allowed-tools | Tool permission allow rules |
--append-subagent-system-prompt | Append text to subagent prompts |
--append-subagent-system-prompt-file | Append a file to subagent prompts; print mode |
--append-system-prompt | Append system-prompt text |
--append-system-prompt-file | Append a system-prompt file |
--autocompact <auto|tokens> | Session auto-compaction window |
--ax-screen-reader | Screen-reader rendering |
--bare | Minimal discovery mode |
--betas | API beta headers |
--bg, --background | Background execution |
--channels | Channel notifications; preview |
--chrome | Enable Chrome integration |
--cloud | Create or message a cloud session |
--continue, -c | Continue a local session |
--dangerously-load-development-channels | Development channel opt-in |
--dangerously-skip-permissions | Bypass permission prompts |
--debug | Debug output; filters use = syntax |
--debug-file <path> | Debug log file |
--disable-slash-commands | Disable skills and commands |
--disallowedTools, --disallowed-tools | Tool permission deny rules |
--effort | Reasoning effort |
--enable-auto-mode | Removed in v2.1.111; use --permission-mode auto |
--environment <environment-id> | Self-hosted cloud environment ID |
--exclude-dynamic-system-prompt-sections | Move machine-specific prompt sections; print mode |
--exec | Shell job with --bg |
--fallback-model | Ordered fallback models |
--fork-session | Fork on resume |
--forward-subagent-text | Include subagent text/thinking in the stream |
--from-pr | Filter sessions by PR/MR |
--ide | Automatic IDE connection |
--init | Setup init hook; print mode |
--init-only | Run initialization hooks and exit |
--include-hook-events | Emit hook lifecycle events |
--include-partial-messages | Partial events; requires print and stream-json |
--input-format | Input text/stream-json; print mode |
--json-schema | Result JSON Schema; print mode |
--maintenance | Setup maintenance hook; print mode |
--max-budget-usd | API spend cap including subagents; print mode |
--max-turns | Agent-turn cap; print mode |
--mcp-config | MCP JSON configuration |
--model | Session model |
--name, -n | Session display name |
--no-chrome | Disable Chrome integration |
--no-session-persistence | Disable session persistence; print mode |
--output-format | Output text/json/stream-json; print mode |
--permission-mode | Initial permission mode |
--permission-prompt-tool | MCP permission responder for headless runs |
--permission-prompts | Print-mode permission responder: host/none |
--plugin-dir | Local plugin path, zip, or parent folder |
--plugin-url | Session plugin archive URL |
--print, -p | Non-interactive result output |
--prompt-suggestions | Prompt suggestion events; print/stream-json/verbose |
--ref <branch> | Checkout ref with --environment |
--remote | Deprecated alias of --cloud |
--remote-control, --rc | Remote Control for an interactive session |
--remote-control-session-name-prefix <prefix> | Generated remote-session name prefix |
--replay-user-messages | Replay stream-json user messages |
--restricted | Restricted evaluation profile |
--resume, -r | Resume by ID, name, or transcript |
--safe-mode | Troubleshoot with customizations disabled |
--session-id | Explicit session UUID |
--setting-sources | Select user/project/local setting sources |
--settings | JSON file or inline setting overrides |
--strict-mcp-config | Explicit MCP config only; respect managed policy |
--system-prompt | Replace the system prompt |
--system-prompt-file | Replace the system prompt from a file |
--system-prompt-snapshot | Use off to rebuild prompts on each request |
--teleport | Resume a cloud session locally |
--teammate-mode | Teammate display mode |
--tmux | Worktree tmux session; requires --worktree |
--tools | Limit available built-in tools |
--verbose | Verbose execution output |
--version, -v | Installed version |
--worktree, -w | Isolated Git worktree |
Subcommands and recent options
| Command | Options and distinctions |
|---|---|
claude auto-mode config | Effective classifier configuration |
claude plugin install / claude plugin update | --json, --accept-command <sha256> (v2.1.271+) |
/plugin install <plugin> --marketplace <source> | Offer marketplace registration (v2.1.275+) |
claude plugin eval | JSON/HTML evaluation reports |
claude self-hosted-runner setup | Operator setup walkthrough |
claude self-hosted-runner doctor | Deployed runner diagnostics |
claude self-hosted-runner orchestrator | On-demand runner orchestration |
claude self-hosted-runner --drain-marker-file <path> | Report host drain on SIGTERM when the file exists; telemetry only (v2.1.271+) |
--accept-command takes the SHA-256 shown by the preceding --json run. Review that command before accepting its exact hash; it is not a blanket -y approval.
Command-specific operating options
| Command | Additional options and scope |
|---|---|
claude agents | Filter with --cwd <path>; --json --all includes completed sessions. Dispatch defaults: --permission-mode, --model, --effort, --agent. |
claude auto-mode reset | -y / --yes skips confirmation of the user-settings reset; managed rules remain. |
claude respawn <id> | --all restarts every running background session. |
claude rm <id> | After inspecting the refusal, use its exact --discard-unpushed <commit>@<worktree-id> or --force-remove-worktree <worktree-id> value. The former also discards unpushed commits. |
claude project purge [path] | --dry-run, -i / --interactive, -y / --yes, --all; preview first. |
claude ultrareview [target] | --json, --timeout <minutes> (default 45), --post / --no-post (default). --post publishes a comment on a github.com PR using your account. |
Examples
claude --version
claude auth status --text
claude doctor
claude import cursor --dry-run
claude auto-mode config
claude -p "Explain this repository" --max-turns 3 --output-format jsonThe -p example invokes a model. /doctor is an in-session skill that can apply fixes; claude doctor is read-only. --allowedTools controls approval rules; --tools limits availability. --bare and --safe-mode have different discovery and troubleshooting purposes.
Sources
Stream and budget details
With --forward-subagent-text, parent_tool_use_id identifies the originating Agent or Skill call. Forwarding agents spawned by forked skills, and nested forked skills, requires v2.1.275 or later.
--max-budget-usd includes subagent spend, but excludes prior-run totals restored through --continue or --resume from the current run's cap.