Verified
New (recent release)
Unverified
Builder ▸ claude -p ""

Keys & Shortcuts

General Controls

ItemDescription
Ctrl C / DCancel input / Exit session
Ctrl LClear screen + full redraw; in fullscreen mode, always just repaints — the double-press /clear shortcut was removed
Ctrl OToggle between normal and verbose transcript; in a collapsed thinking group, shows the full thinking; focus view toggled with /focus
Ctrl RHistory picker — searches all projects by default; press Ctrl S to narrow to current project or session
Ctrl GOpen prompt in external editor
Ctrl BBackground running task
Ctrl TToggle task list; in claude agents: pin/unpin background session (pinned sessions stay alive when idle, restart in place for CC updates)
Ctrl VPaste image from clipboard
Ctrl BackspaceDelete previous word (Windows)
Ctrl UClear entire input buffer (Ctrl+Y to restore)
Ctrl YRestore input buffer cleared by Ctrl+U
Ctrl X KKill background agents (chord, x2)
Ctrl XIn claude agents: permanently removes a completed session; deleted background jobs stay deleted
Esc EscRewind / undo state
EscClose background-tasks, diff, and workflow detail views (left arrow no longer closes these)
selection:clearKeybinding action — bind to a key in /keybindings to clear an in-app text selection; works in agents view

Mode & Input

ItemDescription
TabCycle permission modes
\ PSwitch model
\ TToggle thinking on/off
\ EnterNewline (quick)
Ctrl JNewline (control seq)
Ctrl A / Ctrl EMove to start/end of current logical line (multiline input)

Session Picker Nav

ItemDescription
P / RPreview / Rename session
/Search sessions
A / BFilter All projects / Current branch
Ctrl AShow all projects in /resume picker (picker defaults to current dir)

Transcript View

ItemDescription
[Dump transcript to scrollback
vOpen transcript in editor
?Show keyboard shortcuts in transcript nav view
{ / }Jump between user prompts in transcript nav view
v (nav view)Toggle shortcut panel in transcript nav view

Vim Mode

ItemDescription
v / VVisual / visual-line selection mode (NORMAL mode)
/ (NORMAL mode)Open reverse history search (like Ctrl+R), matching bash/zsh vi-mode
s / SSubstitute char / substitute line in NORMAL mode, matching vim behavior

Slash Commands (Core)

Session Management

ItemDescription
/clearClear conversation context; resets the per-session subagent spawn budget
/compact [focus]Compact context to free space
/resumeDisplay session picker menu; background sessions (from --bg or agent view) now appear alongside interactive sessions, marked with bg; offers to summarize stale large sessions before re-reading; in the agent view, opens a picker of past sessions including deleted ones and resumes the chosen session as a background session
/rename [name]Name current session
/branch [name]Branch conversation
/forkCopy conversation into a new background session (its own row in claude agents) with its own git worktree, while you keep working in the current session; old in-session subagent behavior moved to /subtask
/subtaskLaunch an in-session subagent for the current task; formerly what /fork did before v2.1.212
/usageUnified usage view (cost + stats tabs); per-category limits breakdown (skills, subagents, plugins, per-MCP-server cost); Loops tab shows per-loop run count, total tokens, tokens per run, and last run — easy to spot runaway or chatty /loop tasks; /cost and /stats are shortcuts that open the relevant tab
/usage-creditsRequest extra usage allowance; asks for confirmation before sending to organization admins; old name /extra-usage still works; accessible from Remote Control clients
/contextVisualize context window (grid)
/diffInteractive diff viewer; detail view scrollable with arrows, j/k, PgUp/PgDn, Space, Home/End
/copyCopy last response
/exportExport conversation
/recapSummarize away context; auto-triggered on return or invoke manually
/rewind / /undoRewind conversation to previous state; /undo is alias; supports resuming a conversation from before /clear was run
/goal [condition]Set a completion condition; Claude keeps working across turns until met; works in interactive, -p, and Remote Control; shows live elapsed/turns/tokens overlay; clears itself on unrecoverable errors (revoked auth, exhausted credits, context overflow); checks in on background tasks waiting 30+ min (set CLAUDE_CODE_GOAL_CHECKIN_MINUTES=0 to opt out); idle sessions start at most three check-ins per goal — your next message allows three more; check-ins back off (30 min → 1 h → 2 h) instead of repeating every 30 min; resuming via claude --resume restores the active goal
/cdMove session to a new working directory without breaking the prompt cache mid-session; project settings, hooks, .mcp.json servers (behind the usual approval prompt), skills, and agents take effect immediately after the move instead of on --resume; supports directory path suggestions (matching /add-dir)

Configuration

ItemDescription
/configOpen settings interface; search matches option values; Enter and Space change the selected setting; Esc saves and closes
/config key=valueSet any setting from the prompt (e.g. /config thinking=false) — works in interactive, -p, and Remote Control
/config --helpList all available shorthand keys for /config key=value
/model [model]Switch model; selection saved as default for new sessions; claude-sonnet-5 is now the default (native 1M-token context); press s in picker to switch for current session only; warns before switching mid-conversation; startup header shows model pin source; lists models from gateway's /v1/models when ANTHROPIC_BASE_URL points at a compatible gateway; org-restricted models show "restricted by your organization's settings"
/effort [level]Set effort (low/med/high/xhigh/auto); no args opens interactive slider (Faster/Smarter labels); xhigh is Opus 4.8 only; confirms when chosen level will persist as the default for new sessions
/fast [on/off]Toggle Fast mode
/permissionsView/update tool permissions; can be opened while Claude is working — rule changes apply to the rest of the current turn; Auto mode tab shows and edits auto mode classifier rules
/color [color]Set prompt-bar color; bare /color with no args picks a random session color
/keybindingsCustomize keyboard shortcuts
/terminal-setupConfigure terminal integration; configures scroll sensitivity and disables GPU acceleration in VS Code, Cursor, and Devin Desktop to prevent garbled-text rendering; enables iTerm2 clipboard access for /copy
/themeChange color theme; create/switch named custom themes, hand-edit ~/.claude/themes/; plugins ship via themes/ dir; includes "Auto (match terminal)"
/tui [fullscreen]Switch to flicker-free fullscreen TUI rendering in same conversation
/focusToggle focus view (fullscreen/TUI mode)
/release-notesInteractive version picker for release notes
/scroll-speedTune mouse wheel scroll speed with a live preview

Slash Commands (Tools)

Development Tools

ItemDescription
/initCreate CLAUDE.md memory
/memoryEdit CLAUDE.md files directly
/mcpManage MCP servers; shows tool count for each connected server and flags servers with 0 tools; shows HTTP status and error text when a server fails to connect; warns for MCP config values with hidden leading or trailing whitespace; shows a managed marker on claude.ai connectors whose authentication is managed by your organization
/hooksManage event lifecycle hooks
/install-github-appInstall the GitHub App; GitHub Actions workflow and repo secret setup is optional — install just the GitHub App and skip the workflow/secret steps
/commit-push-prCommit, push, and open a PR in one step; auto-allows git push to the repo's configured push remote (remote.pushDefault, or the sole remote when only one is configured) in addition to origin; git/gh commands with dangerous flags (--force, --amend, --no-verify, etc.) are no longer auto-approved
/skillsList available active skills; includes type-to-filter search box for long lists
/chromeChrome browser integration; pick which connected browser to use via /chrome → "Select browser…", or in-chat when a browser action runs with multiple connected
/add-dir <path>Add working directory to context; usable while Claude is working
/reload-pluginsHot-reload local plugins; auto-installs missing dependencies from added marketplaces
/reload-skillsRe-scan skill directories without restarting the session
/plugin listList installed plugins; --enabled/--disabled filters; search bar available when browsing marketplace plugins; surfaces recently-unused plugins for cleanup
/plugin install <name>Install a plugin from the marketplace; supports archive source — install from a zip over HTTPS without git or npm, with optional SHA-256 pinning; refreshes a stale catalog and retries before reporting not found; activates immediately when safe without requiring /reload-plugins

Special & Utility

ItemDescription
/btw <query>Side question (does not alter context); press c to copy raw markdown answer to clipboard; ←/→ to step through earlier answers
/plan [desc]Switch to Plan Mode directly
/loop [interval]Schedule recurring background task
/proactiveAlias for /loop — schedule recurring background task
/scheduleCloud scheduled tasks
/deep-researchStructured deep-research session; must be explicitly invoked — Claude no longer auto-starts it
/workflowsView and manage dynamic workflow runs; workflows orchestrate work across tens to hundreds of background agents for large, complex tasks; press f in the agent detail view to filter by status
ultracodePrompt trigger keyword — type in the prompt to start a dynamic workflow; highlighted in violet in the prompt input
/voicePush-to-talk voice prompting
/doctorFull setup checkup — diagnoses and fixes CC installation/env issues; press f to auto-fix; openable while Claude is responding; shows result of last update attempt; lists npm auto-update fix hints; proposes trimming checked-in CLAUDE.md files by cutting content Claude could derive from the codebase; /checkup is an alias
/statusShow CC environment status and warnings (e.g. "claude command missing or broken"); shows session kind: interactive, or a background job that is attached or unattended; shows Skipped sources line listing managed settings sources present but not applied; shows GitHub connection status for Claude Code on the web (Pro/Max); moved from startup output in v2.1.203
/pr-comments [PR]Fetch GitHub PR comments
/security-reviewSecurity analysis of uncommitted code
/powerupInteractive lessons teaching CC features with animated demos
/stats / /insightsShortcut to /usage stats tab / HTML sessions report
/desktopContinue session in Desktop app
/remote-controlBridge session to claude.ai/code
/team-onboardingGenerate teammate ramp-up guide from local CC usage
/advisorAI advisor mode; Fable 5 available for organizations with Fable access — enable via /model fable

CLI & Headless Flags

Core Execution

ItemDescription
claudeStart interactive REPL
claude -p "q"Headless execution (scripting)
claude -c / -r "n"Continue last / Resume specific
claude --from-prResume session linked to a PR; accepts GitHub, GitLab MR, Bitbucket PR, and GitHub Enterprise URLs
claude --fork-sessionFork existing session on resume
claude --teleport <session-id>Continue a cloud session locally; session ID shown in the /teleport hint that appears in cloud sessions
claude ultrareview [target]Run /ultrareview non-interactively from CI or scripts; prints findings to stdout; use --json for raw output
claude project purge [path]Delete all Claude Code state for a project (transcripts, tasks, file history, config entry); supports --dry-run, -y/--yes, -i/--interactive, and --all
claude auto-mode resetRestore default auto-mode configuration; prompts for confirmation (pass --yes to skip)
claude agentsAgent view (Research Preview) — single list of every CC session; running, blocked on you, or done; type ! <cmd> to launch a shell command as a background session you can attach/detach; --cwd <path> scopes list to a directory; --json lists live sessions as JSON (includes waitingFor, id, and state fields); --all flag includes completed sessions; dispatch flags for background sessions: --add-dir, --settings, --mcp-config, --plugin-dir, --permission-mode, --model, --effort, --agent, --dangerously-skip-permissions
claude --bg --exec '<cmd>'Run a shell command as a background session you can attach to and detach from; equivalent to typing ! <cmd> inside claude agents
claude self-hosted-runnerTurn your own machine or container into a session host for Claude Code web, mobile, and desktop sessions (Team and Enterprise plans)
claude self-hosted-runner --defer-shutdown-max-min <minutes>On SIGTERM, keep serving attached sessions for up to the given number of minutes before parking remaining sessions and exiting
claude self-hosted-runner --proxy-authorization-command / --proxy-authorization-fileSupply a freshly issued Proxy-Authorization header on every connection for egress proxies that require per-request credentials
claude remote-control --continueResume the most recent Remote Control session

Headless & CI Flags

ItemDescription
--bareMinimal headless (no hooks/LSP)
--channelsPermission relay / MCP push msg; now works with console (API key) auth — console orgs with managed settings must set channelsEnabled: true
--output-format jsonStructured JSON output
--json-schemaStrict JSON schema validation
--dangerously-skip-permissionsSkip all approval prompts; bypasses prompts for writes to .claude/, .git/, .vscode/, shell config files, and other protected paths (catastrophic removal commands still prompt)
--exclude-dynamic-system-prompt-sectionsExclude dynamic prompt sections in print mode for cross-user prompt caching
--forward-subagent-textInclude subagent text and thinking in --output-format stream-json output; paired with CLAUDE_CODE_FORWARD_SUBAGENT_TEXT env var

State & Behavior

ItemDescription
-w / --worktreeStart in isolated git worktree
--effortSet effort level (low/med/high/xhigh); xhigh is Opus 4.8 only
--modelOverride specific model at launch
--fallback-modelFallback model for when the primary model is overloaded or unavailable; applies to interactive sessions and headless (-p) mode; configure up to three in order via fallbackModel JSON setting
--thinking disabledDisable thinking on models that think by default; equivalent to MAX_THINKING_TOKENS=0 or toggling the per-model thinking switch
--permission-mode planStart in read-only plan mode
--permission-mode manualStart in manual (default) permission mode; renamed from default — both values accepted
--max-budget-usdSet cost cap for session
--remoteStart web-accessible session
--remote-controlEnable Remote Control mode; bridges CLI session to claude.ai/code
--remote-control-session-name-prefixCustom hostname prefix for Remote Control session names
--plugin-dir <path>Load plugins from a directory or .zip archive at launch
--plugin-url <url>Fetch a plugin .zip archive from a URL for the current session
--safe-modeStart with all customizations (CLAUDE.md, plugins, skills, hooks, MCP servers) disabled for troubleshooting; paired with CLAUDE_CODE_SAFE_MODE env var
--ax-screen-readerEnable screen reader mode — opt-in plain-text rendering for screen reader users; also set via CLAUDE_AX_SCREEN_READER=1 env var or axScreenReader: true in settings

Config & Environment

Files & Priority

ItemDescription
~/.claude/settings.jsonUser global defaults
.claude/settings.jsonProject shared (committed)
.claude/settings.local.jsonProject local only (gitignored)
~/.claude.jsonOAuth, MCP, state configuration
.mcp.jsonProject-specific MCP servers
managed-settings.d/Drop-in policy fragments (alphabetical merge)

Key JSON Settings

ItemDescription
modelOverridesMap model picker to custom IDs
modelPicker Curate the /model picker with an ordered, labeled list of models (any id spelling, including Vertex/Bedrock ids); entries are appended to or replace the built-in lineup
modelPricing Managed setting — set an organization's contracted per-model rates and discount multiplier; used for /cost, the status line, and telemetry cost figures instead of list price
promptCacheTtl / subagentPromptCacheTtl Set a 1-hour prompt cache TTL for the main conversation (promptCacheTtl) while subagents stay at 5 minutes (subagentPromptCacheTtl); for API-key and cloud-provider users
defaultModeSet default permission mode; "manual" (formerly "default") — both values accepted; paired with --permission-mode CLI flag
autoMemoryDirectoryCustom auto-loaded memory dir
worktree.sparsePathsSparse checkout dirs for agents
worktree.baseReffresh (default) branches worktrees from origin/<default>; head branches from local HEAD — applies to --worktree, EnterWorktree, and agent-isolation
worktree.bgIsolationSet to "none" to disable worktree isolation for background sessions
agentDefault agent name for dispatched sessions in claude agents; override per-session with --agent <name>
fallbackModelConfigure up to three fallback models tried in order when the primary model is overloaded or unavailable; paired with --fallback-model CLI flag
showThinkingSummariesShow thinking summaries in interactive sessions (default: false)
languagePin session-title language; titles auto-detect the conversation language by default — set to a BCP 47 tag (e.g. en, ja) to override
disableSkillShellExecutionDisable inline shell execution in skills and custom slash commands
skillOverridesoff hides skill from model and /; user-invocable-only hides from model only; name-only collapses description
forceRemoteSettingsRefreshBlock startup until remote managed settings are freshly fetched; fail-closed on fetch failure
statusLine.refreshIntervalRe-run status line command every N seconds
workspace.git_worktreeStatus line JSON input field — set when current directory is inside a linked git worktree
effort.level / thinking.enabledHooks and status line stdin JSON input fields — current effort level and thinking state
autoScrollEnabledDisable conversation auto-scroll in fullscreen mode
wheelScrollAccelerationEnabledSet to false to disable mouse-wheel scroll acceleration in fullscreen mode
tuiDefault TUI mode; set to "fullscreen" for flicker-free alt-screen rendering
axScreenReaderSet to true for opt-in plain-text rendering for screen reader users; paired with --ax-screen-reader flag and CLAUDE_AX_SCREEN_READER=1 env var
spellcheckUnderline misspelled words in the prompt input as you type; requires aspell, hunspell, or ispell to be installed
keybindingFlavorSet to "readline" to make Ctrl+W delete back to the previous whitespace (Bash-style); default "classic" is unchanged; in "readline" mode, Alt+F and Ctrl/Option+→ stop at end of word, Alt+D deletes to it (Ctrl+Y pastes back), and punctuation separates words
outputStyleBuilt-in output style; "concise" makes Claude lead with results and skip preamble and narration while working just as thoroughly; configure via /config → Output style
vimInsertModeRemapsMap two-key insert-mode sequences to keys in vim mode; e.g. map jj to Escape
sandbox.network.deniedDomainsBlock specific domains even when a broader allowedDomains wildcard would otherwise permit them
sandbox.network.strictAllowlistDeny non-allowlisted hosts for sandboxed commands without prompting
sandbox.bwrapPath / sandbox.socatPathCustom bubblewrap and socat binary paths (Linux/WSL managed settings)
sandbox.allowAppleEventsOpt-in macOS setting to allow sandboxed commands to send Apple Events
sandbox.credentialsBlock sandboxed commands from reading credential files and secret environment variables; set mode: "mask" (Linux/WSL) to expose a sentinel copy while the proxy substitutes the real value on egress; supports extract/onExtractNoMatch for structured values, decode: "jwt" with maskClaims for JWT-aware masking, and awsPairs/sigv4 for AWS SigV4 re-signing; requires network.tlsTerminate; macOS falls back to deny
sandbox.filesystem.disabledSkip filesystem isolation while keeping network egress control
wslInheritsWindowsSettingsWSL sessions inherit Windows-side managed settings (policy key)
parentSettingsBehaviorAdmin-tier key: first-wins (default) or merge — opts SDK managedSettings parent tier into policy merge
"$defaults" (autoMode)Include in autoMode.allow, autoMode.soft_deny, or autoMode.environment to add custom rules alongside the built-in list; autoMode settings are read only from ~/.claude/settings.json, not from .claude/settings.local.json
autoMode.hard_denyAuto mode classifier rules that block unconditionally regardless of user intent — unlike autoMode.soft_deny, cannot be overridden by allow exceptions
autoMode.classifyAllShellRoute all Bash/PowerShell commands through the auto-mode classifier instead of only arbitrary-code-execution patterns
disableAutoModeSet to true to disable auto mode on Bedrock, Vertex AI, and Foundry — auto mode is now available there by default without opt-in
"*" (deny rule glob)Glob patterns supported in deny rule tool-name position; "*" denies all tools; allow rules reject non-MCP globs; unknown tool names in deny rules warn at startup
Tool(param:value)Permission rule syntax to match a tool's input parameters (supports * wildcard); e.g. Agent(model:opus) to block Opus subagents
Write(path) / NotebookEdit(path) / Glob(path)Deprecated permission-rule tool names — startup warns to use Edit(path) or Read(path) instead
attribution.sessionUrlSet to false to omit the claude.ai session link from commits and PRs in web and Remote Control sessions
prUrlTemplatePoint footer PR badge at a custom code-review URL instead of github.com
footerLinksRegexesArray of regex patterns for regex-matched link badges in the footer row; configurable via user or managed settings
channelsEnabledSet to true in managed settings to allow --channels with console (API key) auth
allowAllClaudeAiMcpsEnterprise managed setting — load claude.ai cloud MCP connectors alongside managed-mcp.json
pluginSuggestionMarketplacesManaged setting — allowlist org marketplaces whose plugins may be suggested via context-aware tips
additionalMarketplacesAdd plugin marketplace repos beyond the built-in list; friendlier alias for extraKnownMarketplaces
strictKnownMarketplacesManaged setting — allowlist of marketplace repos allowed as plugin sources; supports "owner/*" wildcard to allow all repos under a GitHub org; also accepted as allowedMarketplaces
blockedMarketplacesManaged setting — blocklist of marketplace repos denied as plugin sources; supports "owner/*" wildcard to block all repos under a GitHub org
requiredMinimumVersion / requiredMaximumVersionManaged settings — CC refuses to start if its version is outside the allowed range; directs user to an approved version
disableBundledSkillsHide bundled skills, workflows, and built-in slash commands from the model; paired with CLAUDE_CODE_DISABLE_BUNDLED_SKILLS env var
enforceAvailableModelsManaged setting — when enabled, the availableModels allowlist also constrains the Default model (a Default that resolves to a disallowed model falls back to the first allowed model); user or project settings cannot widen a managed availableModels list
teammateMode: "iterm2"Use iTerm2 as the teammate backend; shows a warning when auto mode cannot find the it2 CLI
awsAuthRefreshConfigures the "Claude Platform on AWS — refresh credentials" option in /login
respondToBashCommandsSet to false to keep ! bash command output as context-only; default behavior is for Claude to respond automatically
dynamicWorkflowSizeControls how large Claude makes dynamic workflows (small/medium/large agent counts) — advisory guideline, not a hard cap; configured via /config
workflowSizeGuidelineSet the advisory Dynamic workflow size guideline from any settings file; the /config row is hidden while one is set
emojiCompletionEnabledSet to false to disable emoji shortcode autocomplete in the prompt input (e.g. :heart: → ❤️)
crossSessionInboundCross-session messages sent to a session running with bypassed permissions are held for your approval before delivery
dialogExpiryTimeout for inbound cross-session message approval dialogs; messages to sessions without bypassed permissions auto-deliver

Environment Variables

ItemDescription
ANTHROPIC_API_KEYAuth override
ANTHROPIC_MODELDefault model override
CLAUDE_CODE_EFFORT_LEVELDefault effort (low/med/high)
MAX_THINKING_TOKENSCap extended thinking limits; set to 0 to disable thinking on models that think by default via the Claude API
CLAUDE_CODE_PLUGIN_SEED_DIRMultiple plugin seed directories
IS_DEMODemo mode (hides email/org)
CLAUDECODEDetects if running inside CC shell; also injected into stdio MCP server subprocess environments
CLAUDE_CODE_SUBPROCESS_ENV_SCRUBStrip credentials from subprocesses; enables PID namespace isolation on Linux (sandboxing)
CLAUDE_CODE_MCP_SERVER_NAME / CLAUDE_CODE_MCP_SERVER_URLInject server identity into MCP headerHelper scripts
CLAUDE_CODE_NO_FLICKER=1Opt into flicker-free alt-screen rendering with virtualized scrollback
MCP_CONNECTION_NONBLOCKING=trueSkip MCP connection wait in headless (-p) mode
CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILUREKeep marketplace cache when git pull fails (offline envs)
CLAUDE_CODE_USE_MANTLE=1Enable Amazon Bedrock powered by Mantle
CLAUDE_CODE_PERFORCE_MODEWhen set, Edit/Write/NotebookEdit fail on read-only files with a p4 edit hint
CLAUDE_CODE_SCRIPT_CAPSLimit per-session script invocations (subprocess sandboxing)
CLAUDE_CODE_CERT_STORE=bundledUse only bundled CAs; by default OS CA cert store is trusted (enterprise TLS proxy support)
OTEL_LOG_USER_PROMPTS / OTEL_LOG_TOOL_DETAILS / OTEL_LOG_TOOL_CONTENTOTEL beta tracing: opt in to emit sensitive span attributes (prompts/tool details/tool content)
OTEL_LOG_ASSISTANT_RESPONSESOpt in to emitting the model's response text as an OTEL log event (claude_code.assistant_response); when unset, follows OTEL_LOG_USER_PROMPTS; set to 0 to log prompts but not responses
ENABLE_PROMPT_CACHING_1HOpt into 1-hour prompt cache TTL (API key, Bedrock, Vertex, Foundry)
FORCE_PROMPT_CACHING_5MForce 5-minute prompt cache TTL
CLAUDE_CODE_ENABLE_AWAY_SUMMARYForce-enable recap/away summary (useful when telemetry disabled)
CLAUDE_CODE_USE_POWERSHELL_TOOLEnable PowerShell tool; on Windows opt in/out, on Linux/macOS requires pwsh on PATH
OTEL_LOG_RAW_API_BODIESEmit full API request/response bodies as OTEL log events for debugging
CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTHConfigure the 60 KB truncation limit on OpenTelemetry content attributes
TRACEPARENT / TRACESTATEDistributed trace context injected from environment for SDK/headless sessions
CLAUDE_CODE_FORK_SUBAGENT=1Enable forked subagents on external (non-Anthropic) builds; also works in non-interactive sessions
DISABLE_UPDATESBlock all update paths including manual claude update; stricter than DISABLE_AUTOUPDATER
CLAUDE_CODE_HIDE_CWDHide working directory in the startup logo
ANTHROPIC_BEDROCK_SERVICE_TIERSelect a Bedrock service tier (default, flex, or priority); sent as the X-Amzn-Bedrock-Service-Tier header
ANTHROPIC_BEDROCK_REGION_PREFIXPrefer a specific Bedrock cross-region inference profile over the AWS_REGION-derived one
CLAUDE_CODE_FORCE_SYNC_OUTPUT=1Force-enable synchronized output on terminals that auto-detection misses (e.g. Emacs eat)
CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATEOn Homebrew or WinGet installs, runs the upgrade command in the background and prompts to restart when set
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1Opt in to listing gateway /v1/models in the /model picker when using a custom ANTHROPIC_BASE_URL gateway (was automatic in v2.1.126–v2.1.128)
CLAUDE_CODE_DISABLE_1M_CONTEXTHold every Claude model with a native 1M context window to 200K via auto-compaction; a startup warning appears when auto-compaction isn't holding the session to 200K
CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1Restore previous behavior where sessions on unrecognized model IDs may grow past the assumed context window; by default, auto-compact now holds unrecognized models within the assumed window
CLAUDE_CODE_SESSION_IDSession ID injected into Bash tool subprocess environment and stdio MCP server subprocess environments, matching the session_id passed to hooks
CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1Opt out of the fullscreen alternate-screen renderer; keeps conversation in the terminal's native scrollback
CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTELRe-enable the session quality survey for enterprises capturing responses through OpenTelemetry
CLAUDE_PROJECT_DIRInjected into MCP stdio server environments; referenceable as ${CLAUDE_PROJECT_DIR} in plugin configs
CLAUDE_CODE_PLUGIN_PREFER_HTTPSClone GitHub plugin sources over HTTPS instead of SSH; for environments without a GitHub SSH key
ANTHROPIC_WORKSPACE_IDWorkload identity federation — scopes the minted token to a specific workspace when the federation rule covers more than one
OTEL_METRICS_INCLUDE_ENTRYPOINT=trueOpt in to including session entrypoint as an OpenTelemetry metric attribute (app.entrypoint)
COLUMNS / LINESInjected into status line command subprocesses so scripts can size output to the terminal width
CLAUDE_CODE_ENABLE_AUTO_MODE=1Previously required to opt in to auto mode on Bedrock, Vertex, and Foundry — no longer needed as auto mode is now available there by default; use disableAutoMode setting to disable
OTEL_RESOURCE_ATTRIBUTESStandard OTEL env var — values are now used as labels on metric datapoints, so you can slice usage metrics by custom dimensions (e.g. team, repo)
CLAUDE_CODE_SAFE_MODEStart with all customizations (CLAUDE.md, plugins, skills, hooks, MCP servers) disabled; paired with --safe-mode CLI flag
CLAUDE_CODE_DISABLE_BUNDLED_SKILLSHide bundled skills, workflows, and built-in slash commands from the model; paired with disableBundledSkills JSON setting
API_FORCE_IDLE_TIMEOUT=0Opt out of the default 5-minute idle timeout on Vertex/Foundry; stalled streams will hang indefinitely instead of aborting
CLAUDE_CLIENT_PRESENCE_FILEPath to a marker file — while the file exists, mobile push notifications are suppressed (signals you're at the machine)
CLAUDE_CODE_MAX_RETRIESRetry attempt limit; cap of 15 is lifted when CLAUDE_CODE_RETRY_WATCHDOG is set — for unattended sessions use the watchdog instead
CLAUDE_CODE_RETRY_WATCHDOGRetry watchdog for unattended sessions; raises default retry count for non-capacity transient errors to 300 and lifts the cap of 15 on CLAUDE_CODE_MAX_RETRIES; fails immediately on organization spend-limit and out-of-credits errors instead of waiting indefinitely
CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUTOverride the default 5-minute idle timeout for remote MCP tool calls; stalled calls abort with an error instead of blocking indefinitely
CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP=1Disable automatic memory-pressure reaping of idle background shell commands
CLAUDE_CODE_DISABLE_MOUSE_CLICKSDisable mouse click/drag/hover in fullscreen mode while keeping wheel scroll active
CLAUDE_AX_SCREEN_READER=1Enable screen reader mode — opt-in plain-text rendering; paired with --ax-screen-reader flag and axScreenReader JSON setting
CLAUDE_CODE_PROCESS_WRAPPERCorporate launcher wrapper — agent view and background service run every Claude Code self-spawn through the specified executable
CLAUDE_CODE_FORWARD_SUBAGENT_TEXTInclude subagent text and thinking in stream-json output; paired with --forward-subagent-text flag
CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSIONSession-wide limit on WebSearch tool calls (default 200); prevents runaway search loops
CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSIONSet a per-session subagent spawn cap; the built-in 200-spawn limit was removed — long-running sessions no longer refuse new agents by default; /clear resets the budget; concurrency and depth limits still apply
CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTSCap on concurrently-running subagents (default 20); prevents a single message from fanning out unbounded background agents
CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTHMax nesting depth for subagent spawning (default 3); set to 1 to disable nesting
CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSThreshold in ms after which long-running MCP tool calls move to background automatically (default 120000 / 2 min); set to 0 to disable
FORCE_HYPERLINK=0Opt out of clickable hyperlinks in footer PR badge links (hyperlinks are on by default even when terminal support can't be detected, e.g. over ssh/tmux)
CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS=0Set to 0 to disable automatic staggering of same-prefix sibling workflow agents; staggering is on by default so later agents reuse the cached prompt prefix
CLAUDE_CODE_TOOL_MEMORY_LIMITOpt-in memory cgroup limit for Bash tool commands on Linux; prevents a runaway build from stalling the session
CLAUDE_CODE_WEBFETCH_CACHE_TTL_MSConfigure the WebFetch session URL cache TTL in milliseconds (default: 15 minutes)
CLAUDE_CODE_ENABLE_TODO_TOOLS=1Re-enable task/todo tools (TaskCreate/Get/Update/List, TodoWrite) on Opus 4.8, Sonnet 5, Fable 5, Mythos 5, and newer models where they are no longer available by default
CLAUDE_CODE_PROJECT_DIR_NAMECustom short name for the per-project transcript directory; for hosts that give each session its own config directory
CLAUDE_CODE_GOAL_CHECKIN_MINUTESSet to 0 to disable automatic check-ins when a /goal is waiting on background tasks for 30+ min
ANTHROPIC_DEFAULT_MODELSets the model new sessions start on; a /model pick still overrides it and persists across restarts — unlike ANTHROPIC_MODEL

Skills & Agent Frontmatter

Built-in Skills & Locations

ItemDescription
/code-review [level] [pr#]Code review; /review is an alias; must be explicitly invoked — Claude no longer auto-runs it; runs as a background subagent — review work no longer fills your conversation; pass a PR number to review a specific PR; use /code-review ultra for a deep cloud review; effort level persists — no arg reuses the last level typed; pass --fix to apply findings to working tree; pass --comment to post findings as inline PR comments; Claude can also start it on its own on Bedrock, Vertex AI, Foundry, through the Claude apps gateway, and when telemetry or non-essential traffic is disabled
/verifyVerify a code change works end-to-end; must be explicitly invoked — Claude no longer auto-runs it
/simplifyCleanup-only review (reuse, simplification, efficiency, altitude) applied to working tree; does not run the full /code-review --fix bug hunt
/batchLarge parallel changes (5-30 worktrees)
/claude-apiLoad API + SDK reference into context; upgrade subcommand migrates Python projects from anthropic 0.x to 1.x (timeouts now use anthropic.Timeout, not httpx.Timeout)
/less-permission-promptsScan transcripts for read-only Bash/MCP calls; propose settings.json allowlist
/ultrareview [PR#]Cloud code review via parallel agents; no args for current branch, PR# for specific PR
/datavizChart and dashboard design guidance with a runnable color-palette validator
/skill-a /skill-b [prompt]Stacked slash-skill invocations — up to 5 leading skills all load simultaneously (e.g. /skill-a /skill-b do XYZ)
.claude/skills/<name>/Project skill directory; auto-loaded without marketplace; nested .claude/skills/ directories also load when working on files there — on a name clash, the nested skill appears as <dir>:<name>
~/.claude/skills/<name>/Global personal skill directory
plugin: bin/Plugin executables in bin/ invocable as bare commands from Bash tool
command (plugin marketplace source)Specify a plugin directory via a local command's output (e.g. from an IDE); re-resolved each session without restart; mode: "link" uses it in place
headersHelper (plugin marketplace / catalog entry)Command that mints HTTP headers (e.g. a short-lived token) for catalog and same-origin archive fetches on a url marketplace; for a catalog entry, runs only on claude plugin install/update after displaying the command; prompts [y/N] or pass -y

Skill YAML Frontmatter

ItemDescription
descriptionAuto-invocation trigger string
effortOverride effort level specifically for skill
allowed-toolsSkip permission prompts for skill
disallowed-toolsRemove tools from the model while the skill or slash command is active
disable-model-invocationPrevent Claude from auto-invoking the skill; Claude is told to ask you to run it manually instead
context: forkRun skill in an isolated subagent; runs in the background by default — opt out per skill with background: false
$ARGUMENTSUser input placeholder replacement
\$Escape to include a literal $ before a digit in skill command bodies
$FILE_PATHFile path resolution (hook strings only)
${CLAUDE_SKILL_DIR}Reference the skill's own directory
${CLAUDE_EFFORT}Current effort level — available in hooks, Bash tool commands, and skill content
! 'cmd'Dynamic bash execution context injection
keep-coding-instructionsControl plugin output style for coding tasks
monitors (plugin manifest)Background monitor support for plugins; auto-arms at session start or on skill invoke
defaultEnabled: false (plugin manifest)Plugin starts disabled by default; enable with /plugin or claude plugin enable; dependency plugins of enabled plugins are still enabled automatically
true/false/yes/no/on/off/1/0Accepted values for boolean frontmatter fields in skills and plugins (case-insensitive); all resolve to true or false

Agent YAML Frontmatter

ItemDescription
permissionModemanual / acceptEdits / plan / bypass; manual replaces default — both accepted
isolation: worktreeRun agent in isolated git worktree
memory: user|projectPersistent memory storage scope
background: trueRun entirely as background task
initialPromptAuto-submit first turn on spawn
SendMessageAuto-resumes stopped agents; supports cross-session messaging — CC sessions can message each other across machines using ListAgents to discover them; can initiate a conversation with a Remote Control session on another machine by name (macOS and Linux); notify_when_idle — ask another session to send one notice when it next goes idle, opt-in, one-shot, no polling (macOS and Linux); ListAgents now reports a session's own name (the identifier peers use to message it) and lists live teammates alongside subagents and other sessions
hooks:Agent lifecycle hooks; fire when running as main-thread agent via --agent
mcpServersMCP servers for the agent; now loaded for main-thread agent sessions via --agent

Plugin CLI Commands

ItemDescription
claude plugin enable/disable <name>Enable or disable an installed plugin; cloud-synced plugins (from claude.ai) appear as <name>@synced and are managed with claude plugin enable/disable <name>@synced; synced plugins never override a locally installed same-named plugin
claude plugin init <name>Scaffold a new plugin in .claude/skills
claude plugin tagCreate release git tags for plugins with version validation
claude plugin pruneRemove orphaned auto-installed plugin dependencies; plugin uninstall --prune cascades
claude plugin details <name>Show a plugin's component inventory and projected per-session token cost
claude plugin validateValidate plugin manifest; warns when a marketplace or plugin name would be rejected by Claude Desktop's managed marketplace sync; also checks a bare .claude/skills directory, reporting SKILL.md files whose frontmatter fails to parse

Memory, Hooks & MCP

Rules & Auto-Memory

ItemDescription
.claude/rules/*.mdProject specific structural rules
~/.claude/rules/*.mdUser specific global rules
paths: (frontmatter)Path-specific rule triggers
@path/to/fileImport file directly in CLAUDE.md
.../memory/MEMORY.mdTopic files, automatically loaded

Event Hooks

ItemDescription
PreToolUse / PostToolUseIntercept before/after tool execution; PostToolUse hook input includes duration_ms; can replace tool output via hookSpecificOutput.updatedToolOutput for all tools
PostToolUseFailureFires when a tool call fails; hook input includes duration_ms
SessionStartFires on session start/resume; return reloadSkills: true to re-scan skill directories; set hookSpecificOutput.sessionTitle to name the session; reports source "fork" when a session begins as a fork instead of "resume"
SubagentStart / Stop / SubagentStopLifecycle triggers for agent spawning; sub-agents can spawn their own sub-agents (up to 5 levels deep); Stop and SubagentStop hook input includes background_tasks and session_crons fields; Stop and SubagentStop can return hookSpecificOutput.additionalContext to give Claude feedback and continue the turn
SessionEndRun cleanup script when session closes
CwdChanged / FileChangedReact to directory or file changes
TaskCreatedFires when task created via TaskCreate
DirectoryAddedFires after /add-dir or the SDK register_repo_root registers a new working directory mid-session
if: (hook field)Conditional execution (permission rule syntax); single-segment dir/** if: conditions match only <cwd>/dir — write **/dir/** for any-depth matching (deny/ask permission rules keep any-depth match)
"Bash,PowerShell" (hook matcher)Comma-separated tool type names in a hook's matcher field — fires the hook on any of the listed types; e.g. "Bash,PowerShell" fires on both Bash and PowerShell commands
mcp__name__.* (hook matcher pattern)Hyphenated hook matcher identifiers exact-match — use mcp__name__.* glob to match all tools from a hyphenated MCP server (e.g. mcp__brave-search__.*)
PermissionDeniedFires after auto mode classifier denials; return {retry:true} to allow retry
"defer" (PreToolUse)Headless sessions pause at tool call; resume with -p --resume to re-evaluate
UserPromptSubmitFires on user prompt submit; supports hookSpecificOutput.sessionTitle to set session title
PreCompactFires before compaction; block by exiting with code 2 or returning {"decision":"block"}
type: "mcp_tool" (hook)Hook directly invokes an MCP tool
args: string[] (hook field)Exec form — spawns command directly without a shell; path placeholders never need quoting
$CLAUDE_PLUGIN_OPTION_<KEY>Hook env var for accessing plugin config option values in exec-form hook commands; use instead of ${user_config.*} in shell-form commands (shell-form ${user_config.*} is now rejected as a security fix)
continueOnBlock (PostToolUse)Set to true to feed the hook's rejection reason back to Claude and continue the turn
terminalSequence (hook output)Hook JSON output field — emit desktop notifications, window titles, and bells without a controlling terminal
MessageDisplayFires as assistant message text is displayed; hooks can transform or hide the output
EnterWorktreeFires when entering a worktree; can now switch between Claude-managed worktrees mid-session; asks for confirmation before entering a git worktree outside the project's .claude/worktrees/ directory
NotificationFires when a background agent session needs input or finishes; events: agent_needs_input / agent_completed

MCP Servers

ItemDescription
claude mcp list/add/removeStandard MCP server management; claude mcp list/get show unapproved .mcp.json servers as ⏸ Pending approval instead of auto-connecting; disabled servers now show as ⊘ Disabled without connecting for a health check
claude mcp login/logout <name>Authenticate or de-authenticate an MCP server from the CLI without opening /mcp; --no-browser redirects auth code to stdin for SSH completion
claude mcp serveRun Claude Code as an MCP server
--transport http/stdio/sseProtocol connection methods
ElicitationServers can request input mid-task
_meta["anthropic/maxResultSizeChars"]Override max MCP result size per call (up to 500K chars)
alwaysLoad (MCP server config)When true, all tools from that server skip tool-search deferral and are always available
roots/listSession additional working directories (from /add-dir) are included in MCP roots/list; notifications/roots/list_changed sent to servers when the set changes

Auth Commands

ItemDescription
claude auth login/logoutSession authentication control; auth login accepts OAuth code pasted in terminal when browser callback can't reach localhost (WSL2, SSH, containers)
claude auth statusCheck current authentication validity
No matches — clear search to see everything.