Claude Code Cheatsheet

One-page printable daily essentials for maximum Claude Code productivity

1 printable page - Daily essentials for maximum productivity

Author: Florian BRUNIAUX | Founding Engineer @Méthode Aristote

Written with: Claude (Anthropic)

Version: 3.39.1 | Last Updated: March 2026


Essential Commands

CommandAction
/helpContextual help
/powerupInteractive animated lessons teaching Claude Code features
/clearReset conversation
/compactFree up context
/statusSession state + context usage
/contextDetailed token breakdown
/planEnter Plan Mode (no changes)
/ultraplanCloud Plan Mode — draft in cloud, review in browser (v2.1.91+)
/executeExit Plan Mode (apply changes)
/modelSwitch model (sonnet/opus/opusplan)
/insightsUsage analytics + optimization report
/simplifyDetect over-engineering in changed code + auto-fix
/batchLarge-scale refactors via 5–30 parallel worktree agents
/teleportTeleport session from web
/tasksMonitor background tasks
/remote-envConfigure cloud environment
/remote-controlStart remote control session (Research Preview, Pro/Max)
/rcAlias for /remote-control
/mobileGet Claude mobile app download links
/fastToggle fast mode (2.5x speed, 6x cost)
/voiceToggle voice input (hold Space to speak, release to send)
/btw [question]Side question overlay — read-only ephemeral agent, no history pollution, no tools
/loop [interval] [prompt]Run a prompt on repeat (ex: /loop 5m check the deploy, default 10m)
/statsUsage graph, favorite model, streak
/rename [name]Name or rename the current session
/copyInteractive picker to copy a code block or full response
/debugSystematic troubleshooting
/exitQuit (or Ctrl+D)

Keyboard Shortcuts

ShortcutAction
Shift+TabCycle permission modes
Esc × 2Rewind (undo)
Ctrl+CInterrupt
Ctrl+RSearch command history
Ctrl+LClear screen (keeps context)
TabAutocomplete
Shift+EnterNew line
Ctrl+BBackground tasks
Ctrl+FKill all background agents (double press)
Alt+TToggle thinking
Space (hold)Voice input (requires /voice enabled)
Ctrl+DExit

File References

@path/to/file.ts    → Reference a file
@agent-name         → Call an agent
!shell-command      → Run shell command
IDEShortcut
VS CodeAlt+K
JetBrainsCmd+Option+K

Features Méconnues (But Official!)

FeatureSinceWhat It Does
Tasks APIv2.1.16Persistent task lists with dependencies
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.74IDE-like navigation: symbols, types, refs. ~50ms vs 45s with grep. 11 languages
Voice Modev2.1.xNative voice input, free transcription, no rate limit impact
Remote Controlv2.1.51Control local session from phone/browser (Research Preview, Pro/Max)
/loopv2.1.71Session-scoped recurring scheduler: /loop 5m check the deploy (stops when session ends). Min 1 min, max 50 tasks/session
Cloud Scheduled Tasks2026Machine-off scheduling via /schedule or claude.ai/code/scheduled. Runs on Anthropic infra, clones repo fresh each run, min 1h interval. Pro/Max/Team/Enterprise
Desktop Scheduled Tasks2026Local machine scheduling via Desktop app. Min 1 min, full local file access, no session required
Skill EvalsMar 2026Two skill types: Capability Uplift (fills model gap, fades) / Encoded Preference (encodes workflow, stays). Benchmark Mode, A/B testing, Trigger Tuning.
Output StylesAug 2025/config → “Preferred output style”: Default (concise), Explanatory (adds design rationale), Learning (pair-programming, TODO(human) markers). Custom styles via .claude/styles/.

Activate LSP: Add to ~/.claude/settings.json{ "env": { "ENABLE_LSP_TOOL": "1" } } (requires LSP server installed for your language: tsserver, pylsp, gopls, rust-analyzer, sourcekit-lsp…)

Pro tip: These aren’t “secrets”—they’re in the CHANGELOG. Read it!


Permission Modes

ModeEditingExecution
DefaultAsksAsks
acceptEditsAutoAsks
Plan Mode
dontAskOnly if in allow rulesOnly if in allow rules
bypassPermissionsAutoAuto (CI/CD only)

Shift+Tab to switch modes


Memory & Settings (2 levels)

LevelmacOS/LinuxWindowsScopeGit
Project.claude/.claude\Team
Personal~/.claude/%USERPROFILE%\.claude\You (all projects)

Priority: Project overrides Personal

FileWhereUsage
CLAUDE.mdProject rootTeam memory (instructions)
settings.json.claude/Team settings (hooks)
settings.local.json.claude/Your setting overrides
CLAUDE.md~/.claude/ (Win: %USERPROFILE%\.claude\)Personal memory

.claude/ Folder Structure

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

Typical Workflow

1. Start session      → claude
2. Check context      → /status
3. Plan Mode          → Shift+Tab × 2 (for complex tasks)
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%

Context Management (CRITICAL)

Statusline

Model: Sonnet | Ctx: 89.5k | Cost: $2.11 | Ctx(u): 56.0%

Watch Ctx(u): → >70% = /compact, >85% = /clear

Enhanced statusline (ccstatusline): Add to ~/.claude/settings.json:

{ "statusLine": { "type": "command", "command": "npx -y ccstatusline@latest", "padding": 0 } }

Context Thresholds

Context %StatusAction
0-50%GreenWork freely
50-70%YellowBe selective
70-90%Orange/compact now
90%+Red/clear required

Actions by Symptom

SignAction
Short responses/compact
Frequent forgetting/clear
>70% context/compact
Task complete/clear

Context Recovery Commands

CommandUsage
/compactSummarize and free context
/clearFresh start
/rewindUndo recent changes
claude -cResume last session (CLI flag)
claude -r <id>Resume specific session (CLI flag)

Under the Hood (Quick Facts)

ConceptKey Point
Master LoopSimple while(tool_call) — no DAGs, no classifiers
Tools8 core: Bash, Read, Edit, Write, Grep, Glob, Task, TodoWrite
Context~200K tokens, auto-compacts at 75-92%
Sub-agentsIsolated context, max depth=1
Philosophy”Less scaffolding, more model” — trust Claude’s reasoning

Deep dive: Architecture & Internals


Plan Mode & Thinking

FeatureActivationUsage
Plan ModeShift+Tab × 2 or /planExplore without modifying
OpusPlan/model opusplanOpus for planning, Sonnet for execution
Ultraplan/ultraplan <prompt>Cloud planning, browser review, terminal stays free (v2.1.91+, GitHub required)

Opus 4.7 (v2.1.114+): Default effort in Claude Code = xhigh (all plans). New xhigh level sits between high and max — finer reasoning/latency control. Use ultrathink to force max effort for the next turn.

ControlActionPersistence
Alt+TToggle thinking on/offSession
/configEnable/disable globallyPermanent
/model sliderLeft/right arrows: low|medium|high|xhighSession
CLAUDE_CODE_EFFORT_LEVELEnv var: low|medium|high|xhigh|maxShell session
effortLevel settingIn settings.json: low|medium|high|xhigh|maxPermanent
effort in skill frontmatter (v2.1.80+)Per-skill override: low|medium|high|xhighPer invocation

Cost tip: For simple tasks, Alt+T to disable thinking → faster & cheaper.

Per-skill effort — add effort: low to mechanical skills (commit, sync, scaffold) and effort: high to analytical ones (security-audit, architecture-review). Overrides session setting automatically.

OpusPlan workflow: /model opusplanShift+Tab × 2 (plan with Opus) → Shift+Tab (execute with Sonnet)

Ultraplan workflow: /ultraplan <task> → terminal free while cloud drafts → review inline in browser → approve → execute on web (PR) or teleport back to terminal

Required for: features >3 files, architecture, complex debugging

Quick Model Selection

TaskModelEffort
Rename, boilerplate, test genHaikulow
Feature dev, debug, refactorSonnetmedium–high
Architecture, security auditOpushigh–max

Full decision table with cost estimates: Section 2.5 Model Selection & Thinking Guide

Dynamic Model Switching (Mid-Session)

Pattern: Start Sonnet (speed) → swap Opus (complexity) → back Sonnet

Workflow:

# Session start (default Sonnet)
claude

# Complex feature encountered
> "Implement OAuth2 flow with PKCE"
/model opus                    # Switch to deep reasoning

# Feature complete, back to routine
/model sonnet                  # Speed + cost optimization

Best Practices:

Cost Impact:

ModelInputOutputUse Case
Opus$15/MTok$75/MTokComplex reasoning (10-20% of tasks)
Sonnet$3/MTok$15/MTokMost development (70-80% of tasks)
Haiku$0.25/MTok$1.25/MTokSimple validation (5-10% of tasks)

Dynamic switching optimizes cost while maintaining quality on complex tasks.

Source: Gur Sannikov embedded engineering workflow


MCP Servers

ServerPurpose
SerenaIndexation + session memory + symbol search
grepaiSemantic search + call graph analysis
Context7Library documentation
SequentialStructured reasoning
PlaywrightBrowser automation
PostgresDatabase queries
doobidooSemantic memory + multi-client + Knowledge Graph

Serena memory: write_memory() / read_memory() / list_memories()

Serena indexation:

# Initial index
uvx --from git+https://github.com/oraios/serena serena project index

# Force rebuild
serena project index --force-full

# Incremental update (faster)
serena project index --incremental --parallel 4

Check status: /mcp


Creating Custom Components

Agent (.claude/agents/my-agent.md)

---
name: my-agent
description: Use when [trigger]
model: sonnet
tools: Read, Write, Edit, Bash
---
# Instructions here

Command (.claude/commands/my-command.md)

---
description: Brief description
argument-hint: "<required_arg> [--flag]"
---
# Command Name
Instructions for what to do...
$ARGUMENTS[0] $ARGUMENTS[1] (or $0 $1) - user args

Hook (macOS/Linux: .sh | Windows: .ps1)

Bash (macOS/Linux):

#!/bin/bash
INPUT=$(cat)
# Process JSON input
exit 0  # 0=continue, 2=block

PowerShell (Windows):

$input = [Console]::In.ReadToEnd() | ConvertFrom-Json
# Process JSON input
exit 0  # 0=continue, 2=block

Anti-patterns

❌ Don’t✅ Do
Vague promptsSpecify file + line with @references
Accept without readingRead every diff
Ignore warningsUse /compact at 70%
Skip permissionsNever in production
Negative constraints onlyProvide alternatives

Quick 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, invalid format shows error

CLI Flags Quick Reference

FlagUsage
-p "query"Non-interactive mode (CI/CD)
-c / --continueContinue last session
-r / --resume <id>Resume specific session
--teleportTeleport session from web
remote-controlSubcommand: start remote control session
--model sonnetChange model
--add-dir ../libAllow access outside CWD
--permission-mode planPlan mode
--tools "Tool1,Tool2"Enable specific tools for session
--max-budget-usd 5.00Max API spend limit (print mode)
--system-prompt "..."Append custom system prompt
--worktree / -wRun in isolated git worktree
--dangerously-skip-permissionsAuto-accept (use carefully)
--debugDebug output
--allowedTools "Edit,Read"Whitelist tools

Full CLI reference (~45 flags): see cli-reference on code.claude.com


Debug Commands

claude --version     # Version
claude update        # Check/install updates
claude doctor        # Diagnostic
claude --debug       # Verbose mode
claude --mcp-debug   # Debug MCPs
/mcp                 # MCP status (inside Claude)

CI/CD Mode (Headless)

# Non-interactive execution
claude -p "analyze this file" src/api.ts

# JSON output
claude -p "review" --output-format json

# Economic model
claude -p "lint" --model haiku

# With auto-accept
claude -p "fix typos" --dangerously-skip-permissions

Remote Control — Mobile Access (v2.1.51+, Research Preview)

Pro/Max only — not available on Team, Enterprise, or API keys

# Start from terminal (new session)
claude remote-control

# Or from inside an active session:
/rc        # (or /remote-control)

Connect from phone/tablet/browser:

  1. Scan the QR code (press spacebar after start)
  2. Or open session URL in browser / Claude mobile app
  3. Or: /mobile → shows App Store + Play Store links
⚠️ Known LimitationDetail
1 session at a timeOnly one remote session active
Slash commands broken/new, /compact = plain text remotely → use from local terminal
Terminal must stay openClosing local terminal ends session
Network timeout~10 min disconnect → session expires

Advanced: tmux multi-session (bypass 1-session limit)

tmux new-session -s dev
# Each pane = its own claude session
# Run /rc in the pane you want to control remotely

Auto-enable: /config → toggle “Remote Control: auto-enable”

Full doc: §9.22 Remote Control | Security notes


Task Management (v2.1.16+)

Two systems available:

SystemWhen to UsePersistence
Tasks API (v2.1.16+)Multi-session projects, dependencies✅ Disk (~/.claude/tasks/)
TodoWrite (Legacy)Simple single-session❌ Session only

Tasks API Commands

# Enable persistence across sessions
export CLAUDE_CODE_TASK_LIST_ID="project-name"
claude

# Inside Claude: Create task hierarchy
> "Create tasks for auth system with dependencies"

# Resume later (new session)
export CLAUDE_CODE_TASK_LIST_ID="project-name"
claude
> "TaskList to see current state"

Key capabilities:

⚠️ Limitation: TaskList shows id, subject, status, blockedBy only. For description/metadata → use TaskGet(taskId) per task.

Tip: Store key info in subject for quick scanning.

Migration flag (v2.1.19+):

# Revert to old TodoWrite system
CLAUDE_CODE_ENABLE_TASKS=false claude

→ Full workflow: guide/workflows/task-management.md


The Golden Rules

  1. Always review diffs before accepting
  2. Use /compact before context gets critical (>70%)
  3. Be specific in requests (WHAT, WHERE, HOW, VERIFY)
  4. Plan Mode first for complex/risky tasks
  5. Create CLAUDE.md for every project
  6. Commit frequently after each completed task
  7. Know what’s sent — prompts, files, MCP results → Anthropic (opt-out training)

Quick Decision Tree

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

Common Issues Quick Fix

ProblemSolution
”Command not found”Check PATH, reinstall: curl -fsSL https://claude.ai/install.sh | sh
Context too high (>70%)/compact immediately
Slow responses/compact or /clear
MCP not workingclaude mcp list, check config
Permission deniedCheck settings.local.json
Hook blockingCheck hook exit code, review logic

Health Check Script (save & run):

# macOS/Linux
which claude && claude doctor && claude mcp list

# Windows PowerShell
where.exe claude; claude doctor; claude mcp list

Cost Optimization

ModelUse ForCost
HaikuSimple fixes, reviews$
SonnetMost development$$
OpusArchitecture, complex bugs$$$
OpusPlanPlan (Opus) + Execute (Sonnet)$$

Tip: Use --add-dir to allow tool access to directories outside your current working directory


Community Tools

ToolPurposeInstall
ccusageCost tracking & reportsbunx ccusage daily
RTKToken reduction (60-90%)brew install rtk-ai/tap/rtk or cargo install rtk · Site
claude-code-viewerSession history UInpx @kimuson/claude-code-viewer
Entire CLISession checkpoints + governanceentire.io (Feb 2026)

Entire CLI: Agent-native platform by ex-GitHub CEO with rewindable checkpoints, approval gates, audit trails. For compliance (SOC2, HIPAA) or multi-agent workflows.


Search Tools Quick Reference

Quick decision (5 seconds): exact text → rg | exact name → rg/Serena | concept → grepai | structure → ast-grep

TaskToolCommand
”Find TODO comments”rgrg "TODO"
”Find auth code”grepaigrepai search "authentication"
”Who calls login?”grepaigrepai trace callers "login"
”Get file structure”Serenaserena get_symbols_overview
”Async without try/catch”ast-grepast-grep "async function $F"

Speed: rg (~20ms) → Serena (~100ms) → ast-grep (~200ms) → grepai (~500ms)

Full workflows: workflows/search-tools-mastery.md


Resources


Author: Florian BRUNIAUX | @Méthode Aristote | Written with Claude

Last updated: March 2026 | Version 3.39.1