Claude Code Cheatsheet

Updated February 2026
Opus 4.6 • Sonnet 4.5 • Haiku
Slash Commands
/clearClear conversation history
/compactCompress conversation to save tokens
/contextVisualize context usage
/modelSwitch model + effort level
/costShow token & cost usage
/tasksList background tasks
/memoryEdit CLAUDE.md files
/initInitialize project with CLAUDE.md
/configOpen settings interface
/permissionsView/update permissions
/mcpManage MCP connections
/hooksConfigure event hooks
/agentsManage subagents
/reviewRequest code review
/planEnter plan mode
/rewindRewind conversation/code
/exportExport conversation to file
/copyCopy last response to clipboard
/renameName current session
/statsView usage statistics
/todosList current TODO items
/debugTroubleshoot session issues
/themeChange color theme
/doctorCheck installation health
/helpShow all available commands
Keyboard Shortcuts
Essential
EscCancel / Stop generation
Esc + EscRewind to checkpoint
Shift+TabCycle modes: Auto → Plan → Delegate
Ctrl+VPaste image from clipboard
Alt+TToggle Extended Thinking
Ctrl+BSend task to background
Ctrl+TToggle task list
@File / folder mention
!Run shell command directly
Editing
Ctrl+UDelete entire line
Ctrl+KDelete to end of line
Ctrl+RReverse search history
Ctrl+GOpen in text editor
Ctrl+YPaste deleted text
Alt+B/FMove cursor by word
Display
Ctrl+LClear terminal screen
Ctrl+OToggle verbose output
Alt+PSwitch model without clearing
>_ CLI Commands
claudeStart interactive session
claude "fix the login bug"One-shot task
claude -p "query"Print mode (non-interactive, pipe-friendly)
claude -p --max-turns 3 "query"Limit conversation turns
claude -c / --continueContinue most recent session
claude -r / --resumeResume session (interactive picker)
claude --add-dir /pathAdd directory to context
claude --output-format jsonOutput as JSON
claude --json-schema '{...}'Structured output with validation
claude --max-budget-usd 5Set dollar spend limit
claude --chromeEnable Chrome browser integration
claude --remoteCreate web session on claude.ai
claude --fallback-model sonnetAuto fallback when overloaded
claude updateUpdate to latest version
claude --versionCheck current version
@ File References
@filename@report.csv
@folder/@data/
TabAutocomplete paths
Models
Opus 4.6 — Deep reasoning
Sonnet 4.5 — Daily coding
Haiku — Quick tasks
sonnet[1m] — 1M context
opusplan — Opus plan, Sonnet exec
Effort levels (Opus): low / medium / high
Best Practices
Use CLAUDE.md per project for persistent context (checked into git)
Organize configs in tiers: Global → Category → Project
Use /compact regularly to save context window space
Start sessions in Plan mode, switch to Auto-Accept for execution
Run 3-5 parallel Claude instances in numbered terminal tabs
Use /clear between unrelated tasks to reset context
Keep MCP tools under 10% of context window to avoid bloat
Use --max-budget-usd for cost control on expensive tasks
Set up hooks for pre-commit validation and session-start intelligence
Create custom skills (SKILL.md) for repeated workflows
📁 Key File Locations
Global (~/.claude/)
settings.json — model, permissions, hooks
CLAUDE.md — personal preferences
CLAUDE.local.md — local overrides (.gitignored)
skills/ — SKILL.md-based automations
agents/ — custom subagents
rules/ — global rules
commands/ — custom slash commands
helpers/ — scripts (apiKeyHelper, statusLine)
Project (.claude/)
settings.json — project settings
CLAUDE.md — project memory (team-shared)
CLAUDE.local.md — personal overrides
agents/ — project subagents
rules/ — project rules
🏡 Suggested Config Hierarchy (4-Tier)
Tier 1 ~/.claude/ Global Model, permissions, hooks, skills, agents, rules
Tier 2 ~/work/ or ~/personal/ Category Work vs personal context and preferences
Tier 3 ~/work/client-a/ Team API keys, MCP servers, git identity per workspace
Tier 4 ~/work/client-a/my-app/ Project Project-specific CLAUDE.md context
Each tier inherits from the one above. No duplication needed — configs cascade automatically.