Skip to main content
reopt Handbook
reopt Handbook
Claude Code Command MasterLabels and command selectionHow to read a detail guideComplete command listTerminal CLI Commands and Flags

Task guides

Core command basicsStarting and resuming workSkills and Custom CommandsAutomation and Web CommandsOperations and Safety CommandsCustom commands and skillsMCP connections and commands

Conversation and context

Cmd. /add-dirCmd. /backgroundCmd. /compactCmd. /contextCmd. /copyCmd. /exportCmd. /forkCmd. /importCmd. /initCmd. /memoryCmd. /recapCmd. /renameCmd. /resumeCmd. /rewindCmd. claude purge

Planning and execution

Cmd. /autofix-prCmd. /batchCmd. /desktopCmd. /goalCmd. /loopCmd. /planCmd. /remote-envCmd. /scheduleCmd. /tasksCmd. /teleportCmd. /workflows

Review and verification

Cmd. /code-reviewCmd. /runCmd. /run-skill-generatorCmd. /security-reviewCmd. /simplifyCmd. /verify

Models and settings

Cmd. /claude-apiCmd. /configCmd. /effortCmd. /fastCmd. /modelCmd. /output-styleCmd. /update-config

Permissions and integrations

Cmd. /agentsCmd. /hooksCmd. /ideCmd. /mcpCmd. /permissionsCmd. /pluginCmd. /reload-pluginsCmd. /reload-skillsCmd. /sandboxCmd. /skillsCmd. /web-setup

Status and diagnostics

Cmd. /debugCmd. /diffCmd. /doctorCmd. /fewer-permission-promptsCmd. /release-notesCmd. /team-onboarding

Display and input

Cmd. /colorCmd. /focusCmd. /keybindingsCmd. /powerupCmd. /statuslineCmd. /terminal-setupCmd. /themeCmd. /tui

Account and usage

Cmd. /upgradeCmd. /usageCmd. /usage-credits

Legacy

Cmd. /costCmd. /pr-commentsCmd. /reviewCmd. /statsCmd. /ultrareviewCmd. /vimCmd. /approved-toolsCmd. /commandsCmd. /extra-usageCmd. /settingsCmd. /tagCmd. /todos

Verification and history

Current verification scopeHandbook updatesRelease coverage historyEarlier verification recordsCommand change history
Handbook›Claude Code Command Master›Terminal CLI Commands and Flags
한국어KOEnglishEN

Terminal CLI Commands and Flags

All 36 invocation forms and 80 common flags from the official Claude Code CLI reference, plus recent subcommand options

Written and reviewed by Eric Han · Co-founder & CTO, reopt

Key takeaways

  • Includes 36 invocation forms and 80 common flags.
  • Check plugin, runner, and system-prompt additions and constraints through v2.1.308.

Checked against the official CLI reference on 2026-10-23. The 36 rows are invocation forms, not distinct top-level commands. The 80 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

36 invocation forms

CommandUse
claudeStart 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 -cContinue the latest local conversation
claude -c -p "query"Continue in print mode
claude -r "<session>" "query"Resume by session ID or name
claude updateUpdate the installation
claude gatewayRun the administrator gateway with --config
claude install [version]Install a native version or channel
claude auth loginSign in; supports --email, --sso, and --console
claude auth logoutSign out
claude auth statusInspect authentication; --text for readable output
claude agentsMonitor and dispatch background sessions
claude attach <id|name>Attach to a background session; part of its name works on v2.1.290+
claude auto-mode defaultsInspect default classifier rules; filter with --label
claude auto-mode resetReset user autoMode settings; retain managed rules
claude daemon logsFollow the supervisor log (~/.claude/daemon.log) until Ctrl+C
claude daemon runRun the supervisor in the foreground of this terminal and print its log
claude daemon statusInspect the background supervisor
claude daemon stop --anyStop the supervisor; --keep-workers preserves workers
claude doctorRead-only installation and configuration diagnostics
claude import [source]Import another agent's configuration
claude logs <id|name>Read recent background output; part of its name works on v2.1.290+
claude mcpConfigure MCP servers
claude mcp login <name>Authenticate MCP OAuth; supports --no-browser
claude mcp logout <name>Clear MCP OAuth credentials
claude pluginManage plugins; alias: plugins
claude purge [path]Purge project records; preview with --dry-run. Named claude project purge before v2.1.288 (still works)
claude remote-controlRun 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-runnerRun cloud sessions on your infrastructure
claude setup-tokenGenerate 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

80 common flags

FlagUse and constraints
--add-dirAdditional directory access
--advisor <model>Advisor model
--agentSession agent
--agentsSubagent definitions as JSON
--allow-dangerously-skip-permissionsMake bypassPermissions selectable
--allowedTools, --allowed-toolsTool permission allow rules
--append-subagent-system-promptAppend text to subagent prompts
--append-subagent-system-prompt-fileAppend a file to subagent prompts; print mode
--append-system-promptAppend system-prompt text
--append-system-prompt-fileAppend a system-prompt file
--autocompact <auto|tokens>Session auto-compaction window
--ax-screen-readerScreen-reader rendering
--bareMinimal discovery mode
--betasAPI beta headers
--bg, --backgroundBackground execution
--channelsChannel notifications; preview
--chromeEnable Chrome integration
--cloudCreate or message a cloud session
--continue, -cContinue a local session
--dangerously-load-development-channelsDevelopment channel opt-in
--dangerously-skip-permissionsBypass permission prompts
--debugDebug output; filters use = syntax
--debug-file <path>Debug log file
--desktopOpen the current directory, or the session selected with --continue or --resume, in Claude Desktop and exit; macOS or x64 Windows, Claude subscription, v2.1.285+
--disable-slash-commandsDisable skills and commands
--disallowedTools, --disallowed-toolsTool permission deny rules
--effortReasoning effort
--enable-auto-modeRemoved in v2.1.111; use --permission-mode auto
--environment <environment-id>Self-hosted cloud environment ID
--exclude-dynamic-system-prompt-sectionsMove machine-specific prompt sections; print mode
--execShell job with --bg
--fallback-modelOrdered fallback models
--fork-sessionFork on resume
--forward-subagent-textInclude subagent text/thinking in the stream
--from-prFilter sessions by PR/MR
--ideAutomatic IDE connection
--initSetup init hook; print mode
--init-onlyRun initialization hooks and exit
--include-hook-eventsEmit hook lifecycle events
--include-partial-messagesPartial events; requires print and stream-json
--input-formatInput text/stream-json; print mode
--json-schemaResult JSON Schema; print mode
--maintenanceSetup maintenance hook; print mode
--max-budget-usdStop once estimated API spend reaches this amount (print mode, subagents included); spend can pass it, so leave headroom
--max-turnsAgent-turn cap; print mode
--mcp-configMCP JSON configuration
--modelSession model
--name, -nSession display name
--no-chromeDisable Chrome integration
--no-session-persistenceDisable session persistence; print mode
--output-formatOutput text/json/stream-json; print mode
--permission-modeInitial permission mode
--permission-prompt-toolMCP permission responder for headless runs
--permission-promptsPrint-mode permission responder: host/none
--plugin-dirLocal plugin path, zip, or parent folder
--plugin-urlSession plugin archive URL
--print, -pNon-interactive result output
--prompt-suggestionsPrompt suggestion events; print/stream-json/verbose
--ref <branch>Checkout ref with --environment
--remoteDeprecated alias of --cloud
--remote-control, --rcRemote Control for an interactive session
--remote-control-session-name-prefix <prefix>Generated remote-session name prefix
--replay-user-messagesReplay stream-json user messages
--restrictedRestricted evaluation profile
--resume, -rResume by ID, name, or transcript
--safe-modeTroubleshoot with customizations disabled
--session-idExplicit session UUID
--setting-sourcesSelect user/project/local setting sources
--settingsJSON file or inline setting overrides
--strict-mcp-configExplicit MCP config only; respect managed policy
--system-promptReplace the system prompt
--system-prompt-fileReplace the system prompt from a file
--system-prompt-snapshotUse off to rebuild prompts on each request
--teleportResume a cloud session locally
--teammate-modeTeammate display mode
--tmuxWorktree tmux session; requires --worktree
--toolsLimit available built-in tools
--verboseVerbose execution output
--version, -vInstalled version
--worktree, -wIsolated Git worktree

Subcommands and recent options

CommandOptions and distinctions
claude auto-mode configEffective 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 evalJSON/HTML evaluation reports
claude self-hosted-runner setupOperator setup walkthrough
claude self-hosted-runner doctorDeployed runner diagnostics
claude self-hosted-runner orchestratorOn-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+)
--system-prompt + --system-prompt-file / --append-system-prompt + --append-system-prompt-fileThe text and -file forms can be combined; the file's text comes first (v2.1.283+)
claude -p --agents <path.json>Accepts a JSON file path as well as inline JSON, and allows an empty prompt (v2.1.281+)
claude plugin configure <plugin>Show a plugin's options and which are unset; --values-stdin saves values read from stdin (v2.1.285+)
claude plugin install --config <server>.<key>=<value>Set a bundled .mcpb MCP server's own settings at install time (v2.1.285+)
claude plugin install --marketplace <source>Add the marketplace if needed, then install; same policy checks as claude plugin marketplace add (v2.1.292+)
claude --resume <id> "prompt"When the session is running in the background, opens it and sends the prompt as its next turn (v2.1.285+)

--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

CommandAdditional options and scope
claude agentsFilter 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 daemon <subcommand>claude --dangerously-skip-permissions daemon <subcommand> runs the subcommand, so it works when claude is aliased to include the flag. Only a leading --dangerously-skip-permissions or --allow-dangerously-skip-permissions is handled this way; with any other flag ahead of daemon, the subcommand does not run.
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 purge [path]--dry-run, -i / --interactive, -y / --yes, --all; preview first. Named claude project purge before v2.1.288; the older name still works.
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 json

The -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. From v2.1.286, --bare connects only the MCP servers named on the command line, sends no system reminders, starts no background tasks, and stops a shell command that reaches its timeout instead of moving it to the background.

Sources

  • CLI reference
  • Changelog
  • Plugin CLI reference

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. The cap is checked against the client-side cost estimate, not your bill, and the official CLI reference notes that spend can pass the cap, so leave headroom.

Related docs

Headless and CI/CD

Claude Code Complete Guide · Run Claude Code in non-interactive workflows with clear inputs, outputs, and guardrails.

Hooks

Claude Code Complete Guide · Use Claude Code hooks for predictable automation and repository guardrails.

Automation and Web Commands

Commands for Claude Code on the web, PR automation, routines, Agent View background sessions, Desktop, and remote control.

Subagents

Claude Code Complete Guide · Delegate bounded work while keeping the main Claude Code session accountable.

Operations and Safety Commands

Commands for permission control, MCP, plugins, cleanup, sandboxing, and troubleshooting.

Complete command list

Syntax, type, availability, and guide links for all 119 entries in the official Claude Code slash table.

Core command basics

Read help and session status, start a fresh conversation, and exit or detach from Claude Code.

On this page

36 invocation forms80 common flagsSubcommands and recent optionsCommand-specific operating optionsExamplesSourcesStream and budget details