Claude Code Cheatsheet

1 printable page - Daily essentials for maximum productivity

By Florian BRUNIAUX Version 3.8.0 January 2026
View .md Download PDF

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
/statusSession state + context usage
/contextDetailed token breakdown
/planEnter Plan Mode (no changes)
/executeExit Plan Mode (apply changes)
/modelSwitch model (sonnet/opus/opusplan)
/exitQuit (or Ctrl+D)

Keyboard Shortcuts

Shift+TabCycle permission modes
Esc × 2Rewind (undo)
Ctrl+CInterrupt
Ctrl+RRetry last operation
Ctrl+LClear screen (keeps context)
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

Permission Modes

ModeEditingExecution
DefaultAsksAsks
Auto-acceptAutoAsks
Plan ModeNoneNone
Shift+Tab to switch modes

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
└── 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 × 2Enter Plan Mode
/model opusplanOpus planning, Sonnet execution

Thinking Mode (Opus 4.5+)

DefaultThinking ON at max budget (v2.0.67+)
Alt+TToggle thinking on/off (session)
/configConfigure thinking (permanent)

Typical Workflow

1. Start session      → claude
2. Check context      → /status
3. Plan Mode          → Shift+Tab × 2
4. Describe task      → Clear, specific prompt
5. Review changes     → Always read the diff!
6. Accept/Reject      → y/n
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
Context7Library documentation
SequentialStructured reasoning
PlaywrightBrowser automation
PostgresDatabase queries
Check status: /mcp

CLI Flags

-p "query"Non-interactive mode
-cContinue last session
-r <id>Resume specific session
--model sonnetChange model
--add-dir ../libAllow outside CWD
--debugDebug output

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      → TodoWrite 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