Claude Code Cheat Sheet

v1.0 · March 2026 · code.claude.com/docs

Keyboard Shortcuts

General Controls
CtrlC Cancel input/generation
CtrlD Exit session
CtrlL Clear screen
CtrlO Toggle verbose output
CtrlR Reverse search history
CtrlG Open prompt in editor
CtrlB Background running task
CtrlT Toggle task list
CtrlV Paste image
CtrlF Kill background agents (x2)
EscEsc Rewind / undo
Text Editing
CtrlK Delete to end of line
CtrlU Delete entire line
CtrlY Paste deleted text
AltY Cycle paste history
AltB Move cursor back one word
AltF Move cursor forward one word
Mode Switching
ShiftTab Cycle permission modes
AltP Switch model
AltT Toggle thinking
Input & Multiline
\Enter Newline (all terminals)
AltEnter Newline (macOS default)
ShiftEnter Newline (iTerm2/Ghostty/Kitty)
CtrlJ Newline (control seq)
Prefixes
/ Slash command or skill
! Direct bash mode
@ File mention + autocomplete
Session Picker
↑↓ Navigate
←→ Expand/collapse
P Preview
R Rename
/ Search
A All projects
B Current branch

MCP Servers

Add Servers
--transport http Remote HTTP (recommended)
--transport stdio Local process
--transport sse Remote SSE
Scopes
Local ~/.claude.json (per project)
Project .mcp.json (shared/VCS)
User ~/.claude.json (global)
Manage
/mcp Interactive UI
claude mcp list List all servers
claude mcp serve CC as MCP server

Slash Commands

Session
/clear Clear conversation (/reset, /new)
/compact [focus] Compact context
/resume [session] Resume/switch session (/continue)
/rename [name] Name current session
/fork [name] Fork conversation
/rewind Rewind conv/code (/checkpoint)
/add-dir <path> Add working directory
/tasks Manage background tasks
Info & Export
/cost Token usage stats
/usage Plan limits & rate status
/extra-usage Configure extra usage
/context Visualize context (grid)
/diff Interactive diff viewer
/copy Copy last response
/export [file] Export conversation
/stats Usage streaks & prefs
/insights Analyze sessions report
Config & Display
/config Open settings (/settings)
/model [model] Switch model (←→ effort)
/fast [on|off] Toggle fast mode
/vim Toggle vim mode
/theme Change color theme
/permissions View/update permissions
/output-style Switch output style
/status Version, model, account
/terminal-setup Configure terminal keybindings
/keybindings Open keybindings config
/statusline Configure status line
/sandbox Toggle sandbox mode
Tools & Integration
/init Create CLAUDE.md
/memory Edit CLAUDE.md files
/mcp Manage MCP servers
/hooks Manage hooks
/skills List available skills
/agents Manage agents
/chrome Chrome integration
/plugin Manage plugins
/reload-plugins Reload plugins live
/ide Manage IDE integrations
Special
/btw <question> Side question (no context)NEW
/plan Enter plan mode
/loop [interval] Schedule recurring task
/doctor Diagnose installation
/rc Remote control (/remote-control)
/remote-env Configure remote environment
/pr-comments [PR] Fetch GitHub PR comments
/security-review Security vuln analysis
Account & Meta
/login Sign in to Anthropic
/logout Sign out
/feedback Submit feedback (/bug)
/release-notes View changelog
/upgrade Upgrade plan
/privacy-settings Privacy (Pro/Max)
/passes Share free week
/mobile Mobile app QR (/ios, /android)
/install-github-app GitHub Actions setup
/install-slack-app Slack app install
/desktop Continue in Desktop (/app)
/stickers Order stickers!
/help Show help & commands
/exit Exit CLI (/quit)

Memory & Files

CLAUDE.md Locations
./CLAUDE.md Project (team-shared)
~/.claude/CLAUDE.md Personal (all projects)
/etc/claude-code/ Managed (org-wide)
Rules & Import
.claude/rules/*.md Project rules
~/.claude/rules/*.md User rules
paths: frontmatter Path-specific rules
@path/to/file Import in CLAUDE.md
Auto Memory
~/.claude/projects/<proj>/memory/
MEMORY.md + topic files, auto-loaded

Workflows & Tips

Plan Mode
ShiftTab Normal → Auto → Plan
--permission-mode plan Start in plan mode
Extended Thinking
AltT Toggle thinking on/off
"ultrathink" Max effort for turn
CtrlO See thinking (verbose)
/model ←→ Adjust effort level
Git Worktrees
--worktree name Isolated branch per feature
isolation: worktree Agent in own worktree
/batch Auto-creates worktrees
Context Management
/context Visual context usage
/compact [focus] Compress with focus
Auto-compact ~95% capacity
CLAUDE.md Survives compaction!
Session Power Moves
claude -c Continue last conv
claude -r "name" Resume by name
/btw question Side Q, no context cost
SDK / Headless
claude -p "query" Non-interactive
--output-format json Structured output
--max-budget-usd 5 Cost cap
cat file | claude -p Pipe input
Scheduling & Remote
/loop 5m msg Recurring task
/rc Remote control
--remote Web session on claude.ai

Config & Env

Config Files
~/.claude/settings.json User settings
.claude/settings.json Project (shared)
.claude/settings.local.json Local only
~/.claude.json OAuth, MCP, state
.mcp.json Project MCP servers
Key Env Vars
ANTHROPIC_API_KEY
ANTHROPIC_MODEL
CLAUDE_CODE_EFFORT_LEVEL low/med/high
MAX_THINKING_TOKENS 0=off
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE 1-100
CLAUDE_CODE_MAX_OUTPUT_TOKENS def 32K, max 64K
CLAUDE_CODE_SUBAGENT_MODEL Override subagent model
CLAUDE_CODE_SIMPLE =1 minimal mode
CLAUDE_CODE_TASK_LIST_ID Share tasks across sessions
CLAUDE_CONFIG_DIR Custom config path
Cloud Providers
CLAUDE_CODE_USE_BEDROCK AWS Bedrock
CLAUDE_CODE_USE_VERTEX Google Vertex
CLAUDE_CODE_USE_FOUNDRY Microsoft Foundry
Feature Toggles
CLAUDE_CODE_DISABLE_AUTO_MEMORY =1 off, =0 force on
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION =false to disable
CLAUDE_CODE_DISABLE_BACKGROUND_TASKS =1 disable
CLAUDE_CODE_DISABLE_FAST_MODE =1 disable
DISABLE_AUTOUPDATER =1 disable updates
DISABLE_TELEMETRY =1 disable telemetry

Skills & Agents

Built-in Skills
/simplify Code review (3 parallel agents)
/batch Large parallel changes (5-30 worktrees)
/debug [desc] Troubleshoot from debug log
/loop [interval] Recurring scheduled task
/claude-api Load API + SDK reference
Custom Skill Locations
.claude/skills/<name>/ Project skills
~/.claude/skills/<name>/ Personal skills
Skill Frontmatter
description Auto-invocation trigger
allowed-tools Skip permission prompts
model Override model for skill
context: fork Run in subagent
$ARGUMENTS User input placeholder
!`cmd` Dynamic context injection
Built-in Agents
Explore Fast read-only (Haiku)
Plan Research for plan mode
General Full tools, complex tasks
Bash Terminal separate context
Agent Frontmatter
permissionMode default/acceptEdits/dontAsk/plan
isolation: worktree Run in git worktree
memory: user|project Persistent memory
background: true Background task
maxTurns Limit agentic turns

CLI & Flags

Core Commands
claude Interactive
claude "q" With prompt
claude -p "q" Headless (SDK)
claude -c Continue last
claude -r "n" Resume by name/ID
claude update Update CC
claude auth login Sign in (--email, --sso)
claude auth logout Sign out
claude auth status Auth status (--text)
claude agents List all subagents
claude remote-control Start remote control
Session & Model Flags
--model Set model (sonnet/opus)
-w, --worktree Git worktree
--add-dir Add directories
--permission-mode Start in mode
--from-pr Resume from PR
--fork-session Fork on resume
--session-id Use specific UUID
--remote Web session on claude.ai
--teleport Resume web session locally
--chrome Chrome integration
--ide Auto-connect to IDE
-v, --version Show version
Tool & Agent Flags
--agent Use named agent
--agents '{json}' Define subagents via JSON
--allowedTools Pre-approve tools
--disallowedTools Remove tools
--tools Restrict available tools
--mcp-config Load MCP from JSON file
--plugin-dir Load plugins from dir
--teammate-mode auto/in-process/tmux
Output & Limit Flags
--output-format text/json/stream-json
--json-schema Structured output
--max-turns Limit turns (-p only)
--max-budget-usd Cost cap (-p only)
--fallback-model Fallback when overloaded
--verbose Full turn-by-turn output
--debug Debug mode ("api,mcp")
System Prompt Flags
--system-prompt Replace entire prompt
--system-prompt-file Replace from file
--append-system-prompt Append to prompt
--append-system-prompt-file Append from file