Claude Code cheat sheet: every command, shortcut and flag (with printable PDF)
By Shubhranshu, creator of claudeagents · Last reviewed
This Claude Code cheat sheet lists the slash commands, keyboard shortcuts, prompt prefixes and command-line flags you'll actually use, grouped by what you're trying to do. There's a free printable PDF at the top.
Everything was checked against Anthropic's own command, CLI and shortcut references on 16 November 2026. Claude Code adds and removes commands often, so if one doesn't appear when you type /, update with claude update. claudeagents is independent and not affiliated with Anthropic.
Download the printable cheat sheet#
Every command, shortcut and flag on this page fits on a two-page PDF you can print or keep open next to your terminal. It's free, with no sign-up.
Slash commands: sessions and context#
Type these at the Claude Code prompt. A command only works at the start of a message, and anything after it is passed along as arguments. Type / on its own to see every command available to you, including your own skills.
| Command | What it does |
|---|---|
/clear | Start a fresh conversation with empty context |
/compact [focus] | Summarize the conversation to free up context |
/context | Show how full the context window is |
/resume [name] | Pick up an earlier conversation |
/rename [name] | Name the current session |
/branch [name] | Try a different direction without losing this one |
/rewind | Undo the conversation and code to an earlier point (also /undo) |
/btw [question] | Ask a side question without adding it to the conversation |
/recap | One-line summary of the session so far |
/export [file] | Save the conversation as plain text |
/copy [N] | Copy Claude's last (or Nth-last) reply |
/exit | Leave Claude Code (also /quit) |
Model, cost and status#
| Command | What it does |
|---|---|
/model [model] | Switch model and save it as your default |
/effort [level] | Set how hard Claude thinks: low to max, or auto |
/fast [on|off] | Toggle fast mode |
/usage | Session cost, plan limits and stats (also /cost, /stats) |
/status | Version, model, account and connection |
/rate-limit-options | Ways to keep working when you hit a usage limit |
Project setup#
| Command | What it does |
|---|---|
/init | Create a CLAUDE.md guide for this project |
/memory | Edit CLAUDE.md files and auto memory |
/add-dir <path> | Give Claude access to another folder |
/cd <path> | Move the session to another folder |
/permissions | Manage allow, ask and deny rules |
/config | Open settings (or /config key=value) |
/hooks | View hook configurations |
/agents | Create or manage subagents |
/skills | List skills and choose which Claude can use |
/plugin | Install and manage plugins |
/mcp | Manage MCP servers and their logins |
/import | Bring settings over from Codex, Gemini CLI or Cursor |
/doctor | Check your install and settings, and fix problems |
Plan, review and ship#
| Command | What it does |
|---|---|
/plan [task] | Enter plan mode: Claude proposes before it edits |
/diff | Review all changes in your working tree |
/code-review | Review the current diff for bugs (also /review) |
/security-review | Check your branch for security problems |
/simplify | Find and apply cleanups in changed code |
/install-github-app | Set up Claude for GitHub pull requests and Actions |
Background, cloud and automation#
| Command | What it does |
|---|---|
/tasks | See background work and subagents |
/subtask <task> | Hand a task to a background subagent and keep working |
/background | Send this session to the background and free the terminal |
/loop [interval] [prompt] | Repeat a prompt while the session is open |
/schedule | Create scheduled cloud tasks |
/goal <condition> | Keep working across turns until a condition is met |
/desktop | Continue this session in the desktop app |
/teleport | Pull a cloud session into this terminal |
/remote-control | Control this session from claude.ai or your phone |
Look and feel, help#
| Command | What it does |
|---|---|
/theme | Change colors, including colorblind-friendly themes |
/statusline | Set up the status line |
/terminal-setup | Make Shift+Enter add a new line in your terminal |
/keybindings | Edit your keyboard shortcuts |
/help | Show help and all commands |
/powerup | Short interactive lessons on Claude Code features |
/release-notes | See what changed in each version |
/passes | Share a free week of Claude Code (eligible plans) |
/bug | Report a bug to Anthropic |
Keyboard shortcuts#
These work in the terminal. On a Mac, the Option shortcuts need Option set to act as Meta in your terminal settings. The desktop app has its own shortcuts, listed in our desktop app guide.
| Keys | What it does |
|---|---|
| Esc | Stop Claude mid-answer so you can redirect it |
| Esc Esc | Clear your draft, or open rewind when the prompt is empty |
| Shift+Tab | Cycle permission modes (Manual, Accept edits, Plan, Auto) |
| Shift+Enter | New line without sending (run /terminal-setup if it doesn't work) |
| Ctrl+C | Interrupt, or clear input; press twice to exit |
| Ctrl+D | Exit (press twice) |
| Ctrl+O | Show the full transcript with tool details |
| Ctrl+R | Search your prompt history |
| Ctrl+B | Move a running command or agent to the background |
| Ctrl+T | Show or hide Claude's task checklist |
| Ctrl+S | Stash your draft prompt, press again to restore it |
| Ctrl+G | Edit your prompt in your text editor |
| Ctrl+V | Paste an image (Cmd+V in iTerm2, Alt+V on Windows) |
| Ctrl+L | Redraw the screen |
| Option+P / Alt+P | Switch model without losing your prompt |
| Option+T / Alt+T | Toggle extended thinking |
| Option+O / Alt+O | Toggle fast mode |
| Up / Down | Move through your previous prompts |
Prompt prefixes#
Start your message with one of these characters to change what it does.
| Start with | What it does |
|---|---|
/ | Run a command or skill |
! | Shell mode: run a command and let Claude see the output |
@ | Mention a file or folder |
? | Show the shortcut help (on an empty prompt) |
Command-line commands and flags#
Use these when you start Claude Code from your terminal. Flags can be combined, for example claude -c --model opus.
| Command or flag | What it does |
|---|---|
claude | Start an interactive session |
claude "task" | Start with a first prompt |
claude -p "task" | Answer once and exit (scripts, CI) |
claude -c | Continue the last conversation in this folder |
claude -r "name" | Resume a session by name or ID |
claude -w [name] | Start in its own git worktree |
claude -n "name" | Name the session |
--model sonnet | Choose the model: sonnet, opus, haiku, fable |
--permission-mode plan | Start in a permission mode |
--effort high | Set the effort level for this session |
--add-dir ../lib | Give access to another folder |
--allowedTools "Bash(npm test)" | Allow tools without asking |
--append-system-prompt "…" | Add your own instructions |
--output-format json | JSON output in print mode |
--max-turns 5 | Limit turns in print mode |
claude update | Update to the latest version |
claude doctor | Check your installation |
claude mcp add … | Add an MCP server |
claude plugin install … | Install a plugin |
claude agents | Watch and manage background sessions |
claude auth login | Sign in from the terminal |
Be careful with this one: --dangerously-skip-permissions turns off every permission prompt. Only use it inside a container or virtual machine with nothing you'd mind losing. The full flag list is in Anthropic's CLI reference.
The 10 commands to learn first#
If you only remember a few, make it these.
/initonce per project, so Claude learns how your code is organized./plan(or Shift+Tab into Plan mode) before any big change.Escto stop and redirect Claude the moment it goes the wrong way./clearwhen you switch to a new task. It's the easiest way to save tokens./compactwhen a long task is filling the context window./rewindto undo Claude's changes back to an earlier point./diffto read every change before you commit./code-reviewto have Claude check its own work for bugs./modelto use a faster model for simple jobs and a stronger one for hard ones./usageto see what a session costs and how much of your plan is left.
Your own commands: skills#
Custom slash commands are now skills. Any file at .claude/skills/<name>/SKILL.md becomes a /name command, and older files in .claude/commands/ keep working. You can type several at the start of one message, such as /write-tests /fix-issue 123.
Our guide to Claude Code skills shows how to write one, and the slash commands guide covers arguments and examples.
Commands that no longer exist#
Older tutorials still mention these. They've been removed, so here's what to use instead.
| Old | Use instead |
|---|---|
/vim | /config, then Editor mode |
/pr-comments | Ask Claude to show the pull request comments |
/ultraplan | Plan mode (/plan or Shift+Tab) |
# to add a memory | /memory, or ask Claude to remember something |
Frequently asked questions
How do I see all Claude Code commands?
Type / at the Claude Code prompt. A menu lists every built-in command, bundled skill and custom skill available to you, and typing more letters filters it. /help also shows help and the command list.
What's the difference between /clear and /compact?
/clear starts a new conversation with empty context. /compact keeps the same conversation but summarizes what came before to free up space. Use /clear when you switch tasks and /compact in the middle of a long one.
How do I undo what Claude Code changed?
Run /rewind (also /undo or /checkpoint), or press Esc twice on an empty prompt, and pick the point to go back to. It can restore the conversation, the code or both. Keep your project in Git too, because rewind doesn't undo commands Claude ran.
How do I add a new line without sending the message?
Press Shift+Enter. It works out of the box in iTerm2, WezTerm, Ghostty, Kitty, Warp and Windows Terminal. In other terminals, run /terminal-setup once.
How do I switch models in Claude Code?
Run /model to pick one, or press Option+P on Mac or Alt+P on Windows and Linux. From the terminal you can start with a model using claude --model sonnet.
Can I make my own slash commands?
Yes. Custom commands are now skills: create .claude/skills/<name>/SKILL.md and it becomes /name. Files in the older .claude/commands/ folder still work.
Is there a Claude Code cheat sheet PDF?
Yes. This page has a free two-page printable PDF with the same commands, shortcuts and flags, at the link near the top. No sign-up needed.