The basics worth memorizing: shortcuts, prefixes, in-session slash commands, and shell CLI - not the full /commands list, just what you reach for daily. Keyboard shortcuts are described in prose, not boxed in code; the collapsible “Example” blocks only show up where there’s an actual string worth copy-pasting.
If you want the full control surface, see Claude Code tools and Claude Code plan mode for the workflow mechanics that make these shortcuts pay off. For why /compact and /clear beat buying a bigger window, see Prune the log, not the window.
Cheatsheet layout
Jump to a section:
- Command cheatsheet - keys you hit when things stall (
Ctrl+C,Esc,Ctrl+R). - Shortcuts & prefixes -
/for commands,!for shell mode,@for file mentions,\\ + Enterfor multiline,Shift+Tabfor permission modes. - Claude (shell) commands - start, continue, or script a session from your terminal.
- Claude commands - slash commands inside an open session.
- Session commands - context, compaction, memory, config, permissions.
- Context & memory - hooks, MCP, subagents.
Command cheatsheet (when you’re stuck)
Ctrl+C
- Interrupts a running operation.
- If nothing is running: first press clears input, second press exits.
Esc
- Interrupts Claude mid-response / mid-tool-call so you can redirect.
- If a dialog is open (permissions / menus),
Esccloses the dialog instead.
Esc then Esc
- If there’s text in the input: clears the draft (it’s saved; press Up to bring it back).
- If the input is empty: opens the rewind menu.
Ctrl+R
Reverse-search your input history.
Shortcuts & prefixes
Slash commands: /…
Start your input with / to run a command (or invoke a skill).
Shell mode: !…
Prefix with ! to run a shell command; its output is added to the session.
Example
!git status
Multiline input: \\ + Enter
Works everywhere. It’s the portable “new line”.
Example
First line\
Second line
File mentions: @
Type @ for path autocomplete and file mentions.
Example
read @src/content/articles/claude-code-tools.md and summarize the key rules
Permission modes: Shift+Tab
Cycle permission modes (default - manual approval, acceptEdits, plan, plus any enabled extras).
Claude (shell) commands
These run in your normal terminal. They control how a session starts.
claude
Starts an interactive session.
claude "query"
Starts interactive mode with an initial prompt.
Example
claude "explain what this repo does and where the entrypoints are"
claude -p "query"
Print mode: runs non-interactively, then exits.
Example
claude -p "summarize the last 20 lines of this log" --output-format text
claude -c
Continues the most recent conversation in the current directory.
claude --add-dir ../path
Grants file access to additional directories.
Example
claude --add-dir ../shared
Claude commands (inside a session)
The official list is huge. These are the daily drivers.
/help
Shows help and available commands.
/usage (aliases: /cost, /stats)
Shows usage/cost and activity stats (and, on paid plans, breakdowns by skills/tools/plugins/MCP).
/export [filename]
Exports the current conversation as plain text.
Example
/export notes.txt
/clear (aliases: /reset, /new)
Starts a new conversation with empty context; the previous one stays available in /resume.
Example
/clear "before-refactor"
/exit (alias: /quit)
Exits the CLI.
/status
Opens the Status tab in Settings (version, model, account, connectivity).
/rewind (aliases: /checkpoint, /undo)
Rewinds code and/or conversation to a previous point, or summarizes from a selected message.
/plan [description]
Enters plan mode (optionally with a task description).
Example
/plan refactor src/lib/ without changing behavior
/doctor
Diagnoses and verifies your Claude Code installation and settings (and can offer to fix issues).
Session commands
/context
Shows context usage as a colored grid.
/compact [instructions]
Summarizes the conversation to free context window space.
Example
/compact keep only decisions, file paths, and open questions
/init
Initializes a repo with a starter CLAUDE.md.
/memory
Edits/views CLAUDE.md memory files and auto-memory entries.
/config (alias: /settings)
Opens settings (or sets keys via key=value).
Example
/config theme=dark
/permissions (alias: /allowed-tools)
Manages allow/ask/deny rules for tool permissions.
Context & memory
/hooks
Shows hook configurations for tool events.
/mcp
Manages MCP server connections and authentication.
/agents
Shows guidance for managing subagents (behavior depends on Claude Code version).
Bottom line
If you only memorize a few: Esc interrupts, Esc Esc rewinds, /export saves, /rewind restores, /context tells you what’s filling the window.