Claude Code cheat sheet
Get the PDF by email
Sign in with your email and we send the PDF link to that inbox.
Sign in to get the PDFThe commands and habits you use every day, checked against the official docs. Everything above the advanced part is free.
Install and update
curl -fsSL https://claude.ai/install.sh | bashinstalls on macOS, Linux and WSL. Native installs update themselves.irm https://claude.ai/install.ps1 | iexinstalls from Windows PowerShell.brew install --cask claude-codeorwinget install Anthropic.ClaudeCodealso work, but you update them yourself.claude --versionprints the version followed by (Claude Code).claude doctorprints read-only diagnostics about your install and settings.
Start a session
claudestarts a session in the current folder. The first run opens your browser to sign in.claude --continueorclaude --resumepicks up an earlier conversation.claude -p "your prompt"runs one prompt without the interactive session, for scripts./loginswitches accounts,/logoutsigns out,/helplists the commands you have.
Commands inside a session
/initdrafts a CLAUDE.md from your codebase, or suggests improvements to the one you have./clearstarts a new conversation with empty context. Use it between unrelated tasks./compactsummarises the conversation at a natural break./resumegoes back to an earlier conversation./rewind, or Esc twice on an empty prompt, rolls code, conversation or both back to an earlier prompt./usageshows where your tokens went./context alllists the memory files that loaded, such as CLAUDE.md./effortchanges the effort level for the session.- Esc stops Claude mid-action and keeps the work so far.
Permission modes
- Shift+Tab cycles the modes. The status bar shows which one is on.
- Auto mode is the starting mode for terminal and VS Code sessions when none is configured. A classifier reviews risky actions instead of you.
- Manual mode asks before anything beyond reading. Good for your very first session.
- Plan mode researches and proposes changes without editing your source. Start one prompt with
/plan, or the whole session withclaude --permission-mode plan. permissions.defaultModein settings sets your own starting mode.
CLAUDE.md
- Keep it under 200 lines: purpose, commands, gotchas and conventions Claude cannot find in the code.
- After
/init, the work is mostly removing lines. @pathimports another file. Imports organise, they do not save context.CLAUDE.local.mdholds your personal notes for one project. Add it to .gitignore.~/.claude/CLAUDE.mdholds preferences for all your projects.- Rules that must always hold belong in a hook, not in CLAUDE.md.
Models and effort
- Default model: Opus 5.5 at medium effort with a 1M token context.
- Models: Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.1.
- Effort levels: low, medium, high, xhigh and max.
ultrathinkin a typed prompt asks for deeper reasoning on that turn.- Change effort mid-task rather than the model. Switching models always breaks the prompt cache.
Habits that save tokens
- Explore, then plan, then code, then verify.
- Give Claude a check that passes or fails: a test, a build, a linter.
/clearafter two failed corrections, then write one better prompt.- Ask for evidence: the command Claude ran and its output.
New to Claude Code? Walk through it in the simulated terminal or read the first steps.