Black Friday sale: 85 Claude Code agents for $29 one-time · lifetime updatesGet access →

Claude Code cheat sheet: every command, shortcut and flag (with printable PDF)

Updated · 8 min read

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.

Claude Code commands: sessions and context
CommandWhat it does
/clearStart a fresh conversation with empty context
/compact [focus]Summarize the conversation to free up context
/contextShow 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
/rewindUndo the conversation and code to an earlier point (also /undo)
/btw [question]Ask a side question without adding it to the conversation
/recapOne-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
/exitLeave Claude Code (also /quit)

Model, cost and status#

Claude Code commands: model, cost and status
CommandWhat 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
/usageSession cost, plan limits and stats (also /cost, /stats)
/statusVersion, model, account and connection
/rate-limit-optionsWays to keep working when you hit a usage limit

Project setup#

Claude Code commands: project setup
CommandWhat it does
/initCreate a CLAUDE.md guide for this project
/memoryEdit CLAUDE.md files and auto memory
/add-dir <path>Give Claude access to another folder
/cd <path>Move the session to another folder
/permissionsManage allow, ask and deny rules
/configOpen settings (or /config key=value)
/hooksView hook configurations
/agentsCreate or manage subagents
/skillsList skills and choose which Claude can use
/pluginInstall and manage plugins
/mcpManage MCP servers and their logins
/importBring settings over from Codex, Gemini CLI or Cursor
/doctorCheck your install and settings, and fix problems

Plan, review and ship#

Claude Code commands: plan, review and ship
CommandWhat it does
/plan [task]Enter plan mode: Claude proposes before it edits
/diffReview all changes in your working tree
/code-reviewReview the current diff for bugs (also /review)
/security-reviewCheck your branch for security problems
/simplifyFind and apply cleanups in changed code
/install-github-appSet up Claude for GitHub pull requests and Actions

Background, cloud and automation#

Claude Code commands: background, cloud and automation
CommandWhat it does
/tasksSee background work and subagents
/subtask <task>Hand a task to a background subagent and keep working
/backgroundSend this session to the background and free the terminal
/loop [interval] [prompt]Repeat a prompt while the session is open
/scheduleCreate scheduled cloud tasks
/goal <condition>Keep working across turns until a condition is met
/desktopContinue this session in the desktop app
/teleportPull a cloud session into this terminal
/remote-controlControl this session from claude.ai or your phone

Look and feel, help#

Claude Code commands: look and feel, help
CommandWhat it does
/themeChange colors, including colorblind-friendly themes
/statuslineSet up the status line
/terminal-setupMake Shift+Enter add a new line in your terminal
/keybindingsEdit your keyboard shortcuts
/helpShow help and all commands
/powerupShort interactive lessons on Claude Code features
/release-notesSee what changed in each version
/passesShare a free week of Claude Code (eligible plans)
/bugReport 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.

Claude Code keyboard shortcuts
KeysWhat it does
EscStop Claude mid-answer so you can redirect it
Esc EscClear your draft, or open rewind when the prompt is empty
Shift+TabCycle permission modes (Manual, Accept edits, Plan, Auto)
Shift+EnterNew line without sending (run /terminal-setup if it doesn't work)
Ctrl+CInterrupt, or clear input; press twice to exit
Ctrl+DExit (press twice)
Ctrl+OShow the full transcript with tool details
Ctrl+RSearch your prompt history
Ctrl+BMove a running command or agent to the background
Ctrl+TShow or hide Claude's task checklist
Ctrl+SStash your draft prompt, press again to restore it
Ctrl+GEdit your prompt in your text editor
Ctrl+VPaste an image (Cmd+V in iTerm2, Alt+V on Windows)
Ctrl+LRedraw the screen
Option+P / Alt+PSwitch model without losing your prompt
Option+T / Alt+TToggle extended thinking
Option+O / Alt+OToggle fast mode
Up / DownMove through your previous prompts

Prompt prefixes#

Start your message with one of these characters to change what it does.

Claude Code prompt prefixes
Start withWhat 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.

Claude Code CLI commands and flags
Command or flagWhat it does
claudeStart an interactive session
claude "task"Start with a first prompt
claude -p "task"Answer once and exit (scripts, CI)
claude -cContinue 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 sonnetChoose the model: sonnet, opus, haiku, fable
--permission-mode planStart in a permission mode
--effort highSet the effort level for this session
--add-dir ../libGive access to another folder
--allowedTools "Bash(npm test)"Allow tools without asking
--append-system-prompt "…"Add your own instructions
--output-format jsonJSON output in print mode
--max-turns 5Limit turns in print mode
claude updateUpdate to the latest version
claude doctorCheck your installation
claude mcp add …Add an MCP server
claude plugin install …Install a plugin
claude agentsWatch and manage background sessions
claude auth loginSign 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.

  1. /init once per project, so Claude learns how your code is organized.
  2. /plan (or Shift+Tab into Plan mode) before any big change.
  3. Esc to stop and redirect Claude the moment it goes the wrong way.
  4. /clear when you switch to a new task. It's the easiest way to save tokens.
  5. /compact when a long task is filling the context window.
  6. /rewind to undo Claude's changes back to an earlier point.
  7. /diff to read every change before you commit.
  8. /code-review to have Claude check its own work for bugs.
  9. /model to use a faster model for simple jobs and a stronger one for hard ones.
  10. /usage to 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.

Removed Claude Code commands and their replacements
OldUse instead
/vim/config, then Editor mode
/pr-commentsAsk Claude to show the pull request comments
/ultraplanPlan 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.

Sources

Keep reading