Cheat sheet

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 PDF

The 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 | bash installs on macOS, Linux and WSL. Native installs update themselves.
  • irm https://claude.ai/install.ps1 | iex installs from Windows PowerShell.
  • brew install --cask claude-code or winget install Anthropic.ClaudeCode also work, but you update them yourself.
  • claude --version prints the version followed by (Claude Code).
  • claude doctor prints read-only diagnostics about your install and settings.

Start a session

  • claude starts a session in the current folder. The first run opens your browser to sign in.
  • claude --continue or claude --resume picks up an earlier conversation.
  • claude -p "your prompt" runs one prompt without the interactive session, for scripts.
  • /login switches accounts, /logout signs out, /help lists the commands you have.

Commands inside a session

  • /init drafts a CLAUDE.md from your codebase, or suggests improvements to the one you have.
  • /clear starts a new conversation with empty context. Use it between unrelated tasks.
  • /compact summarises the conversation at a natural break.
  • /resume goes back to an earlier conversation.
  • /rewind, or Esc twice on an empty prompt, rolls code, conversation or both back to an earlier prompt.
  • /usage shows where your tokens went.
  • /context all lists the memory files that loaded, such as CLAUDE.md.
  • /effort changes 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 with claude --permission-mode plan.
  • permissions.defaultMode in 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.
  • @path imports another file. Imports organise, they do not save context.
  • CLAUDE.local.md holds your personal notes for one project. Add it to .gitignore.
  • ~/.claude/CLAUDE.md holds 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.
  • ultrathink in 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.
  • /clear after 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.