Verified
New (recent release)
Unverified
BUILDER: claude -p ""

Keys & Shortcuts

General Controls

Ctrl C / DCancel input / Exit session
Ctrl LClear screen + full redraw
Ctrl OToggle verbose output
Ctrl RReverse search history
Ctrl GOpen prompt in external editor
Ctrl BBackground running task
Ctrl TToggle task list
Ctrl VPaste image from clipboard
Ctrl X KKill background agents (chord, x2)
Esc EscRewind / undo state

Mode & Input

TabCycle permission modes
\ PSwitch model
\ TToggle thinking on/off
\ EnterNewline (quick)
Ctrl JNewline (control seq)

Session Picker Nav

P / RPreview / Rename session
/Search sessions
A / BFilter All projects / Current branch

Slash Commands (Core)

Session Management

/clearClear conversation context
/compact [focus]Compact context to free space
/resumeDisplay session picker menu
/rename [name]Name current session
/branch [name]Branch convo (formerly /fork)
/costToken usage & per-model cost breakdown
/contextVisualize context window (grid)
/diffInteractive diff viewer
/copyCopy last response
/exportExport conversation

Configuration

/configOpen settings interface
/model [model]Switch model manually
/effort [level]Set effort (low/med/high/auto)
/fast [on/off]Toggle Fast mode
/permissionsView/update tool permissions
/color [color]Set prompt-bar color
/keybindingsCustomize keyboard shortcuts
/terminal-setupConfigure terminal integration
/themeChange color theme
/release-notesInteractive version picker for release notes

Slash Commands (Tools)

Development Tools

/initCreate CLAUDE.md memory
/memoryEdit CLAUDE.md files directly
/mcpManage MCP servers
/hooksManage event lifecycle hooks
/skillsList available active skills
/agentsManage sub-agents
/chromeChrome browser integration
/add-dir <path>Add working directory to context
/reload-pluginsHot-reload local plugins

Special & Utility

/btw <query>Side question (does not alter context)
/plan [desc]Switch to Plan Mode directly
/loop [interval]Schedule recurring background task
/scheduleCloud scheduled tasks
/voicePush-to-talk voice prompting
/doctorDiagnose installation/env issues
/pr-comments [PR]Fetch GitHub PR comments
/security-reviewSecurity analysis of uncommitted code
/powerupInteractive lessons teaching CC features with animated demos
/stats / /insightsUsage streaks / HTML sessions report
/desktopContinue session in Desktop app
/remote-controlBridge session to claude.ai/code

CLI & Headless Flags

Core Execution

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
claude --fork-sessionFork existing session on resume

Headless & CI Flags

--bareMinimal headless (no hooks/LSP)
--channelsPermission relay / MCP push msg
--output-format jsonStructured JSON output
--json-schemaStrict JSON schema validation
--dangerously-skip-permissionsSkip all approval prompts

State & Behavior

-w / --worktreeStart in isolated git worktree
--effortSet effort level (low/med/high)
--modelOverride specific model at launch
--fallback-modelFallback if primary is overloaded
--permission-mode planStart in read-only plan mode
--max-budget-usdSet cost cap for session
--remoteStart web-accessible session
--remote-control-session-name-prefixCustom hostname prefix for Remote Control session names

Config & Environment

Files & Priority

~/.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

modelOverridesMap model picker to custom IDs
autoMemoryDirectoryCustom auto-loaded memory dir
worktree.sparsePathsSparse checkout dirs for agents
showThinkingSummariesShow thinking summaries in interactive sessions (default: false)
disableSkillShellExecutionDisable inline shell execution in skills and custom slash commands
forceRemoteSettingsRefreshBlock startup until remote managed settings are freshly fetched; fail-closed on fetch failure

Environment Variables

ANTHROPIC_API_KEYAuth override
ANTHROPIC_MODELDefault model override
CLAUDE_CODE_EFFORT_LEVELDefault effort (low/med/high)
MAX_THINKING_TOKENSCap extended thinking limits
CLAUDE_CODE_PLUGIN_SEED_DIRMultiple plugin seed directories
IS_DEMODemo mode (hides email/org)
CLAUDECODEDetects if running inside CC shell
CLAUDE_CODE_SUBPROCESS_ENV_SCRUBStrip credentials from subprocesses
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)

Skills & Agent Frontmatter

Built-in Skills & Locations

/simplifyCode review (3 parallel agents)
/batchLarge parallel changes (5-30 worktrees)
/claude-apiLoad API + SDK reference into context
.claude/skills/<name>/Project specific skill directory
~/.claude/skills/<name>/Global personal skill directory
plugin: bin/Plugin executables in bin/ invocable as bare commands from Bash tool

Skill YAML Frontmatter

descriptionAuto-invocation trigger string
effortOverride effort level specifically for skill
allowed-toolsSkip permission prompts for skill
context: forkRun skill logic in an isolated subagent
$ARGUMENTSUser input placeholder replacement
$FILE_PATHFile path resolution (hook strings only)
${CLAUDE_SKILL_DIR}Reference the skill's own directory
! 'cmd'Dynamic bash execution context injection

Agent YAML Frontmatter

permissionModedefault / acceptEdits / plan / bypass
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

Memory, Hooks & MCP

Rules & Auto-Memory

.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

PreToolUse / PostToolUseIntercept before/after tool execution
SubagentStart / StopLifecycle triggers for agent spawning
SessionEndRun cleanup script when session closes
CwdChanged / FileChangedReact to directory or file changes
TaskCreatedFires when task created via TaskCreate
if: (hook field)Conditional execution (permission rule syntax)
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

MCP Servers

claude mcp list/add/removeStandard MCP server management
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)

Auth Commands

claude auth login/logoutSession authentication control
claude auth statusCheck current authentication validity