EnterSend message / confirm
EscCancel current input
Esc EscRewind / summary menu
Ctrl+CCancel input or generation
Ctrl+DExit Claude Code
Shift+TabCycle permission modes
Ctrl+BSend task to background
Ctrl+RSearch history
Ctrl+LClear screen (keeps conversation)
Ctrl+OOpen/close verbose transcript
Ctrl+TShow/hide task list
Ctrl+SStash current prompt
↑/↓Navigate command history
←/→Cycle tabs / footer
\ + EnterMulti-line input
Ctrl+GOpen in external editor
Ctrl+VPaste image (screenshots, diagrams)
Ctrl+KDelete to end of line
Ctrl+UDelete from cursor to beginning
Ctrl+YPaste deleted text
Ctrl+_Undo last action
Alt+B / Alt+FMove back / forward one word
Option+PModel selector NEW
Option+TToggle extended thinking NEW
Alt+OToggle fast mode NEW
?Show all shortcuts NEW
Space (hold)Push-to-talk (if /voice enabled)
Alt+YCycle paste history (after Ctrl+Y)
Ctrl+JNewline (control sequence)
Option+EnterNewline (macOS)
Ctrl+X Ctrl+KKill all background agents (×2 to confirm)
Ctrl+X Ctrl+EOpen in external editor (alias Ctrl+G)
/Slash command or skill
!Bash mode — run a shell command
@Autocomplete file/folder/agent
Y / EnterConfirm
N / EscDeny
Ctrl+EToggle permission explanation
Ctrl+DToggle permission debug info
/terminal-setup for Shift+Enter. /keybindings to customize. Contexts: Global, Chat, Confirmation, Transcript, etc. (17 contexts)./clear | Reset the conversation (alias: /reset, /new) |
/compact [focus] | Compact with optional focus |
/resume [session] | Resume by ID or name (alias: /continue) |
/rewind | Go back to a checkpoint (alias: /checkpoint) |
/rename [name] | Rename the session |
/branch [name] | Branch the conversation (alias: /fork) |
/export [file] | Export conversation as text |
/copy [N] | Copy response N to clipboard |
/cost | Show costs and tokens |
/context | Color-coded context consumption grid |
/tasks | List and manage background tasks |
/model [name] | Switch model (sonnet, opus, haiku) |
/effort [level] | low / medium / high / max / auto |
/fast [on|off] | Toggle fast output mode |
/config | Configuration panel (alias: /settings) |
/permissions | Manage permissions (alias: /allowed-tools) |
/mcp | Manage MCP servers & OAuth |
/hooks | View configured hooks |
/theme | Change theme (light, dark, daltonized, ANSI) |
/color [color] | Prompt bar color |
/sandbox | Toggle sandbox mode |
/vim | Toggle vim / normal mode |
/init | Create CLAUDE.md for the project |
/memory | Edit CLAUDE.md & memory, toggle auto-memory |
/add-dir <path> | Add a working directory |
/diff | Interactive diff of changes NEW |
/review | Code review (deprecated → code-review plugin) |
/security-review | Scan for vulnerabilities NEW |
/insights | HTML usage analysis report |
/stats | Visualize daily usage, streaks, preferences |
/pr-comments [PR] | GitHub PR comments |
/plan [desc] | Enter plan mode with optional description |
/simplify | Analyze code for reuse, quality, efficiency |
/batch [task] | Parallel changes in worktrees |
/debug [desc] | Session troubleshooting |
/plugin | Manage Claude Code plugins |
/reload-plugins | Reload all active plugins |
/agents | Manage sub-agents |
/skills | List available skills |
/chrome | Configure Claude in Chrome |
/ide | Manage IDE integrations |
/loop [interval] | Repeat a prompt at interval |
/schedule | Cloud-scheduled tasks NEW |
/btw | Quick question without tools or history |
/voice | Push-to-talk voice dictation NEW |
/teleport | Resume a web session locally |
/desktop | Transfer to Desktop app NEW |
/remote-control | Make session accessible from claude.ai |
/remote-env | Configure default remote environment |
/help | Help and command reference |
/doctor | Check installation and auth |
/status | Version and account info |
/usage | Plan limits and rate limits |
/extra-usage | Configure extra usage |
/feedback | Submit a report (alias: /bug) |
/release-notes | View full changelog |
/login / /logout | Login / Logout |
/upgrade | Upgrade to higher plan |
/privacy-settings | Privacy settings |
/keybindings | Open keybindings file |
/terminal-setup | Configure terminal keybindings |
/statusline | Configure the status line |
/install-github-app | Install the GitHub Actions app |
/install-slack-app | Install the Slack app via OAuth |
/exit | Exit (alias: /quit) |
/mobile | QR code for mobile app (alias: /ios, /android) |
/passes | Share a free week of Claude Code |
/stickers | Order Claude Code stickers |
claude | Interactive session |
claude "query" | Start with an initial prompt |
claude -p "query" | Print mode — output and exit |
claude -c | Resume last conversation |
claude -r "id" | Resume by name or ID |
claude -n "name" | Name the session |
claude -w branch | Isolated git worktree |
--model sonnet | Choose the model |
--model opus[1m] | Opus + 1M context |
--effort high | Thinking level (low/medium/high/max/auto) |
--fallback-model | Fallback model if overloaded |
--add-dir ../path | Additional directories |
--bare | Skip hooks, plugins, MCP, CLAUDE.md |
--verbose | Detail for each turn |
--debug "api,hooks" | Debug by categories |
--chrome / --no-chrome | Enable/disable Chrome |
--ide | Auto-connect IDE at startup |
--permission-mode plan | Read-only mode |
--permission-mode auto | AI classifies permissions |
--allowedTools | Auto-approved tools |
--disallowedTools | Tools removed from context |
--tools | Restrict built-in tools |
--enable-auto-mode | Unlock Auto in Shift+Tab |
--permission-prompt-tool | MCP tool for permissions (headless) |
--dangerously-skip-permissions | Equivalent of bypassPermissions |
--output-format json | Structured JSON output |
--output-format stream-json | Real-time streaming JSON |
--input-format | Input format (text, stream-json) |
--include-partial-messages | Include partial streaming events |
--json-schema '{}' | Force an output schema |
--max-turns 5 | Limit agentic turns |
--max-budget-usd 2 | Spending limit |
--system-prompt "text" | Override the system prompt |
--system-prompt-file | Load from a file |
--append-system-prompt | Append text to the prompt |
--append-system-prompt-file | Append from a file |
--remote "task" | Remote session on claude.ai |
--remote-control | Enable remote control |
--tmux | Worktree + tmux pane NEW |
--teammate-mode | Agent teams: auto/in-process/tmux |
--agent name | Run as agent |
--agents | Define agents via JSON |
--from-pr 42 | Resume from a PR NEW |
--fork-session | Fork while keeping context NEW |
--teleport | Resume a web session |
--mcp-config | Load MCP servers |
--strict-mcp-config | Use ONLY these MCP servers |
--plugin-dir | Load plugins from a directory |
--settings | Custom JSON settings file |
--init / --init-only | Run init hooks (and exit) |
--maintenance | Run maintenance hooks and exit |
--disable-slash-commands | Disable skills and commands |
--no-session-persistence | Disable persistence (print) |
--session-id | Specific session UUID |
--agents | Define dynamic agents via JSON |
--channels | MCP notifications to listen to (research preview) |
--setting-sources | Setting sources to load (user, project, local) |
--betas | Beta headers for API requests |
claude update | Update |
claude auth login | Login (--email, --sso, --console) |
claude auth status | Auth status (JSON or --text) |
claude agents | List configured agents |
claude mcp | Manage MCP servers |
claude plugin | Manage plugins |
claude auto-mode defaults | Default auto-mode rules |
claude auto-mode config | Effective config with settings |
Managed | Enterprise policy, highest priority |
Project | ./CLAUDE.md or ./.claude/CLAUDE.md |
User | ~/.claude/CLAUDE.md |
Imports: @docs/standards.md (max 5 levels)
Size: Keep < 200 lines, @path to split
Files in .claude/rules/*.md, activated by glob:
Placement based on consumer. MUST/SHOULD/MAY
Create in .claude/commands/name.md → /name
$ARGUMENTS, $0, $1 for arguments
Live context: !`git diff` (executed before prompt)
Directory .claude/skills/name/SKILL.md
description | Auto-discovery trigger (250 chars) |
context: fork | Isolated sub-agent NEW |
paths: "*.ts" | Activate by file type NEW |
effort: high | Force extended thinking NEW |
user-invocable | true = /command, false = Claude only |
Progressive disclosure: SKILL.md < 500 lines, [ref](references/)
Create in .claude/agents/name.md
model | Model (inherited by default) |
tools | Restrict tools |
isolation: worktree | Separate git worktree NEW |
memory: project | Persistent memory NEW |
permissionMode | Dedicated permission mode |
Invoke: @"name (agent)" | --agent name
Builtin: Explore (Haiku), Plan, general-purpose
MCP: Integrations via .mcp.json. Tools: mcp__server__tool
Transports: stdio | http | sse | ws
Plugins: Bundles of skills + agents + hooks + MCP
/plugin install name@marketplace
Built-in MCP server — Claude sees and controls your desktop: screenshots, clicks, typing, scrolling on macOS apps. Enabled in Settings > General > Computer Use. Pro/Max only.
Security: request_access required. Allowlist per app. Screenshots filtered by compositing — only authorized apps are visible. systemKeyCombos separate grant.
27 tools: screenshot, left_click, type, key, scroll, zoom, computer_batch (sequence in 1 call), open_application, mouse_move, double_click, right_click, left_click_drag, read/write_clipboard, wait, switch_display, etc.
| Mode | Behavior |
|---|---|
| Default | Asks permission for every tool |
| acceptEdits | Auto-approves edits, asks for Bash |
| Plan | Read-only. Explores & understands. Writes nothing. |
| Auto | AI classifies (safe/risky). Team/Enterprise + Sonnet/Opus 4.6 |
| dontAsk | Skip prompts, ignore non-approved tools NEW |
| bypass | Skip all checks (containers only) |
Shift+Tab to cycle. --enable-auto-mode to unlock Auto.
Pro workflow: Plan Mode to explore → Normal to implement → Rewind if needed.
Order: deny → ask → allow (first match wins)
Syntax: Bash(npm run *), Read(/src/**), WebFetch(domain:x.com), mcp__server__*
| Event | When |
|---|---|
SessionStart | Session start / resume |
SessionEnd | Session end |
UserPromptSubmit | Before Claude processes the message |
PreToolUse | Before a tool — can block (exit 2) |
PostToolUse | After a successful tool |
PostToolUseFailure | After a failed tool |
PermissionRequest | When a permission dialog appears |
Stop | Claude finishes its response |
StopFailure | Turn ended by API error |
SubagentStart | A sub-agent starts NEW |
SubagentStop | A sub-agent finishes NEW |
TeammateIdle | A teammate is about to become idle |
TaskCreated | Task created |
TaskCompleted | Task completed |
PreCompact | Before compaction |
PostCompact | After compaction |
Notification | Claude sends a notification |
InstructionsLoaded | CLAUDE.md or rules loaded |
ConfigChange | A config file changes |
FileChanged | A watched file changes |
CwdChanged | Working directory changes |
WorktreeCreate | Worktree created |
WorktreeRemove | Worktree removed |
Elicitation | MCP server requests input |
ElicitationResult | Response to an MCP elicitation |
command | Shell command |
http | POST to an endpoint |
prompt | LLM single-turn (Haiku) |
agent | Multi-turn sub-agent |
Codes: 0 = success, 2 = block (stderr → Claude), other = error
if field: Filter by tool name AND arguments. E.g.: Bash(git *), Edit(*.ts)
Env vars: $CLAUDE_PROJECT_DIR, $CLAUDE_FILE_PATHS, $CLAUDE_TOOL_INPUT
| Syntax | Action |
|---|---|
@file | Reference files & folders in context |
@"agent" | Mention a specific sub-agent |
!command | Run a shell. E.g.: ! git status |
Ctrl+V | Paste screenshots, diagrams, images |
Ctrl+B to send to background. Claude continues while you work.
--remote "task" to launch an agent on claude.ai.
/remote-control to make the session remotely accessible.
| Enterprise | /etc/claude-code/managed-settings.json |
| CLI Args | Flags passed at launch |
| Local | .claude/settings.local.json (gitignored) |
| Project | .claude/settings.json (committed) |
| User | ~/.claude/settings.json (global) |
config listShow all settings
config get keyView a value
config set key valSet a value
config add key valAdd to an array
config remove key valRemove from an array
ANTHROPIC_API_KEY | API key (overrides subscription) |
ANTHROPIC_MODEL | Default model |
CLAUDE_CODE_EFFORT_LEVEL | Effort level |
CLAUDE_CODE_USE_BEDROCK | Use Amazon Bedrock |
CLAUDE_CODE_USE_VERTEX | Use Google Vertex AI |
CLAUDE_CODE_DISABLE_1M_CONTEXT | Disable 1M context |
CLAUDE_CODE_DISABLE_AUTO_MEMORY | Disable auto memory |
DISABLE_TELEMETRY | Opt-out telemetry |
DISABLE_AUTOUPDATER | Disable auto updates |
.claude/)~/.claude/)Esc EscOpen rewind menu anytime
/rewindSame function via command
| Option | Effect |
|---|---|
| Conversation | Go back in chat. Code stays. |
| Code | Restore files. Conversation stays. |
| Full Rewind | Restore conversation AND code. |
Startup budget ~6K tokens: system prompt, memory, env, MCP, CLAUDE.md, rules, skill descriptions.
Compaction: Auto at ~95% capacity. /compact to trigger manually. CLAUDE.md re-read from disk.
"Document & Clear" workflow: Save progress → /clear → Start fresh. Claude reads the summary.
Save tokens: Scoped rules, sub-agents for verbose tasks, --bare, opus[1m] for large codebases.
cd project && claude
2./init to generate CLAUDE.md
3.Edit CLAUDE.md → conventions & commands
4.Start coding!
Shift+Tab × 2 → Plan Mode → Describe the task
Validate → Shift+Tab → Normal → "implement the plan"
/compactContext growing? Compact it
/clearUnrelated tasks? Reset
opus[1m]Large codebases? 1M context
--bareQuick questions? Skip startup
cat error.log | claude -p "root cause"
Verifiable"After the fix, run npm test"
IncrementalBreak into steps, validate each one
Correct earlyCtrl+C if wrong direction
| Worktrees | claude -w feat --tmux |
| Multi-dirs | --add-dir ../lib |
| Background | Ctrl+B |
| Agent Teams | Multiple Claudes in parallel |
| Remote | --remote "task" |
| Loop | /loop 5m /test |
| Schedule | /schedule for cron jobs |
.claude/commands/name.mdYou invoke it: /name. Personal: ~/.claude/commands/
.claude/skills/name/SKILL.mdClaude decides when to invoke it (auto-discovery via description).
.claude/agents/name.mdInvoke: @"name (agent)" | --agent name | natural language
.claude/rules/name.mdAuto-loaded when Claude touches a file matching the glob.
.claude/settings.jsonDeterministic — always runs (unlike CLAUDE.md ~80%).
.mcp.jsonCLAUDE.md | File-scoped → rules/ | Deterministic → hooks | Reusable workflow → commands/ | Complex + refs → skills/ | Parallel task → agents/ | External tool → MCPclaudeInteractive sessionclaude -cResume last sessionclaude -p "query"Non-interactive modeclaude -r "name"Named sessionclaude --model opusUse Opus/clearStart from scratch/compactFree up contextsonnetFast & balanced (default)opusComplex reasoningopus[1m]Opus + 1M token contexthaikuUltra-fast, exploration--effort lowSimple questions--effort maxComplex problems (Opus)"ultrathink"One-time max effortEsc EscRewind — undoShift+Tab ×2Plan Mode — read-onlyCtrl+BBackground task--remote "task"Remote agent-w feat --tmuxWorktree + tmux/loop 5m /testRepeat every 5 min/insightsAnalyze your usage