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?"
There are now well over 100 documented command entries once you count built-ins, skills, workflows, and aliases. Flags and keyboard shortcuts give you further control over your sessions.
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, 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.
# 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
Note
Anthropic now recommends the native installer. It updates itself automatically in the background. The npm installation is still supported, but it is no longer the recommended default.
Tip
Always start Claude Code in the correct project folder, not from your Desktop or user directory.
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 published version in which the command appears in Anthropic's official changelog, releases, or published Claude Code package.
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 versionv2.1.83
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 versionv2.1.94
DescriptionStart a web session that can watch a pull request and push CI or review fixes.
Command/background
Parameter[prompt]
Since versionv2.1.119
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 versionv0.2.9
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 versionv2.1.178
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|ultracode [on|off]]
Since versionv2.1.76
DescriptionChoose reasoning effort. ultracode on and off, plus keeping the current level, work since v2.1.284.
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 versionv2.1.110
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 versionv2.1.139
DescriptionSet a goal that Claude continues pursuing across turns.
Command/heapdump
Parameter
Since versionv2.1.71
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.
DescriptionImport configuration from Codex, Gemini CLI, or Cursor, including rules, MCP servers, and skills. Cursor is supported since v2.1.265.
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/output-style
Parameter[style]
Since versionv1.0.81
DescriptionList available output styles or switch to one. Available again since v2.1.269.
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 versionv2.1.132
DescriptionOpen Claude FM in the browser when the command is available for the provider.
Command/rate-limit-options
Parameter
Since versionNot documented
DescriptionShow options after reaching a usage limit. Requires a claude.ai subscription; wait-and-continue options require v2.1.234 or later. Listed in the command menu since v2.1.284; the first version of the previously hidden command is not documented.
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. Directly attach to a running background session since v2.1.285. Alias: /continue.
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 versionv2.1.80
DescriptionCreate, update, or run cloud routines. Alias: /routines.
Command/scroll-speed
Parameter
Since versionv2.1.139
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 versionv2.1.92
DescriptionSet up Amazon Bedrock authentication, region, and models.
Command/setup-vertex
Parameter
Since versionv2.1.98
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 versionv2.1.119
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 cloud 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 versionv2.1.79
DescriptionConnect local GitHub credentials to Claude Code on the web.
Command/workflows
Parameter
Since versionv2.1.154
DescriptionOpen progress for running and completed workflows.
/add-dir
<path>
v2.0.11
Give the current session access to an additional working directory.
/advisor
[model|off]
v2.1.83
Enable or disable Advisor, which consults a second model at key moments.
/agents
v1.0.58
Open guidance for managing subagents through Claude or .claude/agents/ files.
/artifacts
v2.1.208
List personal or shared artifacts and attach one to the session.
/auto-mode-setup
v2.1.228
Draft Auto mode settings from the project and prior sessions.
/autocompact
[auto|<tokens>]
v2.1.221
Set how full the context window can become before automatic compaction.
/autofix-pr
[prompt]
v2.1.94
Start a web session that can watch a pull request and push CI or review fixes.
/background
[prompt]
v2.1.119
Detach the current session as a background agent. Alias: /bg.
/branch
[name]
v2.1.77
Create a conversation branch and switch to it without losing the original.
/btw
[question]
v2.0.0
Answer a side question outside the conversation context.
/bug
[report]
v0.2.9
Report a bug or share the session after consent. Alias: /share.
/cd
<path>
v2.1.169
Change working directory while retaining the conversation and prompt cache.
/chrome
v2.0.72
Open Claude in Chrome settings.
/clear
[name]
v0.2.9
Start a new conversation without context. Aliases: /reset and /new.
/color
[color|default]
v2.1.70
Set the prompt-bar color.
/compact
[instructions]
v0.2.47
Summarize the conversation to free context.
/config
[key=value ...]
v0.2.34
Open settings or set values directly. Alias: /settings.
/context
[all]
v2.1.14
Show what occupies the context window, including optimization suggestions.
/copy
[N]
v0.2.9
Copy the latest or Nth-most-recent response to the clipboard.
/cost
v1.0.85
Alias for /usage.
/design-login
v2.1.178
Authorize access to Claude Design for /design-sync.
/desktop
v2.0.51
Continue the session in the Claude Code desktop app. Alias: /app.
/diff
v2.0.0
Open the interactive diff viewer for uncommitted and turn-level changes.
/effort
[level|auto|status|ultracode [on|off]]
v2.1.76
Choose reasoning effort. ultracode on and off, plus keeping the current level, work since v2.1.284.
/exit
v0.2.9
Exit the CLI or detach an attached background session. Alias: /quit.
/export
[filename]
v0.2.9
Export the current conversation as plain text.
/fast
[on|off]
v2.1.36
Toggle Fast mode when the account supports it.
/feedback
[report]
v0.2.9
Open the same feedback dialog as /bug.
/focus
v2.1.110
Switch to the reduced focus view in the fullscreen renderer.
/fork
[prompt]
v2.0.0
Copy the conversation into a new background session.
/goal
[condition|clear]
v2.1.139
Set a goal that Claude continues pursuing across turns.
/heapdump
v2.1.71
Write diagnostics for memory issues. This hidden command can contain sensitive data.
/help
v0.2.9
Show help and the commands available in this session.
/hooks
v1.0.38
Show hook configurations.
/ide
v2.0.0
Manage IDE integrations and display their status.
/import
[codex|gemini|cursor] [--dry-run] [--yes]
v2.1.213
Import configuration from Codex, Gemini CLI, or Cursor, including rules, MCP servers, and skills. Cursor is supported since v2.1.265.
/init
v0.2.9
Create project guidance in CLAUDE.md.
/insights
v2.1.14
Generate an HTML report about local Claude Code sessions and usage patterns.
/install-github-app
v1.0.0
Set up the Claude GitHub App for a repository.
/install-slack-app
v2.0.51
Install the Claude Slack app through browser sign-in.
/keybindings
v2.1.18
Open the file for customizable keyboard shortcuts.
/list-agents
v2.1.224
List reachable subagents, teammates, and sessions. Alias: /peers.
/login
v0.2.96
Sign in to Anthropic.
/logout
v0.2.96
Sign out of the Anthropic account.
/mcp
[reconnect|enable|disable]
v0.2.50
Manage MCP connections and OAuth sign-ins.
/memory
v1.0.94
Edit CLAUDE.md files and automatic memory.
/mobile
v2.0.51
Show a QR code for the Claude mobile app. Aliases: /ios and /android.
/model
[model]
v0.2.9
Switch models and save the choice for new sessions.
/output-style
[style]
v1.0.81
List available output styles or switch to one. Available again since v2.1.269.
/passes
v2.0.58
Share a free Claude Code week when the account is eligible.
/permissions
v2.0.67
Manage allowed, prompted, and denied tool rules. Alias: /allowed-tools.
/plan
[description]
v2.1.0
Enter plan mode and optionally start with a task.
/plugin
[subcommand]
v2.0.12
Manage plugins, for example list, install, enable, and disable.
/powerup
v2.1.90
Open interactive mini-lessons about Claude Code features.
/privacy-settings
v2.0.51
Open privacy settings for Pro and Max subscribers.
/radio
v2.1.132
Open Claude FM in the browser when the command is available for the provider.
/rate-limit-options
Not documented
Show options after reaching a usage limit. Requires a claude.ai subscription; wait-and-continue options require v2.1.234 or later. Listed in the command menu since v2.1.284; the first version of the previously hidden command is not documented.
/recap
v2.1.108
Generate a one-sentence summary of the current session.
/release-notes
v2.0.32
Open release notes in the interactive picker.
/reload-plugins
[--force]
v2.1.69
Reload active plugins and apply MCP changes with --force.
/reload-skills
v2.1.152
Reload skill and command directories without restarting Claude Code.
/remote-control
v2.1.51
Make the local session controllable through claude.ai or the Claude app. Alias: /rc.
/remote-env
v2.0.47
Choose the default environment for cloud agents.
/rename
[name]
v2.1.20
Rename the current session.
/resume
[session]
v1.0.27
Resume a conversation by ID or name. Directly attach to a running background session since v2.1.285. Alias: /continue.
Restore code and/or conversation to a checkpoint. Aliases: /checkpoint and /undo.
/sandbox
v2.0.24
Toggle sandbox mode on supported platforms.
/schedule
[description]
v2.1.80
Create, update, or run cloud routines. Alias: /routines.
/scroll-speed
v2.1.139
Set scrolling speed in the fullscreen renderer.
/security-review
v2.1.70
Check the branch diff for security problems.
/setup-bedrock
v2.1.92
Set up Amazon Bedrock authentication, region, and models.
/setup-vertex
v2.1.98
Set up Google Cloud Agent Platform.
/skills
v2.1.3
List available skills and manage their visibility.
/stats
v2.0.64
Alias for /usage and open the Stats tab.
/status
v0.2.9
Show version, model, account, connectivity, and session type.
/statusline
v1.0.71
Configure the status line.
/stickers
v2.0.51
Order Claude Code stickers.
/stop
v2.1.119
Stop the currently attached background session.
/subtask
<task>
v2.1.212
Start a background subagent whose result returns to this conversation.
/tasks
v2.0.64
Show and manage background work in the current session. Alias: /bashes.
/team-onboarding
v2.1.101
Create an onboarding guide for teammates from your usage history.
/teleport
v2.1.0
Bring a cloud session into this terminal. Alias: /tp.
/terminal-setup
v1.0.110
Configure terminal-specific shortcuts such as Shift+Enter.
/theme
v2.0.74
Switch theme, ANSI theme, or accessible color variant.
/tui
[default|fullscreen]
v2.1.110
Switch the terminal renderer and restart the conversation in it.
/ultrareview
[PR|branch]
v2.1.111
Alias for the cloud version of /code-review ultra.
/upgrade
v2.0.51
Open the upgrade page for a higher plan.
/usage
v2.0.0
Show costs, plan limits, and usage statistics.
/usage-credits
v2.1.144
Configure usage credits or request them from an administrator.
/voice
[hold|tap|off]
v2.1.69
Control voice dictation for Claude.ai accounts.
/web-setup
v2.1.79
Connect local GitHub credentials to Claude Code on the web.
/workflows
v2.1.154
Open progress for running and completed workflows.
Tip
My favorite command /clear is a real token saver. Almost reached the message limit? This command clears the context and gives you a fresh start.
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.
Note
You can chain up to six skills at the start of a message, for example /simplify /verify check my latest diff.
Skill/artifact-capabilities
DescriptionLoad the reference for published artifact runtime capabilities, such as connector calls and downloads. Availability depends on artifacts and account; the first version is not documented.
Skill/artifact-diagramming
DescriptionLoad guidance for readable diagrams in artifacts. Requires Claude Code v2.1.221 or later.
Skill/batch <prompt>
DescriptionSplit a large change into independent worktrees, each with a background subagent.
DescriptionReview a diff, pull request, branch, or path and optionally apply fixes. --max-findings is available since v2.1.288. 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 [brief]
DescriptionCreate UI designs as a Claude Design artifact. Requires v2.1.265 or later, available artifacts, and the Design template; Anthropic API only.
Skill/design-sync [prompt]
DescriptionSync a React design system into Claude Design.
Skill/doctor [prompt-audit [path]]
DescriptionCheck installation and configuration, find unnecessary context, and offer changes for review. prompt-audit requires v2.1.283 or later. 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/plugin-authoring
DescriptionLoad the reference for developing Claude Code mods. Requires Claude Code v2.1.287 or later.
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/skill-doctor
DescriptionShow skill context costs and usage. Requires Claude Code v2.1.252 or later and feature-flag fetching.
Skill/slides [brief]
DescriptionCreate a presentation as a Claude Slides artifact. Requires v2.1.265 or later, available artifacts, and the Slides template; Anthropic API only.
Skill/update-config [request]
DescriptionChange matching settings.json entries from a natural-language request. The first version is not documented.
Skill/verify
DescriptionBuild, start, and observe the application alongside tests and type checks.
Skill/workflow-authoring
DescriptionLoad the reference for creating and editing dynamic workflows. Requires Claude Code v2.1.248 or later with Dynamic Workflows enabled.
/artifact-capabilities
Load the reference for published artifact runtime capabilities, such as connector calls and downloads. Availability depends on artifacts and account; the first version is not documented.
/artifact-diagramming
Load guidance for readable diagrams in artifacts. Requires Claude Code v2.1.221 or later.
/batch <prompt>
Split a large change into independent worktrees, each with a background subagent.
Review a diff, pull request, branch, or path and optionally apply fixes. --max-findings is available since v2.1.288. Alias: /review.
/dataviz [request]
Help design accessible charts, graphics, and dashboards.
/debug [description]
Enable debug logging and analyze the current session log.
/design [brief]
Create UI designs as a Claude Design artifact. Requires v2.1.265 or later, available artifacts, and the Design template; Anthropic API only.
/design-sync [prompt]
Sync a React design system into Claude Design.
/doctor [prompt-audit [path]]
Check installation and configuration, find unnecessary context, and offer changes for review. prompt-audit requires v2.1.283 or later. Alias: /checkup.
/fewer-permission-prompts
Suggest a prioritized allowlist for frequent read-only tool calls.
/loop [interval] [prompt]
Repeat a prompt while the session remains open. Alias: /proactive.
/plugin-authoring
Load the reference for developing Claude Code mods. Requires Claude Code v2.1.287 or later.
/run
Start and operate the app so Claude can observe changes in practice.
/run-skill-generator
Create project-specific foundations for /run and /verify.
/simplify [target]
Review changed code for reuse, simplification, efficiency, and abstraction.
/skill-doctor
Show skill context costs and usage. Requires Claude Code v2.1.252 or later and feature-flag fetching.
/slides [brief]
Create a presentation as a Claude Slides artifact. Requires v2.1.265 or later, available artifacts, and the Slides template; Anthropic API only.
/update-config [request]
Change matching settings.json entries from a natural-language request. The first version is not documented.
/verify
Build, start, and observe the application alongside tests and type checks.
/workflow-authoring
Load the reference for creating and editing dynamic workflows. Requires Claude Code v2.1.248 or later with Dynamic Workflows enabled.
For /code-review and /review, --max-findings requires a value. A number limits the findings, all shows every finding, and default resets the limit.
Bundled Workflow
Workflow/deep-research <question>
DescriptionFan out web research, cross-check sources, and return a sourced report.
/deep-research <question>
Fan 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.
/pr-comments
Removed in v2.1.91. Ask Claude to inspect pull-request comments instead.
/ultraplan
Removed. The official reference does not publish a separate removal version. Use plan mode or /plan.
/vim
Removed in v2.1.92. Configure editor mode through /config.
/extra-usage
Replaced by /usage-credits.
Note
MCP servers can also provide their own commands. These appear in the format /mcp__<server>__<prompt> and are dynamically discovered from connected servers.
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, Fable 5.1, Opus 5.5, or Sonnet 5.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.
Ctrl+C
Interrupt the active operation. When idle, the first press clears the prompt and the second exits Claude Code.
Standard interrupt
Ctrl+X Ctrl+K
Stop all background subagents and disable artifact auto-replies for the rest of the session
Press twice within 3 seconds to confirm
Ctrl+D
Show the exit confirmation on an empty prompt. Press again within 800 ms to exit.
With text, delete the character to the right
Ctrl+G / Ctrl+X Ctrl+E
Open prompt in the external editor
For longer prompts
Ctrl+L
Redraw the terminal screen
Keeps conversation history
Ctrl+O
Open Transcript Viewer
Inspect the conversation transcript
Ctrl+R
Reverse search in command history
Interactive history search
Ctrl+T
Toggle task list visibility
Show/hide tasks in status area
Ctrl+V / Cmd+V / Alt+V
Paste an image from the clipboard
Ctrl+V, iTerm2 Cmd+V, or Windows/WSL Alt+V
Ctrl+B
Background the current task
Tmux users press it twice
Ctrl+S
Stash or restore the current prompt
Keep a draft while checking something else
Ctrl+Z
Suspend the process
Unix terminals
Tab
Accept autocomplete or add a comment to a permission response
Prompt and permission dialogs
Arrow keys / Ctrl+P / Ctrl+N
Navigate prompt history
Recall previous inputs
Left / Right arrow
Cycle dialog tabs
In permission dialogs and menus
Esc
Interrupt generation or close a dialog
Single Escape
Esc Esc
Clear a draft or open rewind
Depends on the current state
Option+T / Alt+T
Toggle extended thinking
Has no effect with Fable 5, Fable 5.1, Opus 5.5, or Sonnet 5.5, where thinking is always enabled
Option+P / Alt+P
Open model picker
Quick model switch without clearing prompt
Option+O / Alt+O
Toggle Fast mode
When the account supports it
Shift+Tab
Switch permission modes
Manual, 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 back to the previous whitespace, including a full path or --flag=value
ContextFor the previous word, use Option+Delete on macOS or 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
Ctrl+A / Ctrl+E
Move to the start or end of the current line
Line navigation
Ctrl+K
Delete to end of line
Deleted text is stored
Ctrl+U
Delete from cursor to start of line
Deleted text is stored
Ctrl+W
Delete back to the previous whitespace, including a full path or --flag=value
For the previous word, use Option+Delete on macOS or Ctrl+Backspace on Windows
Ctrl+Y
Paste previously deleted text
Paste from kill ring
Alt+Y (after Ctrl+Y)
Cycle through paste history
Cycle previously deleted texts
Alt+B
Move cursor back one word
Option as Meta on macOS
Alt+F
Move cursor forward one word
Option as Meta on macOS
Alt+D
Delete the next word
Option as Meta on macOS
Ctrl+_ / Ctrl+Shift+-
Undo the last edit
Restores text and cursor position
Note
Since v2.1.261, word shortcuts follow Bash Readline conventions. Punctuation separates words, while Ctrl+W deletes back to the previous whitespace. The earlier keybindingFlavor setting no longer has any effect.
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 Escape
\\ + Enter
Works in all terminals
Option key
Option+Enter
After enabling Option as Meta on macOS
Shift+Enter
Shift+Enter
Native in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, and Windows Terminal
Control Sequence
Ctrl+J
Line feed for multi-line
Paste Mode
Direct paste
For 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
/ at start
Execute slash command or skill
Filters and autocompletes
! at start
Bash mode
Executes commands directly, output in session
@
Mention a file path or reachable session
Triggers path autocomplete
:
Insert an emoji shortcut
Suggestions appear after at least two characters
? on an empty prompt
Toggle shortcut help
With 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.
Ctrl+T in /theme
Toggle syntax highlighting for code blocks
Only inside the theme picker
Hold or tap Space
Start or stop voice dictation
After 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
?
Toggle Transcript Viewer help in the fullscreen renderer
{ / }
Jump to the previous or next user prompt in the fullscreen renderer
Ctrl+E
Toggle all content in the classic renderer
[
Write the full conversation from fullscreen mode to native terminal scrollback
v
Write the conversation to a temporary file and open it in $VISUAL or $EDITOR
q / Ctrl+C / Esc
Close 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. Add remote HTTP servers with --transport http.
DescriptionDelete local transcripts, task lists, debug logs, edit and prompt history, and the project entry. Preview with --dry-run first. The previous name claude project purge still works and prints a notice.
Exampleclaude purge ~/work/repo --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 | kill
DescriptionRestart, remove, or stop managed sessions. kill is an alias for stop.
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
claude
Start interactive REPL
claude
claude "query"
Start REPL with initial prompt
claude "explain this project"
claude -p "query"
Query via SDK, then exit
claude -p "explain this function"
cat file | claude -p "query"
Process piped content
cat logs.txt | claude -p "explain"
claude -c
Continue most recent conversation
claude -c
claude -c -p "query"
Continue via SDK
claude -c -p "Check for type errors"
claude -r "session" "query"
Resume session by ID or name
claude -r "auth-refactor" "Finish this PR"
claude update
Update to latest version
claude update
claude auth login
Sign in to Anthropic account (with --email or --sso)
claude auth login --sso
claude auth logout
Sign out from Anthropic account
claude auth logout
claude auth status
Show authentication status (JSON or --text)
claude auth status --text
claude agents
Open the agent view, optionally as JSON or for a specific directory
claude agents --json
claude doctor
Check Claude Code installation health
claude doctor
claude mcp
Configure and manage MCP servers. Add remote HTTP servers with --transport http.
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
claude mcp login | logout
Sign in to or out of an MCP server
claude mcp login github
claude gateway --config
Start an API gateway with a configuration file
claude gateway --config gateway.yaml
claude install [version]
Install a specific Claude Code version
claude install latest
claude attach <id|name>
Attach the terminal to a background session. Partial matching of a running session name is available since v2.1.290.
claude attach 7c5dcf5d
claude auto-mode defaults | config | reset
Inspect defaults, effective configuration, or reset Auto mode
claude auto-mode config
claude daemon logs|run|status
Follow supervisor logs, run it in the foreground, or inspect its status.
claude daemon status
claude daemon stop --any [--keep-workers]
Stop the supervisor across projects. Add --keep-workers to leave its worker sessions running.
claude daemon stop --any
claude import [codex|gemini|cursor]
Import configuration from another coding agent. Cursor import is available since v2.1.265.
claude import codex --dry-run
claude logs <id|name>
Show recent output from a background session. Partial matching of a running session name is available since v2.1.290.
claude logs 7c5dcf5d
claude plugin
Manage plugins. The plural form plugins is an alias. Install with --marketplace <source>, available since v2.1.292.
claude plugin install code-review --marketplace anthropics/claude-plugins-official
claude purge [path]
Delete local transcripts, task lists, debug logs, edit and prompt history, and the project entry. Preview with --dry-run first. The previous name claude project purge still works and prints a notice.
claude purge ~/work/repo --dry-run
claude remote-control
Start Remote Control so a session can be controlled via claude.ai
claude remote-control --name "My Project"
claude respawn | rm | stop | kill
Restart, remove, or stop managed sessions. kill is an alias for stop.
claude stop
claude self-hosted-runner
Manage a self-hosted runner
claude self-hosted-runner
claude setup-token
Create or manage a setup token
claude setup-token
claude ultrareview
Run the cloud code-review variant
claude 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
-p, --print
Print response without interactive mode
claude -p "query"
-c, --continue
Continue last conversation
claude -c
-r, --resume
Resume specific session by ID or name
claude -r "auth-refactor" "query"
-n, --name
Set display name for session (visible in /resume and terminal title)
claude -n "feature-work"
-w, --worktree
Start in isolated git worktree
claude -w feature-auth
-v, --version
Output version number
claude -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 an alias such as sonnet, opus, haiku, or fable, or a full model ID. Claude Haiku 5.5 (claude-haiku-5-5) is the default Haiku model on the Anthropic API.
Exampleclaude --model sonnet
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
DescriptionRestrict available tools ("" for none, "default" for all)
Exampleclaude --tools "Bash,Edit,Read"
--effort
Set effort to low, medium, high, xhigh, max, ultracode, or auto when the selected model supports it
claude --effort high
--model
Set a model with an alias such as sonnet, opus, haiku, or fable, or a full model ID. Claude Haiku 5.5 (claude-haiku-5-5) is the default Haiku model on the Anthropic API.
claude --model sonnet
--system-prompt
Replace entire system prompt
claude --system-prompt "You are a Python expert"
--system-prompt-file
Load system prompt from file (replaces default)
claude --system-prompt-file ./prompt.txt
--append-system-prompt
Append text to default system prompt
claude --append-system-prompt "Always use TypeScript"
--append-system-prompt-file
Append file contents to default system prompt
claude --append-system-prompt-file ./rules.txt
--system-prompt-snapshot
Use off to rebuild the system prompt on each request. Available since v2.1.257.
claude --system-prompt-snapshot off
--exclude-dynamic-system-prompt-sections
Move machine-specific prompt sections into the first user message to improve prompt-cache reuse for scripts
claude -p --exclude-dynamic-system-prompt-sections "query"
--tools
Restrict available tools ("" for none, "default" for all)
claude --tools "Bash,Edit,Read"
Agents & Subagents
Flag--agent
DescriptionSpecify an agent for the session
Exampleclaude --agent my-custom-agent
Flag--agents
DescriptionDefine subagents via JSON. In print mode, a JSON file path also works, since v2.1.281.
Exampleclaude -p --agents ./agents.json "query"
Flag--append-subagent-system-prompt
DescriptionAppend text to every subagent system prompt in print mode
DescriptionCreate a tmux session for a worktree, optionally with --tmux=classic
Exampleclaude -w feature-auth --tmux
--add-dir
Add additional working directories
claude --add-dir ../apps ../lib
--environment
Start a cloud session in a self-hosted environment by ID
claude -p "Fix the login" --environment ccpool_abc123
--ref
Use a named Git ref instead of local HEAD with --environment
claude -p "Run the build" --environment ccpool_abc123 --ref main
--from-pr
Resume sessions linked to a GitHub PR
claude --from-pr 123
--session-id
Use specific session ID (UUID)
claude --session-id "550e8400-..."
--fork-session
Create new session ID when resuming
claude --resume abc123 --fork-session
--no-session-persistence
Disable session saving (print mode only)
claude -p --no-session-persistence "query"
--tmux
Create a tmux session for a worktree, optionally with --tmux=classic
claude -w feature-auth --tmux
Remote & More
Flag--desktop
DescriptionOpen the Claude Desktop app in the current directory and exit the CLI. Available since v2.1.285; requires macOS or Windows x64 and a Claude subscription.
Exampleclaude --desktop
Flag--cloud
DescriptionStart or target a cloud 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
DescriptionDisable all skills and commands for this session
Exampleclaude --disable-slash-commands
--desktop
Open the Claude Desktop app in the current directory and exit the CLI. Available since v2.1.285; requires macOS or Windows x64 and a Claude subscription.
claude --desktop
--cloud
Start or target a cloud session on claude.ai
claude --cloud "Fix all bugs"
--remote
Deprecated alias for --cloud
claude --remote "Fix all bugs"
--bg, --background
Start a background agent and return its session ID immediately. Do not combine with -p.
claude --bg "check the flaky test"
--exec
Run a shell command as a PTY-backed background job together with --bg
claude --bg --exec 'pytest -x'
--remote-control, --rc
Start with Remote Control (session controllable via claude.ai)
claude --rc "My Project"
--remote-control-session-name-prefix
Set the prefix for automatically generated Remote Control session names
claude remote-control --remote-control-session-name-prefix dev-box
--teleport
Resume remote web session locally
claude --teleport
--debug
Enable debug logging. Category filters must follow an equals sign.
claude --debug='api,mcp'
--debug-file
Write debug logs to a specified file and enable debugging
claude --debug-file /tmp/claude-debug.log
--max-turns
Limit agentic turns (print mode only)
claude -p --max-turns 3 "query"
--max-budget-usd
Maximum budget in USD (print mode only)
claude -p --max-budget-usd 5.00 "query"
--fallback-model
Auto-fallback on overload (print mode only)
claude -p --fallback-model sonnet "query"
--init / --maintenance / --init-only
Run Setup hooks for initialization or maintenance, or exit after setup
claude -p --maintenance "query"
--settings
Load settings from JSON file or string
claude --settings ./settings.json
--setting-sources
Comma-separated list of settings sources (user, project, local)
claude --setting-sources "user,project"
--safe-mode
Troubleshoot without local customization such as CLAUDE.md, skills, plugins, and hooks
claude --safe-mode
--bare
Minimal mode for scriptable calls without automatic project customization
claude --bare -p "query"
--autocompact
Set the auto-compaction window for this session only
claude --autocompact 500k
--advisor
Enable the server-side Advisor for this session
claude --advisor opus
--ax-screen-reader
Force simplified, screen-reader-friendly output
claude --ax-screen-reader
--disable-slash-commands
Disable all skills and commands for this session
claude --disable-slash-commands
Note
Many flags can be combined. For example: claude --model opus --verbose --add-dir src/ starts Claude with Opus model, verbose logging, and loads the src folder.
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, Opus 5.5, and Sonnet 5.5.
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
ANTHROPIC_MODEL
Set the default model. --model and /model override it.
Provider default
CLAUDE_CODE_EFFORT_LEVEL
Set low, medium, high, xhigh, max, or auto when the selected model supports it. Overrides /effort and settings.
Model-dependent
CLAUDE_CODE_MAX_OUTPUT_TOKENS
Limit output tokens per response. A higher value reduces usable context.
Model-dependent
MAX_THINKING_TOKENS
Set a fixed thinking budget. Adaptive thinking remains active until CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING is set. 0 disables thinking except for Fable, Opus 5.5, and Sonnet 5.5.
Model-dependent
CLAUDE_CODE_SUBAGENT_MODEL
Model for subagents, Agent Teams, and workflows. Accepts an alias or full ID; inherit uses the session model.
Session 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
BASH_DEFAULT_TIMEOUT_MS
Default timeout for Bash commands in milliseconds
120,000 (2 min)
BASH_MAX_TIMEOUT_MS
Upper bound for Bash timeouts in milliseconds
600,000 (10 min)
BASH_MAX_OUTPUT_LENGTH
Maximum Bash output in characters. The allowed range ends at 150,000.
30,000
MAX_MCP_OUTPUT_TOKENS
Token limit for MCP tool output
25,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
Opt out of telemetry and feature-flag requests. This also removes Remote Control, import, schedule, and Advisor.
Any non-empty value
DO_NOT_TRACK
Alternative telemetry opt-out
1 = 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
ANTHROPIC_API_KEY
API key for Anthropic
Required without subscription
ANTHROPIC_BASE_URL
Alternative base URL for an Anthropic-compatible API
Proxy or own gateway
CLAUDE_CODE_USE_BEDROCK
Use AWS Bedrock as provider
1 = enabled
CLAUDE_CODE_USE_VERTEX
Use Google Vertex AI as provider
1 = enabled
CLAUDE_CODE_USE_FOUNDRY
Use Microsoft Foundry as provider
1 = enabled
HTTP_PROXY / HTTPS_PROXY
Proxy configuration
For corporate networks
Tip
You can set environment variables permanently in your settings.json instead of exporting them in the shell every time, e.g., {"env": {"CLAUDE_CODE_EFFORT_LEVEL": "medium"}}
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://api.githubcopilot.com/mcp/
# 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.
Tip
Available frontmatter fields: name, description, argument-hint, allowed-tools, model, disable-model-invocation, user-invocable, context (fork for subagent), agent (Explore, Plan, etc.) and hooks. Variables: $ARGUMENTS, $0/$1, ${CLAUDE_SKILL_DIR}, ${CLAUDE_SESSION_ID}.
Before writing a skill from scratch, check our directory of 400+ ready-made Claude Code Skills. Many recurring tasks, like test runs, reviews, or deployments, already exist there as ready-to-use SKILL.md downloads.
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
SolutionUse /terminal-setup in supported terminals. Warp, iTerm2, and Windows Terminal support Shift+Enter natively.
Claude doesn't understand project
Wrong start folder
Start in project root, create CLAUDE.md
Token limit reached
Too much context
Use /clear, /compact for smart compression
Commands don't work
Outdated version
Run /doctor, then run claude update only if it recommends an update
MCP server won't connect
Missing configuration
Run claude --debug=mcp for diagnosis
Shift+Enter doesn't work
Terminal setup missing
Use /terminal-setup in supported terminals. Warp, iTerm2, and Windows Terminal support Shift+Enter natively.
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
Warning
/doctor checks installation and configuration. Run claude update only when the diagnosis recommends it. DISABLE_UPDATES also blocks manual updates.
Frequently Asked Questions About Claude Code Commands
Use the @ symbol followed by the file path to reference files. Claude Code then offers autocomplete for paths. You can also use /add-dir to add additional working directories that are then available in the session.
Start with 5-7 basic commands: /clear, /compact, /model, /help, /status, and /exit. These let you manage sessions and context and open help. Expand your repertoire once you have mastered the basics.
Yes! Create a SKILL.md file in .claude/skills/my-skill/ for project skills or ~/.claude/skills/my-skill/ for personal skills. Use YAML frontmatter for allowed-tools, description, argument-hint, and model. This is perfect for recurring tasks in your workflow.
Use /compact to intelligently compress the context. You can optionally pass focus instructions, e.g., /compact 'Focus on the API implementation'. Alternatively, use /clear to delete the complete context for a fresh start.
Availability depends on the model, platform, plan, and provider. That is especially true for effort levels, thinking, remote features, and individual integrations. Check /model, /effort, and /help in your own session instead of relying on a universal model list.
Use 'claude mcp add --transport http' followed by a name and server URL. The official GitHub endpoint is https://api.githubcopilot.com/mcp/. Manage the configuration via /mcp. Configure Tool Search with ENABLE_TOOL_SEARCH.
Use Claude in headless mode with --output-format json or stream-json. Combine this with -p for one-time execution without interactive mode and --max-turns to limit the number of agentic turns. Example: claude -p 'Fix ESLint errors' --output-format json --max-turns 5
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.