Skip to main content
NOV 2026 Latest guide updates. Latest: AI Design Patterns Local vs cloud AI Grill me Changelog →

Claude Code Cheatsheet

Daily commands, shortcuts, and model settings

This Claude Code cheat sheet collects the core commands, keyboard shortcuts, and configuration options in a printable reference. It covers installation, slash commands like /clear and /compact, permission modes, context management, file references, hooks, and MCP setup. Keep it open as a daily reference or print the PDF.

PDF editions Β· Guide v3.44.1 Β· Updated

How to install Claude Code

npm install -g @anthropic-ai/claude-code

Requires Node.js 18+

Verify installwhich claude
Start sessionclaude
Health checkclaude doctor

Essential commands

/helpContextual help
/clearReset conversation
/compactFree up context
/statusStatus tab: version, model, account, connectivity
/contextDetailed token breakdown
/planEnter Plan Mode (no changes). Exit by approving the plan or Shift+Tab
/code-review [level]Review the diff for correctness bugs. --fix applies them
/modelChoose a model; Enter saves, s applies once
/insightsUsage analytics + optimization
/teleportTeleport session from web
/tasksMonitor background tasks
/fastOpus 5.5 fast: $8/$40 per MTok input/output
btw [question]Side question overlay. Read-only ephemeral agent, no history pollution, no tools.
/loop [interval] [prompt]Recurring scheduler. /loop 5m check the deploy (self-paced without an interval)
/usageUsage graph, favorite model, streak (v2.1.118)
/statsUsage graph, favorite model, streak (alias for /usage)
/costSession cost summary (alias for /usage)
/rename [name]Name or rename current session
/copyInteractive picker to copy a code block or full response
/debugEnable debug logging and troubleshoot from the session log (bundled skill)
/remote-envConfigure cloud environment
/simplifyReview cleanup opportunities and apply fixes; use /code-review for bugs
/output-styleDefault, Proactive, Concise, Explanatory, Learning, or custom
/autocompactSave the compaction window; auto restores the model default
/batchLarge-scale refactors via 5–30 parallel worktree agents
/exitQuit (or Ctrl+D)

Keyboard shortcuts

Shift+TabCycle permission modes
Esc x 2Rewind (undo)
Ctrl+CInterrupt
Ctrl+RSearch command history
Ctrl+LClear screen (keeps context)
Ctrl+BBackground tasks
Ctrl+X Ctrl+KStop background subagents
Alt+TToggle thinking where supported; no effect on Opus 5.5/Fable
TabAutocomplete
Shift+EnterNew line
Ctrl+DExit

IDE shortcuts

VS CodeAlt+K
JetBrainsCmd+Option+K

File references

@path/to/file.ts    → Reference a file
@agent-name         → Call an agent
!shell-command      → Run shell command

Hidden but official features

FeatureSinceWhat It Does
Tasks APIv2.1.16Task lists with dependencies; newer models opt in with CLAUDE_CODE_ENABLE_TODO_TOOLS=1
Background Agentsv2.0.60Sub-agents work while you code
Agent Teamsv2.1.32Multi-agent coordination (TeamCreate/SendMessage)
Auto-Memoriesv2.1.32Automatic cross-session context capture
Session Forkingv2.1.19Rewind + create parallel timeline
LSP Toolv2.0.74Code intelligence (go-to-def, refs)
/code-reviewv2.1.146Code review with optional effort level (e.g. /code-review high). /review is an alias; /simplify handles cleanup separately.
/batchv2.1.63Spawns 5–30 agents in isolated worktrees, each opens a PR
/loopv2.1.71Recurring scheduler: run any prompt or command on an interval (5m, 10m...) while you work
/usagev2.1.118Usage graph, cost breakdown, favorite model, streak (replaces /cost and /stats)
/recapv2.1.xSession recap: structured summary of what was done
/undov2.1.xUndo last change (file-level undo)
/tuiv2.1.xTerminal UI mode: structured interface for session navigation
/focusv2.1.xToggle the compact focus view in fullscreen mode
/ultrareviewv2.1.xCloud multi-agent code review; alias for /code-review ultra
Routinesv2.1.x (Apr 14)Cloud automation: schedule recurring agents to run without local session
Pro tip: These aren't "secrets." They're in the CHANGELOG. Read it!

Permission modes

ModeEditingExecution
Manual (default)Permission rulesPermission rules
Auto-acceptAutoAsks
Plan ModeNo file changesRead-only tools
Shift+Tab to switch modes. Open the permission modes recap card for every mode and its limits.

Memory & settings

LevelPathScope
Project.claude/Team (git)
Personal~/.claude/You only

.claude/ structure

.claude/
β”œβ”€β”€ CLAUDE.md           # Local memory
β”œβ”€β”€ settings.json       # Hooks (committed)
β”œβ”€β”€ settings.local.json # Permissions
β”œβ”€β”€ agents/             # Custom agents
β”œβ”€β”€ commands/           # Slash commands
β”œβ”€β”€ hooks/              # Event scripts
β”œβ”€β”€ rules/              # Auto-loaded rules
└── skills/             # Knowledge modules

Context management

0-50%
50-70%
70-90%
90%+
Work freely
Be selective
/compact NOW
/clear required
Model: Sonnet | Ctx: 89.5k | Ctx(u): 56.0%
Watch Ctx(u): >70% = /compact, >85% = /clear
SignAction
Short responses/compact
Frequent forgetting/clear
>70% context/compact
Task complete/clear

Plan mode & thinking

Shift+Tab x 2Enter Plan Mode
/model opusplanOpus planning, Sonnet execution

Current models and effort

ModelInput/output per MTokDefault effort
Opus 5.5$4 / $20medium
Sonnet 5.5$2 / $10medium
Haiku 5.5$0.10 / $0.50 (prompts up to 100K tokens)medium
Fable 5.1$10 / $50high

Standard direct-API rates verified October 27, 2026; Haiku 5.5 costs $0.50 / $2.50 above 100K-token prompts. Provider aliases differ. Opus 5.5 is the direct-service default; organization settings can override it.

/effort saves levels through xhigh per model. Press s for this session only; max is session-only. Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable always use thinking. The ultrathink keyword adds guidance without changing API effort.

Full model and provider reference

Typical workflow

1. Start session      → claude
2. Check context      → /status
3. Plan Mode          → Shift+Tab x 2
4. Describe task      → Clear, specific prompt
5. Review changes     → Always read the diff!
6. Accept/Reject      → Enter/Esc
7. Verify             → Run tests
8. Commit             → When task complete
9. /compact           → When context >70%

Prompting formula

WHAT: [Concrete deliverable]
WHERE: [File paths]
HOW: [Constraints, approach]
VERIFY: [Success criteria]

Example

Add input validation to the login form.
WHERE: src/components/LoginForm.tsx
HOW: Use Zod schema, show inline errors
VERIFY: Empty email shows error

Model Context Protocol (MCP) servers

MCP extends Claude Code with external tools and data sources

SerenaIndexation + session memory
grepaiSemantic search + call graph
Context7Library documentation
SequentialStructured reasoning
PlaywrightBrowser automation
PostgresDatabase queries
doobidooSemantic memory + Knowledge Graph
Check status: /mcp

CLI flags

-p "query"Non-interactive mode
-cContinue last session
-r <id>Resume specific session
--model sonnetChange model
--teleportTeleport session from web
--add-dir ../libAllow outside CWD
--allowedToolsPre-approve tools; --tools restricts availability
--debugDebug output
--debug='mcp'Debug MCP servers
--from-prLoad context from PR (GitLab/Bitbucket/GHE, v2.1.119)
--printPrint output then exit (non-interactive, v2.1.119)
Search the full reference in a real terminal β†’
bash: reference docs

Loading bash sandbox…

Anti-patterns

Vague prompts
Specify file + line with @
Accept without reading
Read every diff
Ignore warnings
Use /compact at 70%
Skip permissions
Never in production

Cost optimization

ModelUse ForCost
HaikuSimple fixes, reviews$
SonnetMost development$$
OpusArchitecture, complex bugs$$$
OpusPlanPlan + Execute$$

Quick decision tree

Simple task       → Just ask Claude
Complex task      → Tasks API to plan first
Risky change      → Plan Mode first
Repeating task    → Create agent/command
Context full      → /compact or /clear
Need docs         → Use Context7 MCP
Deep analysis     → Use Opus (thinking on by default)

The golden rules

  1. Always review diffs before accepting
  2. Use /compact before context >70%
  3. Be specific (WHAT, WHERE, HOW, VERIFY)
  4. Plan Mode first for complex/risky tasks
  5. Create CLAUDE.md for every project
  6. Commit frequently after each task
  7. Know what's sent to Anthropic

Quick fixes

Command not foundCheck PATH, reinstall
Context >70%/compact immediately
Slow responses/compact or /clear
MCP not workingclaude mcp list
Permission deniedsettings.local.json

Health check

which claude && claude doctor && claude mcp list