Skip to main content

Claude Code Commands (100+): The Reference

100+ current Claude Code commands: slash commands, skills, workflows, CLI subcommands, flags, shortcuts, and environment variables in one reference.

FHFinn Hillebrandt
AI Programming
Claude Code Commands (100+): The Reference
Links marked with * are affiliate links. If a purchase is made through such links, we receive a commission.

You're sitting at the terminal, have Claude Code installed, and you're thinking: "Okay, now what?"

I know that feeling well. When I first typed claude, the tool felt like a black hole. There are now well over 100 documented command entries once you count built-ins, skills, workflows, and aliases.

This is the current Claude Code command landscape: built-in slash commands, bundled skills and workflows, CLI subcommands, flags, and keyboard shortcuts. Not every command appears for every account because platform, plan, and provider matter. For how Claude Code stacks up against OpenAI Codex, see our Claude Code vs. OpenAI Codex comparison.

TL;DRKey Takeaways
  • The official reference documents well over 100 command entries. This page separates built-ins, 13 bundled skills, the Deep Research workflow, and retired commands.
  • Key shortcuts are Ctrl+G or Ctrl+X Ctrl+E for the external editor, Ctrl+O for Transcript Viewer, Option+P or Alt+P for model selection, and Shift+Tab for permission modes.
  • CLI flags and environment variables control reasoning effort, context size, background agents, cloud sessions, worktrees, MCP, and privacy. --dangerously-skip-permissions belongs only in isolated environments.

I cross-checked the tables against Anthropic's official command reference, CLI reference, interactive-mode documentation, and installation guide. The documentation changes frequently, so retired commands are listed separately.

Installing and Starting Claude Code

# Recommended native installation on macOS, Linux, and WSL
curl -fsSL https://claude.ai/install.sh | bash

# Native installation in Windows PowerShell
irm https://claude.ai/install.ps1 | iex

# Verify the installation
claude --version

# Start Claude Code
claude                          # Interactive mode
claude "Fix the bug in auth"    # With initial prompt
claude -p "Analyze this code"   # One-time query without session
claude -c                       # Continue last session

Slash Commands (Built-in)

These commands are your daily tools when working with Claude Code. Type / followed by any letters to filter. Not all commands are visible to every user, some depend on platform, plan, or environment.

Version badges show the earliest version Anthropic explicitly documents in its reference, changelog, or releases. Not documented means the current reference lists the command but gives no reliable introduction version.

Command/add-dir
Parameter<path>
Since versionv2.0.11
DescriptionGive the current session access to an additional working directory.
Command/advisor
Parameter[model|off]
Since versionNot documented
DescriptionEnable or disable Advisor, which consults a second model at key moments.
Command/agents
Parameter
Since versionv1.0.58
DescriptionOpen guidance for managing subagents through Claude or .claude/agents/ files.
Command/artifacts
Parameter
Since versionv2.1.208
DescriptionList personal or shared artifacts and attach one to the session.
Command/auto-mode-setup
Parameter
Since versionv2.1.228
DescriptionDraft Auto mode settings from the project and prior sessions.
Command/autocompact
Parameter[auto|<tokens>]
Since versionv2.1.221
DescriptionSet how full the context window can become before automatic compaction.
Command/autofix-pr
Parameter[prompt]
Since versionNot documented
DescriptionStart a web session that can watch a pull request and push CI or review fixes.
Command/background
Parameter[prompt]
Since versionNot documented
DescriptionDetach the current session as a background agent. Alias: /bg.
Command/branch
Parameter[name]
Since versionv2.1.77
DescriptionCreate a conversation branch and switch to it without losing the original.
Command/btw
Parameter[question]
Since versionv2.0.0
DescriptionAnswer a side question outside the conversation context.
Command/bug
Parameter[report]
Since versionNot documented
DescriptionReport a bug or share the session after consent. Alias: /share.
Command/cd
Parameter<path>
Since versionv2.1.169
DescriptionChange working directory while retaining the conversation and prompt cache.
Command/chrome
Parameter
Since versionv2.0.72
DescriptionOpen Claude in Chrome settings.
Command/clear
Parameter[name]
Since versionv0.2.9
DescriptionStart a new conversation without context. Aliases: /reset and /new.
Command/color
Parameter[color|default]
Since versionv2.1.70
DescriptionSet the prompt-bar color.
Command/compact
Parameter[instructions]
Since versionv0.2.47
DescriptionSummarize the conversation to free context.
Command/config
Parameter[key=value ...]
Since versionv0.2.34
DescriptionOpen settings or set values directly. Alias: /settings.
Command/context
Parameter[all]
Since versionv2.1.14
DescriptionShow what occupies the context window, including optimization suggestions.
Command/copy
Parameter[N]
Since versionv0.2.9
DescriptionCopy the latest or Nth-most-recent response to the clipboard.
Command/cost
Parameter
Since versionv1.0.85
DescriptionAlias for /usage.
Command/design-login
Parameter
Since versionNot documented
DescriptionAuthorize access to Claude Design for /design-sync.
Command/desktop
Parameter
Since versionv2.0.51
DescriptionContinue the session in the Claude Code desktop app. Alias: /app.
Command/diff
Parameter
Since versionv2.0.0
DescriptionOpen the interactive diff viewer for uncommitted and turn-level changes.
Command/effort
Parameter[level|auto|status]
Since versionv2.1.76
DescriptionChoose reasoning effort. Available levels depend on the model and can include low through xhigh, max, and ultracode.
Command/exit
Parameter
Since versionv0.2.9
DescriptionExit the CLI or detach an attached background session. Alias: /quit.
Command/export
Parameter[filename]
Since versionv0.2.9
DescriptionExport the current conversation as plain text.
Command/fast
Parameter[on|off]
Since versionv2.1.36
DescriptionToggle Fast mode when the account supports it.
Command/feedback
Parameter[report]
Since versionv0.2.9
DescriptionOpen the same feedback dialog as /bug.
Command/focus
Parameter
Since versionNot documented
DescriptionSwitch to the reduced focus view in the fullscreen renderer.
Command/fork
Parameter[prompt]
Since versionv2.0.0
DescriptionCopy the conversation into a new background session.
Command/goal
Parameter[condition|clear]
Since versionNot documented
DescriptionSet a goal that Claude continues pursuing across turns.
Command/heapdump
Parameter
Since versionNot documented
DescriptionWrite diagnostics for memory issues. This hidden command can contain sensitive data.
Command/help
Parameter
Since versionv0.2.9
DescriptionShow help and the commands available in this session.
Command/hooks
Parameter
Since versionv1.0.38
DescriptionShow hook configurations.
Command/ide
Parameter
Since versionv2.0.0
DescriptionManage IDE integrations and display their status.
Command/import
Parameter[codex|gemini] [--dry-run] [--yes]
Since versionv2.1.213
DescriptionImport configuration from Codex or Gemini CLI, including rules, MCP servers, and skills.
Command/init
Parameter
Since versionv0.2.9
DescriptionCreate project guidance in CLAUDE.md.
Command/insights
Parameter
Since versionv2.1.14
DescriptionGenerate an HTML report about local Claude Code sessions and usage patterns.
Command/install-github-app
Parameter
Since versionv1.0.0
DescriptionSet up the Claude GitHub App for a repository.
Command/install-slack-app
Parameter
Since versionv2.0.51
DescriptionInstall the Claude Slack app through browser sign-in.
Command/keybindings
Parameter
Since versionv2.1.18
DescriptionOpen the file for customizable keyboard shortcuts.
Command/list-agents
Parameter
Since versionv2.1.224
DescriptionList reachable subagents, teammates, and sessions. Alias: /peers.
Command/login
Parameter
Since versionv0.2.96
DescriptionSign in to Anthropic.
Command/logout
Parameter
Since versionv0.2.96
DescriptionSign out of the Anthropic account.
Command/mcp
Parameter[reconnect|enable|disable]
Since versionv0.2.50
DescriptionManage MCP connections and OAuth sign-ins.
Command/memory
Parameter
Since versionv1.0.94
DescriptionEdit CLAUDE.md files and automatic memory.
Command/mobile
Parameter
Since versionv2.0.51
DescriptionShow a QR code for the Claude mobile app. Aliases: /ios and /android.
Command/model
Parameter[model]
Since versionv0.2.9
DescriptionSwitch models and save the choice for new sessions.
Command/passes
Parameter
Since versionv2.0.58
DescriptionShare a free Claude Code week when the account is eligible.
Command/permissions
Parameter
Since versionv2.0.67
DescriptionManage allowed, prompted, and denied tool rules. Alias: /allowed-tools.
Command/plan
Parameter[description]
Since versionv2.1.0
DescriptionEnter plan mode and optionally start with a task.
Command/plugin
Parameter[subcommand]
Since versionv2.0.12
DescriptionManage plugins, for example list, install, enable, and disable.
Command/powerup
Parameter
Since versionv2.1.90
DescriptionOpen interactive mini-lessons about Claude Code features.
Command/privacy-settings
Parameter
Since versionv2.0.51
DescriptionOpen privacy settings for Pro and Max subscribers.
Command/radio
Parameter
Since versionNot documented
DescriptionOpen Claude FM in the browser when the command is available for the provider.
Command/recap
Parameter
Since versionv2.1.108
DescriptionGenerate a one-sentence summary of the current session.
Command/release-notes
Parameter
Since versionv2.0.32
DescriptionOpen release notes in the interactive picker.
Command/reload-plugins
Parameter[--force]
Since versionv2.1.69
DescriptionReload active plugins and apply MCP changes with --force.
Command/reload-skills
Parameter
Since versionv2.1.152
DescriptionReload skill and command directories without restarting Claude Code.
Command/remote-control
Parameter
Since versionv2.1.51
DescriptionMake the local session controllable through claude.ai or the Claude app. Alias: /rc.
Command/remote-env
Parameter
Since versionv2.0.47
DescriptionChoose the default environment for cloud agents.
Command/rename
Parameter[name]
Since versionv2.1.20
DescriptionRename the current session.
Command/resume
Parameter[session]
Since versionv1.0.27
DescriptionResume a conversation by ID or name. Alias: /continue.
Command/review
Parameter[level] [--fix] [--comment] [target]
Since versionNot documented
DescriptionAlias for /code-review.
Command/rewind
Parameter
Since versionv2.0.0
DescriptionRestore code and/or conversation to a checkpoint. Aliases: /checkpoint and /undo.
Command/sandbox
Parameter
Since versionv2.0.24
DescriptionToggle sandbox mode on supported platforms.
Command/schedule
Parameter[description]
Since versionNot documented
DescriptionCreate, update, or run cloud routines. Alias: /routines.
Command/scroll-speed
Parameter
Since versionNot documented
DescriptionSet scrolling speed in the fullscreen renderer.
Command/security-review
Parameter
Since versionv2.1.70
DescriptionCheck the branch diff for security problems.
Command/setup-bedrock
Parameter
Since versionNot documented
DescriptionSet up Amazon Bedrock authentication, region, and models.
Command/setup-vertex
Parameter
Since versionNot documented
DescriptionSet up Google Cloud Agent Platform.
Command/skills
Parameter
Since versionv2.1.3
DescriptionList available skills and manage their visibility.
Command/stats
Parameter
Since versionv2.0.64
DescriptionAlias for /usage and open the Stats tab.
Command/status
Parameter
Since versionv0.2.9
DescriptionShow version, model, account, connectivity, and session type.
Command/statusline
Parameter
Since versionv1.0.71
DescriptionConfigure the status line.
Command/stickers
Parameter
Since versionv2.0.51
DescriptionOrder Claude Code stickers.
Command/stop
Parameter
Since versionNot documented
DescriptionStop the currently attached background session.
Command/subtask
Parameter<task>
Since versionv2.1.212
DescriptionStart a background subagent whose result returns to this conversation.
Command/tasks
Parameter
Since versionv2.0.64
DescriptionShow and manage background work in the current session. Alias: /bashes.
Command/team-onboarding
Parameter
Since versionv2.1.101
DescriptionCreate an onboarding guide for teammates from your usage history.
Command/teleport
Parameter
Since versionv2.1.0
DescriptionBring a Claude Code web session into this terminal. Alias: /tp.
Command/terminal-setup
Parameter
Since versionv1.0.110
DescriptionConfigure terminal-specific shortcuts such as Shift+Enter.
Command/theme
Parameter
Since versionv2.0.74
DescriptionSwitch theme, ANSI theme, or accessible color variant.
Command/tui
Parameter[default|fullscreen]
Since versionv2.1.110
DescriptionSwitch the terminal renderer and restart the conversation in it.
Command/ultrareview
Parameter[PR|branch]
Since versionv2.1.111
DescriptionAlias for the cloud version of /code-review ultra.
Command/upgrade
Parameter
Since versionv2.0.51
DescriptionOpen the upgrade page for a higher plan.
Command/usage
Parameter
Since versionv2.0.0
DescriptionShow costs, plan limits, and usage statistics.
Command/usage-credits
Parameter
Since versionv2.1.144
DescriptionConfigure usage credits or request them from an administrator.
Command/voice
Parameter[hold|tap|off]
Since versionv2.1.69
DescriptionControl voice dictation for Claude.ai accounts.
Command/web-setup
Parameter
Since versionNot documented
DescriptionConnect local GitHub credentials to Claude Code on the web.
Command/workflows
Parameter
Since versionv2.1.154
DescriptionOpen progress for running and completed workflows.

Bundled Skills and Workflows

Bundled skills are detailed work instructions rather than hard-coded UI logic. Claude can select them itself when the task fits, except for /verify. Workflows go further and distribute background work across several agents.

Skill/batch <prompt>
DescriptionSplit a large change into independent worktrees, each with a background subagent.
Skill/claude-api [migrate|upgrade|managed-agents-onboard|prompt-audit]
DescriptionLoad API and Managed Agents reference material or audit existing API prompts.
Skill/code-review [level] [--fix] [--comment] [target]
DescriptionReview a diff, pull request, branch, or path and optionally apply fixes. Alias: /review.
Skill/dataviz [request]
DescriptionHelp design accessible charts, graphics, and dashboards.
Skill/debug [description]
DescriptionEnable debug logging and analyze the current session log.
Skill/design-sync [prompt]
DescriptionSync a React design system into Claude Design.
Skill/doctor
DescriptionCheck installation, configuration, and unnecessary context, then offer fixes. Alias: /checkup.
Skill/fewer-permission-prompts
DescriptionSuggest a prioritized allowlist for frequent read-only tool calls.
Skill/loop [interval] [prompt]
DescriptionRepeat a prompt while the session remains open. Alias: /proactive.
Skill/run
DescriptionStart and operate the app so Claude can observe changes in practice.
Skill/run-skill-generator
DescriptionCreate project-specific foundations for /run and /verify.
Skill/simplify [target]
DescriptionReview changed code for reuse, simplification, efficiency, and abstraction.
Skill/verify
DescriptionBuild, start, and observe the application alongside tests and type checks.

Bundled Workflow

Workflow/deep-research <question>
DescriptionFan out web research, cross-check sources, and return a sourced report.

Retired Commands

Command/pr-comments
Status or replacementRemoved in v2.1.91. Ask Claude to inspect pull-request comments instead.
Command/ultraplan
Status or replacementRemoved. The official reference does not publish a separate removal version. Use plan mode or /plan.
Command/vim
Status or replacementRemoved in v2.1.92. Configure editor mode through /config.
Command/extra-usage
Status or replacementReplaced by /usage-credits.

Keyboard Shortcuts

Keyboard shortcuts make the difference between productive flow and constant looking things up. Here are all available shortcuts for interactive mode.

General Controls

ShortcutCtrl+C
DescriptionInterrupt the active operation. When idle, the first press clears the prompt and the second exits Claude Code.
ContextStandard interrupt
ShortcutCtrl+X Ctrl+K
DescriptionStop all background subagents and disable artifact auto-replies for the rest of the session
ContextPress twice within 3 seconds to confirm
ShortcutCtrl+D
DescriptionShow the exit confirmation on an empty prompt. Press again within 800 ms to exit.
ContextWith text, delete the character to the right
ShortcutCtrl+G / Ctrl+X Ctrl+E
DescriptionOpen prompt in the external editor
ContextFor longer prompts
ShortcutCtrl+L
DescriptionRedraw the terminal screen
ContextKeeps conversation history
ShortcutCtrl+O
DescriptionOpen Transcript Viewer
ContextInspect the conversation transcript
ShortcutCtrl+R
DescriptionReverse search in command history
ContextInteractive history search
ShortcutCtrl+T
DescriptionToggle task list visibility
ContextShow/hide tasks in status area
ShortcutCtrl+V / Cmd+V / Alt+V
DescriptionPaste an image from the clipboard
ContextCtrl+V, iTerm2 Cmd+V, or Windows/WSL Alt+V
ShortcutCtrl+B
DescriptionBackground the current task
ContextTmux users press it twice
ShortcutCtrl+S
DescriptionStash or restore the current prompt
ContextKeep a draft while checking something else
ShortcutCtrl+Z
DescriptionSuspend the process
ContextUnix terminals
ShortcutTab
DescriptionAccept autocomplete or add a comment to a permission response
ContextPrompt and permission dialogs
ShortcutArrow keys / Ctrl+P / Ctrl+N
DescriptionNavigate prompt history
ContextRecall previous inputs
ShortcutLeft / Right arrow
DescriptionCycle dialog tabs
ContextIn permission dialogs and menus
ShortcutEsc
DescriptionInterrupt generation or close a dialog
ContextSingle Escape
ShortcutEsc Esc
DescriptionClear a draft or open rewind
ContextDepends on the current state
ShortcutOption+T / Alt+T
DescriptionToggle extended thinking
ContextHas no effect with Fable 5, where thinking is always enabled
ShortcutOption+P / Alt+P
DescriptionOpen model picker
ContextQuick model switch without clearing prompt
ShortcutOption+O / Alt+O
DescriptionToggle Fast mode
ContextWhen the account supports it
ShortcutShift+Tab
DescriptionSwitch permission modes
ContextManual, acceptEdits, Plan, bypass, and Auto. Alt+M is the Windows fallback without VT mode.

Text Editing

ShortcutCtrl+A / Ctrl+E
DescriptionMove to the start or end of the current line
ContextLine navigation
ShortcutCtrl+K
DescriptionDelete to end of line
ContextDeleted text is stored
ShortcutCtrl+U
DescriptionDelete from cursor to start of line
ContextDeleted text is stored
ShortcutCtrl+W
DescriptionDelete the previous word
ContextOption+Delete on macOS, Ctrl+Backspace on Windows
ShortcutCtrl+Y
DescriptionPaste previously deleted text
ContextPaste from kill ring
ShortcutAlt+Y (after Ctrl+Y)
DescriptionCycle through paste history
ContextCycle previously deleted texts
ShortcutAlt+B
DescriptionMove cursor back one word
ContextOption as Meta on macOS
ShortcutAlt+F
DescriptionMove cursor forward one word
ContextOption as Meta on macOS
ShortcutAlt+D
DescriptionDelete the next word
ContextOption as Meta on macOS
ShortcutCtrl+_ / Ctrl+Shift+-
DescriptionUndo the last edit
ContextRestores text and cursor position

Multi-line Input

MethodQuick Escape
Shortcut\\ + Enter
ContextWorks in all terminals
MethodOption key
ShortcutOption+Enter
ContextAfter enabling Option as Meta on macOS
MethodShift+Enter
ShortcutShift+Enter
ContextNative in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, and Windows Terminal
MethodControl Sequence
ShortcutCtrl+J
ContextLine feed for multi-line
MethodPaste Mode
ShortcutDirect paste
ContextFor code blocks, logs

Quick Commands

Shortcut/ at start
DescriptionExecute slash command or skill
NotesFilters and autocompletes
Shortcut! at start
DescriptionBash mode
NotesExecutes commands directly, output in session
Shortcut@
DescriptionMention a file path or reachable session
NotesTriggers path autocomplete
Shortcut:
DescriptionInsert an emoji shortcut
NotesSuggestions appear after at least two characters
Shortcut? on an empty prompt
DescriptionToggle shortcut help
NotesWith text in the prompt, it inserts a question mark

Theme and Voice Input

ShortcutCtrl+T in /theme
DescriptionToggle syntax highlighting for code blocks
ContextOnly inside the theme picker
ShortcutHold or tap Space
DescriptionStart or stop voice dictation
ContextAfter enabling voice input. Run /voice tap first for tap-to-toggle.

Transcript Viewer

Ctrl+O opens the full conversation with tool calls and timestamps. The viewer has its own shortcuts.

Shortcut?
DescriptionToggle Transcript Viewer help in the fullscreen renderer
Shortcut{ / }
DescriptionJump to the previous or next user prompt in the fullscreen renderer
ShortcutCtrl+E
DescriptionToggle all content in the classic renderer
Shortcut[
DescriptionWrite the full conversation from fullscreen mode to native terminal scrollback
Shortcutv
DescriptionWrite the conversation to a temporary file and open it in $VISUAL or $EDITOR
Shortcutq / Ctrl+C / Esc
DescriptionClose the Transcript Viewer

CLI Commands

For everyday work, starting, resuming, and claude mcp are usually enough. The CLI can now also manage background sessions, cloud environments, plugins, and local project data.

Commandclaude
DescriptionStart interactive REPL
Exampleclaude
Commandclaude "query"
DescriptionStart REPL with initial prompt
Exampleclaude "explain this project"
Commandclaude -p "query"
DescriptionQuery via SDK, then exit
Exampleclaude -p "explain this function"
Commandcat file | claude -p "query"
DescriptionProcess piped content
Examplecat logs.txt | claude -p "explain"
Commandclaude -c
DescriptionContinue most recent conversation
Exampleclaude -c
Commandclaude -c -p "query"
DescriptionContinue via SDK
Exampleclaude -c -p "Check for type errors"
Commandclaude -r "session" "query"
DescriptionResume session by ID or name
Exampleclaude -r "auth-refactor" "Finish this PR"
Commandclaude update
DescriptionUpdate to latest version
Exampleclaude update
Commandclaude auth login
DescriptionSign in to Anthropic account (with --email or --sso)
Exampleclaude auth login --sso
Commandclaude auth logout
DescriptionSign out from Anthropic account
Exampleclaude auth logout
Commandclaude auth status
DescriptionShow authentication status (JSON or --text)
Exampleclaude auth status --text
Commandclaude agents
DescriptionOpen the agent view, optionally as JSON or for a specific directory
Exampleclaude agents --json
Commandclaude doctor
DescriptionCheck Claude Code installation health
Exampleclaude doctor
Commandclaude mcp
DescriptionConfigure and manage MCP servers
Exampleclaude mcp add github https://...
Commandclaude mcp login | logout
DescriptionSign in to or out of an MCP server
Exampleclaude mcp login github
Commandclaude gateway --config
DescriptionStart an API gateway with a configuration file
Exampleclaude gateway --config gateway.json
Commandclaude install [version]
DescriptionInstall a specific Claude Code version
Exampleclaude install latest
Commandclaude attach
DescriptionAttach to a running Claude Code session
Exampleclaude attach
Commandclaude auto-mode defaults | config | reset
DescriptionInspect defaults, effective configuration, or reset Auto mode
Exampleclaude auto-mode config
Commandclaude daemon status | stop
DescriptionInspect or stop the local daemon
Exampleclaude daemon status
Commandclaude import codex|gemini
DescriptionImport supported Codex or Gemini CLI configuration
Exampleclaude import codex --dry-run
Commandclaude logs
DescriptionOpen or collect diagnostic logs
Exampleclaude logs
Commandclaude plugin
DescriptionManage plugins. The plural form plugins is an alias.
Exampleclaude plugin list
Commandclaude project purge [path]
DescriptionRemove local project data. Review the target and use a dry run first.
Exampleclaude project purge --dry-run
Commandclaude remote-control
DescriptionStart Remote Control so a session can be controlled via claude.ai
Exampleclaude remote-control --name "My Project"
Commandclaude respawn | rm | stop
DescriptionRestart, remove, or stop managed sessions
Exampleclaude stop
Commandclaude self-hosted-runner
DescriptionManage a self-hosted runner
Exampleclaude self-hosted-runner
Commandclaude setup-token
DescriptionCreate or manage a setup token
Exampleclaude setup-token
Commandclaude ultrareview
DescriptionRun the cloud code-review variant
Exampleclaude ultrareview

CLI Flags

CLI flags are very useful for starting Claude Code with the right settings.

Basic Flags

Flag-p, --print
DescriptionPrint response without interactive mode
Exampleclaude -p "query"
Flag-c, --continue
DescriptionContinue last conversation
Exampleclaude -c
Flag-r, --resume
DescriptionResume specific session by ID or name
Exampleclaude -r "auth-refactor" "query"
Flag-n, --name
DescriptionSet display name for session (visible in /resume and terminal title)
Exampleclaude -n "feature-work"
Flag-w, --worktree
DescriptionStart in isolated git worktree
Exampleclaude -w feature-auth
Flag-v, --version
DescriptionOutput version number
Exampleclaude -v

Model & System Prompt

Flag--effort
DescriptionSet effort to low, medium, high, xhigh, max, ultracode, or auto when the selected model supports it
Exampleclaude --effort high
Flag--model
DescriptionSet a model with sonnet, opus, haiku, fable, or a full model ID
Exampleclaude --model claude-sonnet-5
Flag--system-prompt
DescriptionReplace entire system prompt
Exampleclaude --system-prompt "You are a Python expert"
Flag--system-prompt-file
DescriptionLoad system prompt from file (replaces default)
Exampleclaude --system-prompt-file ./prompt.txt
Flag--append-system-prompt
DescriptionAppend text to default system prompt
Exampleclaude --append-system-prompt "Always use TypeScript"
Flag--append-system-prompt-file
DescriptionAppend file contents to default system prompt
Exampleclaude --append-system-prompt-file ./rules.txt
Flag--exclude-dynamic-system-prompt-sections
DescriptionMove machine-specific prompt sections into the first user message to improve prompt-cache reuse for scripts
Exampleclaude -p --exclude-dynamic-system-prompt-sections "query"
Flag--tools
DescriptionRestrict available tools ("" for none, "default" for all)
Exampleclaude --tools "Bash,Edit,Read"

Agents & Subagents

Flag--agent
DescriptionSpecify an agent for the session
Exampleclaude --agent my-custom-agent
Flag--agents
DescriptionDefine custom subagents via JSON
Exampleclaude --agents '{"reviewer":{...}}'
Flag--append-subagent-system-prompt
DescriptionAppend text to every subagent system prompt in print mode
Exampleclaude -p --append-subagent-system-prompt "Cite file paths" "query"
Flag--teammate-mode
DescriptionSet Agent Teams display mode: in-process, auto, tmux, or iterm2
Exampleclaude --teammate-mode auto

Permissions & Security

Flag--allowedTools / --allowed-tools
DescriptionAllow tools without permission prompt
Exampleclaude --allowedTools "Bash(git log *)" "Read"
Flag--disallowedTools / --disallowed-tools
DescriptionRemove tools entirely or deny matching calls
Exampleclaude --disallowedTools "Edit" "Bash(curl *)"
Flag--permission-mode
DescriptionStart in specific permission mode
Exampleclaude --permission-mode plan
Flag--allow-dangerously-skip-permissions
DescriptionAdd bypass mode to Shift+Tab without starting the session in it
Exampleclaude --permission-mode plan --allow-dangerously-skip-permissions
Flag--dangerously-skip-permissions
DescriptionSkip all permission prompts (use with caution!)
Exampleclaude --dangerously-skip-permissions
Flag--permission-prompt-tool
DescriptionMCP tool for permission prompts (non-interactive)
Exampleclaude -p --permission-prompt-tool mcp_tool "query"

MCP Server & Integration

Flag--mcp-config
DescriptionLoad MCP servers from JSON files (space-separated)
Exampleclaude --mcp-config ./mcp.json
Flag--strict-mcp-config
DescriptionUse ONLY --mcp-config, ignore all other MCP sources
Exampleclaude --strict-mcp-config --mcp-config ./mcp.json
Flag--plugin-dir
DescriptionLoad plugins from a directory (repeat flag for multiple)
Exampleclaude --plugin-dir ./my-plugins
Flag--plugin-url
DescriptionLoad a plugin ZIP from a URL for this session
Exampleclaude --plugin-url https://example.com/plugin.zip
Flag--chrome / --no-chrome
DescriptionEnable/disable Chrome browser integration
Exampleclaude --chrome
Flag--ide
DescriptionAutomatically connect to IDE at startup
Exampleclaude --ide
Flag--channels
DescriptionResearch Preview for MCP channel notifications from plugins
Exampleclaude --channels plugin:my-notifier@my-marketplace
Flag--dangerously-load-development-channels
DescriptionLoad unapproved channels for local development after confirmation
Exampleclaude --dangerously-load-development-channels server:webhook
Flag--betas
DescriptionBeta headers for API requests (API key only)
Exampleclaude --betas "feature-x"

Output & Format

Flag--output-format
DescriptionSpecify output format (text, json, stream-json)
Exampleclaude -p "query" --output-format json
Flag--input-format
DescriptionSpecify input format (text, stream-json)
Exampleclaude -p --input-format stream-json
Flag--json-schema
DescriptionGet validated JSON matching schema (print mode only)
Exampleclaude -p --json-schema '{...}' "query"
Flag--include-partial-messages
DescriptionInclude partial streaming events (stream-json only)
Exampleclaude -p --output-format stream-json --include-partial-messages "query"
Flag--forward-subagent-text
DescriptionEmit subagent text and thinking blocks in stream-json output
Exampleclaude -p --output-format stream-json --verbose --forward-subagent-text "query"
Flag--include-hook-events
DescriptionEmit hook lifecycle events in stream-json output
Exampleclaude -p --output-format stream-json --verbose --include-hook-events "query"
Flag--prompt-suggestions
DescriptionEmit predicted follow-up prompts in stream-json output
Exampleclaude -p --prompt-suggestions --output-format stream-json --verbose "query"
Flag--replay-user-messages
DescriptionRe-emit incoming user messages when both input and output use stream-json
Exampleclaude -p --input-format stream-json --output-format stream-json --verbose --replay-user-messages
Flag--verbose
DescriptionEnable verbose logging with full turn-by-turn output
Exampleclaude --verbose

Directories & Session

Flag--add-dir
DescriptionAdd additional working directories
Exampleclaude --add-dir ../apps ../lib
Flag--environment
DescriptionStart a cloud session in a self-hosted environment by ID
Exampleclaude -p "Fix the login" --environment ccpool_abc123
Flag--ref
DescriptionUse a named Git ref instead of local HEAD with --environment
Exampleclaude -p "Run the build" --environment ccpool_abc123 --ref main
Flag--from-pr
DescriptionResume sessions linked to a GitHub PR
Exampleclaude --from-pr 123
Flag--session-id
DescriptionUse specific session ID (UUID)
Exampleclaude --session-id "550e8400-..."
Flag--fork-session
DescriptionCreate new session ID when resuming
Exampleclaude --resume abc123 --fork-session
Flag--no-session-persistence
DescriptionDisable session saving (print mode only)
Exampleclaude -p --no-session-persistence "query"
Flag--tmux
DescriptionCreate a tmux session for a worktree, optionally with --tmux=classic
Exampleclaude -w feature-auth --tmux

Remote & More

Flag--cloud
DescriptionStart or target a Claude Code web session on claude.ai
Exampleclaude --cloud "Fix all bugs"
Flag--remote
DescriptionDeprecated alias for --cloud
Exampleclaude --remote "Fix all bugs"
Flag--bg, --background
DescriptionStart a background agent and return its session ID immediately. Do not combine with -p.
Exampleclaude --bg "check the flaky test"
Flag--exec
DescriptionRun a shell command as a PTY-backed background job together with --bg
Exampleclaude --bg --exec 'pytest -x'
Flag--remote-control, --rc
DescriptionStart with Remote Control (session controllable via claude.ai)
Exampleclaude --rc "My Project"
Flag--remote-control-session-name-prefix
DescriptionSet the prefix for automatically generated Remote Control session names
Exampleclaude remote-control --remote-control-session-name-prefix dev-box
Flag--teleport
DescriptionResume remote web session locally
Exampleclaude --teleport
Flag--debug
DescriptionEnable debug mode with optional category filtering
Exampleclaude --debug "api,mcp"
Flag--debug-file
DescriptionWrite debug logs to a specified file and enable debugging
Exampleclaude --debug-file /tmp/claude-debug.log
Flag--max-turns
DescriptionLimit agentic turns (print mode only)
Exampleclaude -p --max-turns 3 "query"
Flag--max-budget-usd
DescriptionMaximum budget in USD (print mode only)
Exampleclaude -p --max-budget-usd 5.00 "query"
Flag--fallback-model
DescriptionAuto-fallback on overload (print mode only)
Exampleclaude -p --fallback-model sonnet "query"
Flag--init / --maintenance / --init-only
DescriptionRun Setup hooks for initialization or maintenance, or exit after setup
Exampleclaude -p --maintenance "query"
Flag--settings
DescriptionLoad settings from JSON file or string
Exampleclaude --settings ./settings.json
Flag--setting-sources
DescriptionComma-separated list of settings sources (user, project, local)
Exampleclaude --setting-sources "user,project"
Flag--safe-mode
DescriptionTroubleshoot without local customization such as CLAUDE.md, skills, plugins, and hooks
Exampleclaude --safe-mode
Flag--bare
DescriptionMinimal mode for scriptable calls without automatic project customization
Exampleclaude --bare -p "query"
Flag--autocompact
DescriptionSet the auto-compaction window for this session only
Exampleclaude --autocompact 500k
Flag--advisor
DescriptionEnable the server-side Advisor for this session
Exampleclaude --advisor opus
Flag--ax-screen-reader
DescriptionForce simplified, screen-reader-friendly output
Exampleclaude --ax-screen-reader
Flag--disable-slash-commands
DescriptionDisable all skills and commands for this session
Exampleclaude --disable-slash-commands

Environment Variables

Beyond CLI flags, there are numerous environment variables that control Claude Code behavior. Set them in your shell or in settings.json under the env key. Values in a settings env override shell variables. Changes apply to running sessions unless a variable is explicitly read only at startup.

Model & Performance

VariableANTHROPIC_MODEL
DescriptionSet the default model. --model and /model override it.
DefaultProvider default
VariableCLAUDE_CODE_EFFORT_LEVEL
DescriptionSet low, medium, high, xhigh, max, or auto when the selected model supports it. Overrides /effort and settings.
DefaultModel-dependent
VariableCLAUDE_CODE_MAX_OUTPUT_TOKENS
DescriptionLimit output tokens per response. A higher value reduces usable context.
DefaultModel-dependent
VariableMAX_THINKING_TOKENS
DescriptionSet a fixed thinking budget. Adaptive thinking remains active until CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING is set. 0 disables thinking except for Fable.
DefaultModel-dependent
VariableCLAUDE_CODE_SUBAGENT_MODEL
DescriptionModel for subagents, Agent Teams, and workflows. Accepts an alias or full ID; inherit uses the session model.
DefaultSession model

Bash & Timeouts

VariableBASH_DEFAULT_TIMEOUT_MS
DescriptionDefault timeout for Bash commands in milliseconds
Default120,000 (2 min)
VariableBASH_MAX_TIMEOUT_MS
DescriptionUpper bound for Bash timeouts in milliseconds
Default600,000 (10 min)
VariableBASH_MAX_OUTPUT_LENGTH
DescriptionMaximum Bash output in characters. The allowed range ends at 150,000.
Default30,000
VariableMAX_MCP_OUTPUT_TOKENS
DescriptionToken limit for MCP tool output
Default25,000

Feature Toggles

VariableCLAUDE_CODE_DISABLE_AUTO_MEMORY
DescriptionDisable automatic memory creation
Value1 = off
VariableCLAUDE_CODE_DISABLE_BACKGROUND_TASKS
DescriptionDisable background tasks
Value1 = off
VariableCLAUDE_CODE_DISABLE_CRON
DescriptionStop scheduled cron jobs in session
Value1 = off
VariableCLAUDE_CODE_DISABLE_1M_CONTEXT
DescriptionDisable the 1M token context window
Value1 = off
VariableCLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS
DescriptionRemove git instructions from system prompt
Value1 = off
VariableCLAUDE_CODE_ENABLE_PROMPT_SUGGESTION
DescriptionControl prompt suggestions (grayed-out suggestion text)
Valuefalse = off
VariableCLAUDE_CODE_TASK_LIST_ID
DescriptionNamed task list for cross-session tasks
Valuee.g., my-project
VariableCLAUDE_CODE_DISABLE_BUNDLED_SKILLS
DescriptionDisable bundled skills for the session
Value1 = off
VariableCLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS
DescriptionMaximum number of concurrent subagents
ValueDefault: 20
VariableCLAUDE_CODE_SKIP_PROMPT_HISTORY
DescriptionDisable input and transcript history
Value1 = off
VariableCLAUDE_CODE_SUBPROCESS_ENV_SCRUB
DescriptionRemove provider secrets from spawned subprocess environments
Value1 = on
VariableENABLE_TOOL_SEARCH
DescriptionControl on-demand MCP tool loading. Accepts true, false, auto, or auto:N.
ValueProvider-dependent
VariableENABLE_CLAUDEAI_MCP_SERVERS
DescriptionControl claude.ai MCP servers
Valuefalse = off
VariableDISABLE_AUTOUPDATER
DescriptionDisable automatic updates. Manual updates remain available.
Value1 = off
VariableDISABLE_UPDATES
DescriptionBlock manual updates too.
Value1 = off
VariableDISABLE_TELEMETRY
DescriptionOpt out of telemetry and feature-flag requests. This also removes Remote Control, import, schedule, and Advisor.
ValueAny non-empty value
VariableDO_NOT_TRACK
DescriptionAlternative telemetry opt-out
Value1 = off

Authentication & Provider

VariableANTHROPIC_API_KEY
DescriptionAPI key for Anthropic
ContextRequired without subscription
VariableANTHROPIC_BASE_URL
DescriptionAlternative base URL for an Anthropic-compatible API
ContextProxy or own gateway
VariableCLAUDE_CODE_USE_BEDROCK
DescriptionUse AWS Bedrock as provider
Context1 = enabled
VariableCLAUDE_CODE_USE_VERTEX
DescriptionUse Google Vertex AI as provider
Context1 = enabled
VariableCLAUDE_CODE_USE_FOUNDRY
DescriptionUse Microsoft Foundry as provider
Context1 = enabled
VariableHTTP_PROXY / HTTPS_PROXY
DescriptionProxy configuration
ContextFor corporate networks

MCP (Model Context Protocol) Integration

MCP is one of Claude Code's most important extensions. With it, you can directly integrate external tools and services. The community is already delivering hundreds of MCP server implementations and constantly expanding the ecosystem.

# Add MCP server
claude mcp add --transport http github https://mcp.github.com

# Start with debug
claude --debug "mcp"

# Expose Claude Code itself as an MCP server
claude mcp serve

Tool Search can load MCP tools on demand and save context. Control it through ENABLE_TOOL_SEARCH, for example with auto, true, false, or auto:N. The best setting depends on the provider, MCP servers, and tool count.

Another feature is MCP Elicitation: MCP servers can display interactive forms or browser URLs during a task to request structured input. MCP servers can also provide their own commands in the format /mcp__<server>__<prompt>.

Skills

One of the coolest features of Claude Code? You can create your own skills that perfectly fit your workflow. Skills are the evolution of former custom commands and follow the open Agent Skills standard.

Project skills are stored in .claude/skills/ and are available to everyone in the project. Personal skills go in ~/.claude/skills/ and only apply to you. Enterprise skills are distributed organization-wide through managed settings.

---
name: test-all
description: Runs all tests and linters
argument-hint: [test-suite] [flags]
allowed-tools: Bash(npm test:*), Bash(npm run:*)
model: sonnet
disable-model-invocation: false
context: fork
---

Run the following tests:
1. npm test $ARGUMENTS
2. npm run lint
3. npm run typecheck

Show me a summary of all results.

After creating it, simply type /test-all and Claude runs your complete test suite. I have about 10 such skills for recurring tasks.

Troubleshooting: When Claude Code Doesn't Do What It Should

Even after hundreds of sessions, I sometimes run into problems. Here are the most common errors and their solutions.

ProblemClaude doesn't understand project
CauseWrong start folder
SolutionStart in project root, create CLAUDE.md
ProblemToken limit reached
CauseToo much context
SolutionUse /clear, /compact for smart compression
ProblemCommands don't work
CauseOutdated version
SolutionRun /doctor, then run claude update only if it recommends an update
ProblemMCP server won't connect
CauseMissing configuration
SolutionRun claude --debug "mcp" for diagnosis
ProblemShift+Enter doesn't work
CauseTerminal setup missing
SolutionRun /terminal-setup (VS Code, Alacritty, Warp)

You can use the following debug commands for problem analysis:

# Check system status
/status

# Check installation
/doctor

# Visualize context usage
/context

# Show token costs
/cost

# Verbose mode for details
claude --verbose

# Activate debug mode
claude --debug "api,mcp"

# Session troubleshooting
/debug "my problem"

# Open configuration
/config

Frequently Asked Questions About Claude Code Commands

FH

Finn Hillebrandt

AI Expert & Blogger

Finn Hillebrandt is the founder of Gradually AI, an SEO and AI expert. He helps online entrepreneurs simplify and automate their processes and marketing with AI. Finn shares his knowledge here on the blog in 50+ articles as well as through the AI Business Club.

Learn more about Finn and the team, follow Finn on LinkedIn, join his Facebook group for ChatGPT, OpenAI & AI Tools or do like 17,500+ others and subscribe to his AI Newsletter with tips, news and offers about AI tools and online business. Also visit his other blog, Blogmojo, which is about WordPress, blogging and SEO.