Skip to main content

Claude Code Cheat Sheet

All levels

One page with the Claude Code flags, commands, shortcuts and file locations you reach for most days. Print it, pin it next to your terminal, or share the dark version. Everything on the image is repeated below as text, so you can search it, copy from it, and read it with a screen reader.

What you'll learn
  • Find the flag, command or shortcut you need without opening the reference
  • See what each permission mode runs without asking, and what Plan Mode does and does not block
  • Know which file a setting, an instruction or a hook belongs in

Claude Code cheat sheet: one A4 landscape page in three columns covering starting and resuming sessions, headless scripting, settings files, in-session commands, keyboard shortcuts, checkpoints, permission modes, Plan Mode, hooks and memory files. The same content follows as text.

Download​

The sheet is licensed CC BY 4.0: share it, print it and adapt it, with attribution to AILmanac.

The sheet as text​

Start and resume sessions​

Command or flagWhat it does
claudeStart an interactive session
claude "query"Start with an initial prompt
claude -cContinue the most recent conversation in this directory
claude -r "<session>"Resume by ID or name, or pick one
claude -n "<name>"Name the session for a later resume
--fork-sessionWith -c or -r: new session ID
claude -w <name>Work in an isolated git worktree
--model <alias|name>Set the model, such as sonnet
--permission-mode <mode>Start in a given permission mode
claude --bg "<task>"Start a background session; monitor it with claude agents

Going deeper: The claude CLI: Flags That Change Outcomes and Git Worktrees & Parallel Workstreams.

Headless and scripting​

Command or flagWhat it does
claude -p "query"Run once, print the answer, exit
cat file | claude -p "…"Pipe content in on stdin (10MB cap)
--output-format <format>text (default), json, stream-json
--json-schema '<schema>'JSON validated against your schema
--allowedTools "<rule>" …Tools that run without a prompt, such as "Bash(git diff *)"
--max-turns <n>Limit the number of agentic turns
--max-budget-usd <n>Stop at an estimated spend
--bareSkip hooks, skills, plugins, MCP servers, auto memory and CLAUDE.md
claude -c -p "query"Continue the last conversation

JSON output carries result, session_id and total_cost_usd. Exit code 0 means success.

Going deeper: Headless Mode & the Agent SDK.

Settings files​

Listed highest precedence first: when two of them set the same key, the one higher in the table wins.

File or flagScope
managed-settings.jsonManaged: set by your organization
--settings <file-or-json>Command line: this session only
.claude/settings.local.jsonProject local: only you, kept out of git
.claude/settings.jsonShared project: commit it for the team
~/.claude/settings.jsonUser: you, in every project

List keys such as permissions.allow merge across files. /status shows which files loaded; claude doctor reports invalid entries.

FileWhat it holds
.mcp.jsonProject-scoped MCP servers; manage them with /mcp

Going deeper: settings.json: The Config System and MCP Servers in Claude Code.

In-session commands​

CommandWhat it does
/initGenerate a starting CLAUDE.md
/clearNew conversation with empty context
/compactSummarize the conversation to free context
/contextVisualize current context usage
/resumeResume a conversation or open the picker
/branchBranch the conversation at this point
/rewindRewind code, conversation or both
/modelSwitch model; saved as your default
/planEnter plan mode from the prompt
/permissionsManage allow, ask and deny rules
/memoryEdit CLAUDE.md files, toggle auto memory
/configOpen settings, or set key=value directly
/usageSession cost and plan usage limits
/diffReview changes in your working tree
/btwSide question that stays out of history
/code-reviewReview the current diff for bugs

Going deeper: Context Management.

Keyboard and input​

KeyWhat it does
EscInterrupt Claude; work so far is kept
Esc EscOpen the rewind menu (on an empty prompt)
Shift+TabCycle permission modes
Ctrl+CInterrupt, or clear the input when idle
Ctrl+OToggle the transcript viewer
Ctrl+RReverse-search command history
Ctrl+BBackground the running command
Ctrl+GEdit the prompt in your text editor
Ctrl+VPaste an image from the clipboard
Ctrl+JNew line, in any terminal
!Shell mode: run a command directly
@Mention a file path, with autocomplete

Checkpoints and rewind​

AspectDetail
CreatedAt every prompt that starts a turn; the 100 most recent are kept
RestoreCode and conversation, or either alone
SummarizeFrom here or up to here; files untouched
Not trackedBash file changes, most subagent edits, edits made outside the session

Going deeper: Checkpoints & Rewind.

Permission modes​

ModeWhat runs without asking
defaultReads only. Shown as Manual
acceptEditsReads, file edits, common filesystem commands
planReads, plus classifier-approved commands
autoEverything, with background safety checks
dontAskReads and pre-approved tools; the rest is denied
bypassPermissionsEverything. Isolated containers and VMs only

Shift+Tab cycles default, acceptEdits and plan, then bypassPermissions and auto when enabled. Deny rules block in every mode. From v2.1.283 the built-in starting mode for interactive terminal sessions is auto; set permissions.defaultMode to change it.

Going deeper: Permissions & Permission Modes.

Plan mode​

AspectDetail
AllowsReads, shell commands to explore, a written plan
BlocksEdits to your source until you approve the plan
CommandsReviewed by the classifier, or prompted when outside the read-only set
Not enforcedIn an interactive terminal session with bypass permissions available

Going deeper: Plan Mode.

Hooks​

Event or aspectDetail
Configure inhooks in a settings file; /hooks lists them
SessionStartA session begins or resumes
UserPromptSubmitA prompt is submitted, before processing
PreToolUseBefore a tool call runs; can block it
PostToolUseAfter a tool call succeeds
StopClaude finishes responding
InputEvent data as JSON on stdin
Exit codes0: no objection. 2: block the action where the event allows it; stderr is the reason

Going deeper: Hooks: Deterministic Automation.

Memory and CLAUDE.md​

File or syntaxWhat it does
./CLAUDE.mdProject instructions, shared through git
./CLAUDE.local.mdPersonal project notes; add to .gitignore
~/.claude/CLAUDE.mdYour preferences, in every project
.claude/rules/*.mdTopic rules, optionally scoped by paths:
@path/to/fileImport into CLAUDE.md, up to four hops deep
MEMORY.mdAuto memory index Claude writes; the first 200 lines or 25KB load

Going deeper: CLAUDE.md & Memory Files.

Sources & further reading​

Each section was checked against these official pages on 2026-10-13:

Next​