Claude Code cheat sheet.

The commands and shortcuts you reach for every day, on one page. Print it or save it as a PDF to keep beside your keyboard.

Back to the lessons

Start and resume

  • claudeStart a session in the current folder
  • claude "fix the login bug"Start with a task straight away
  • claude -cContinue your most recent session
  • claude -rPick a past session to resume
  • claude mcp addConnect an MCP server

In a session

  • Shift+TabCycle permission modes, including plan mode
  • EscStop what Claude is doing
  • Esc EscRewind to an earlier message
  • @path/to/filePoint Claude at a file or folder
  • ! git statusRun a shell command yourself
  • Ctrl+C twiceLeave the session

Slash commands

  • /initDraft a CLAUDE.md for the project
  • /clearStart fresh between unrelated tasks
  • /compactSummarise to free up context
  • /contextSee what is using the context window
  • /memoryView and edit loaded memory files
  • /modelSwitch model
  • /permissionsReview allow and deny rules
  • /agentsManage subagents
  • /mcpManage MCP servers
  • /hooksManage hooks
  • /helpList every command

Where things live

  • ~/.claude/CLAUDE.mdYour memory, for every project
  • CLAUDE.mdProject memory, shared with the team
  • .claude/settings.jsonTeam settings, committed
  • .claude/settings.local.jsonYour settings for this project, not committed
  • .claude/rules/*.mdRules that load for matching paths
  • .claude/commands/*.mdCustom slash commands
  • .claude/skills/name/SKILL.mdSkills Claude loads when relevant
  • .claude/agents/*.mdSubagents
  • .mcp.jsonShared MCP servers

Headless and CI

  • claude -p "task"Run once without the interactive screen
  • --output-format jsonMachine-readable result at the end
  • --output-format stream-jsonLive events as it works
  • --allowedToolsLimit which tools it may use
  • --max-turnsCap how long it can run

Hook events

  • PreToolUseBefore a tool runs; exit code 2 blocks it
  • PostToolUseAfter a tool runs, e.g. auto-format
  • UserPromptSubmitWhen you send a prompt
  • SessionStartWhen a session starts or resumes
  • StopWhen Claude finishes responding

Claude Code changes quickly. Run /help for the full, current list in your version.