Claude Code Cheat Sheet: Commands & Shortcuts You'll Actually Use (2026)
With Claude Code you really only need 7 slash commands - /help, /clear, /compact, /init, /context, /cost, /model - plus 5 keys - Shift+Tab (switch mode), Esc (interrupt), Esc Esc (rewind), Ctrl+C (cancel) and @ (attach a file) - to cover about 90% of your day. The full cheat sheet (CLI + slash + shortcuts) and a printable copy are right below.
What this Claude Code cheat sheet covers & how to read it
This page pulls every Claude Code command and shortcut you actually reach for into one place, so you can bookmark it and keep coming back. There are three kinds of "commands" - don't mix them up:
- (1) CLI commands - typed in your terminal to open or control a session, e.g.
claude,claude -c,claude update. These are operating-system commands, not something you type inside the chat. - (2) Slash commands - typed inside a session, always starting with
/, e.g./clear,/compact. Type a single/and you get the full menu of commands installed on your machine (including custom, plugin, and MCP commands). - (3) Keyboard shortcuts - drive the session from the keyboard, e.g.
Shift+Tab,Esc. Type?to see the shortcut list right where you are.
Memory trick: / opens the command menu, ? opens the shortcut sheet. Those two keys are the "doors" to discovering everything else without memorizing it. If you only have time for one section, read "The 7 commands you'll use most" just below - keep the rest for when you need it. Every table here is copy-paste friendly, so grab the part that matches your work and drop it into your own notes.
The 7 slash commands you'll use most (from daily real use)
Not every command gets used equally. In day-to-day work I touch the seven below far more than the rest - especially the three marked with ⭐, which handle context/token management, the thing that decides whether a session stays smooth or gets sluggish.
| Command | What it does | When to use it |
|---|---|---|
⭐ /clear | Wipes all context and starts a clean session | When you switch to an unrelated task - keeps Claude from "remembering" the old job by mistake |
⭐ /compact | Compresses the conversation history into a summary, keeping the key points | When a session is long and nearly out of context but you want to keep the same thread going |
⭐ /context | Shows how much context is in use and what's taking up space | When Claude feels slow or off - check this before deciding to clear or compact |
/cost | Shows tokens/cost spent in the session | When you need to watch the budget, especially on a big task |
/init | Scans the project and creates a starter CLAUDE.md | The first time you open Claude Code in a new repo |
/model | Switches the model used for the session | When you want a stronger model for hard work, or a lighter one for small stuff |
/help | Shows help & the command list | When you forget a command - or just type / to browse quickly |
Pocket rule for context: done with the task, /clear; mid-task and running low, /compact; and when in doubt, type /context to look before you decide. These three save tokens and keep Claude's answers locked onto the work at hand.
The full slash commands table
Below are the common slash commands, grouped by purpose. The real list changes with the version and with the custom/plugin/MCP commands you've installed - the surest way is always to type / on your own machine to see exactly what you have.
| Group | Commands |
|---|---|
| Session & context | /clear · /compact · /context · /rewind 🆕 · /resume · /status |
| Project & config | /init · /memory · /config · /agents · /permissions · /mcp · /hooks |
| Getting work done | /review · /pr · /add-dir · /vim · /plan · /simplify 🆕 |
| System | /doctor · /cost · /bug · /login · /logout · /release-notes |
New/renamed in 2026 (🆕): the conversation-branching command /fork is now /branch; /rewind lets you jump back to an earlier checkpoint; and /simplify cleans up and trims the code Claude just wrote. If you're used to an old name and it doesn't fire, type / to see the current name in your build. The canonical command names for each version live in the official Claude Code docs.
CLI commands & flags you run from the terminal
This is the part almost no cheat sheet gathers in full. These run in your terminal (not inside a session) and are used to open sessions, run headless mode, or maintain the tool.
| Command | What it does | Example |
|---|---|---|
claude | Opens an interactive session in the current directory | claude |
claude "prompt" | Opens a session with a first prompt already loaded | claude "fix the build error" |
claude -p "…" | Headless/print mode: runs once, prints the result, then exits (great for scripts) | claude -p "summarize the README" |
claude -c / --continue | Continues the most recent session | claude -c |
claude -r / --resume | Pick and reopen an older session from a list | claude -r |
claude --model … | Set the model when opening a session | claude --model sonnet |
claude update | Updates Claude Code to the latest version | claude update |
claude mcp | Manage connected MCP servers | claude mcp list |
claude config | View/change configuration from the terminal | claude config |
claude doctor | Diagnose your install when something's off | claude doctor |
--dangerously-skip-permissions | ⚠️ Skips every permission prompt - Claude runs commands/edits files with no confirmation | claude --dangerously-skip-permissions |
The two flags worth remembering every day are -c (jump right back into the last session, perfect when you accidentally close the terminal) and -p (run once and exit, perfect for dropping Claude into a script or CI pipeline). And claude doctor should be the first thing you type whenever something feels "off" - it checks your install and points out the problem before you waste time guessing.
Safety warning: only use --dangerously-skip-permissions in an isolated environment (a container/VM, a throwaway repo). On a real machine or an important repo, this flag can let Claude delete or overwrite files without asking. To understand the safer permission model, see the guide on managing Claude Code permissions safely.
Keyboard shortcuts table (Windows/Linux vs macOS)
This is the biggest gap most cheat sheets leave blank. Here's the full table, distinguishing keys for Windows/Linux (Ctrl) and macOS (Cmd) where they differ.
| Key | What it does | Notes |
|---|---|---|
Shift+Tab | Switch mode: normal → auto-accept edits → Plan mode | Same on every OS; see the Plan mode section below |
Esc | Interrupt a running Claude (stop the answer/task) | The "emergency brake" you'll use most |
Esc Esc | Open the rewind/checkpoint menu to jump back | Press Esc twice in a row |
Ctrl+C | Cancel the current operation / exit | macOS uses Ctrl+C too (not Cmd) |
Ctrl+D | Exit the session | When the input line is empty |
Ctrl+R | Reverse-search your prompt history | Just like your shell's reverse-search |
Ctrl+O | View the session's full transcript | Re-read everything, including collapsed parts |
↑ / ↓ | Browse the prompts you've typed | Faster than retyping |
Tab | Auto-complete (file paths, commands…) | Type a few characters, then Tab |
/ | Open the slash command menu | How to look up commands that actually exist on your machine |
? | See the shortcut list in place | No need to memorize this whole table |
Quick prefixes: ! bash · @ file · # memory
These three line-leading characters let you move fast without long commands:
!- run bash directly. Type!npm testto run it right in the session's terminal; Claude sees the output and uses it for the next step. Handy when you want Claude to actually "see" a command's result instead of you describing it.@- attach a file/folder to your prompt. Type@src/app.tsto load the file's contents into context; path auto-complete kicks in as you keep typing.#- add to memory fast. Type#always use pnpm instead of npmto write a convention intoCLAUDE.mdwithout opening the file by hand.
Want to write a solid CLAUDE.md for your project (so the # prefix records things in the right place and Claude follows your conventions), there's a dedicated guide for it.
Permission modes & Plan mode (with Shift+Tab)
Press Shift+Tab to cycle through three modes, one step at a time:
- Normal - Claude asks for confirmation before running a command or editing a file. Safest for important work.
- Auto-accept edits - Claude applies file edits without asking each time. Fast, and good when you trust the task and plan to review afterward.
- Plan mode - Claude only reads and plans, changing nothing. Use it when you want Claude to survey the codebase and propose an approach first, then you approve before it acts.
Safety tip: for big changes or code you don't fully understand yet, start in Plan mode so Claude lays out a plan, read it carefully, then
Shift+Tabback to a mode that allows edits. This avoids sweeping, unintended changes.
Make your own command (custom slash command)
You can turn a prompt you use a lot into your own slash command. It's dead simple: create a Markdown file in the .claude/commands/ folder, and the file name becomes the command name.
# File: .claude/commands/write-tests.md
Write unit tests for the file I attach.
Use the test framework already in the project.
Cover both error cases and edge cases, and name the tests clearly.
Once saved, inside a session just type /write-tests with a file (@src/app.ts) and Claude runs exactly that prompt. Put it in the repo's .claude/commands/ and the whole team shares it; put it in your personal folder and it's yours alone. This is the cheapest way to standardize the things you do over and over.
Want to go deeper (parameters, arguments, organizing many commands), there will be a dedicated post on custom slash commands in this cluster - bookmark the page to catch it.
📥 Download the printable cheat sheet (PDF/PNG)
Since this is a reference page, I've put together a one-page version you can print and tape next to your monitor or keep offline - it bundles all three tables: CLI, slash, and shortcuts.
While the printable is on the way, you can just highlight & copy the tables above straight into your notes - they're all real tables, copy-paste friendly.
Move faster with prebuilt commands (kits)
Beyond writing custom commands one at a time, there are prebuilt kits that ship dozens of slash commands, skills, and workflows for Claude Code - load them once and you instantly have standardized commands for frontend, backend, database, and code review. One option here is the AgentKit kit for Claude Code (installed via the ak CLI); I have a separate review so you can decide whether it fits, or you can look straight at the AgentKit site (20% off via link). If you prefer full control over every command, the custom commands above are plenty - a kit just saves you from building the whole set from scratch.
Frequently asked questions (FAQ)
How do I see every command in Claude Code?
Type / right inside a session to open the full menu of every slash command on your machine, including custom, plugin, and MCP commands. For keyboard shortcuts, type ?. This is the most accurate way, because the command list changes with the version.
What's the difference between /clear and /compact?
/clear wipes the context and starts over from scratch - use it when you switch to an unrelated task. /compact compresses the history into a summary but keeps the thread going - use it when a long session is nearly out of context but you want to stay on the same task.
Which key cancels a running Claude?
Press Esc to interrupt the current answer or task without leaving the session. If you want to cancel the operation and exit entirely, use Ctrl+C.
How do I undo/rewind?
Press Esc twice in a row (Esc Esc) to open the rewind menu and jump back to an earlier checkpoint, or type the /rewind command. This lets you back out when Claude heads the wrong way without starting over.
How do I run a bash command without Claude processing it?
Type ! at the start of the line, e.g. !npm test. The command runs directly in the session's terminal, and Claude still sees the output to use for the next step.
Can I create my own commands?
Yes. Create a Markdown file in .claude/commands/ (e.g. write-tests.md) with your prompt as the content, then type /write-tests in a session. Put it in the repo and the whole team shares it.
Conclusion + next steps
Once you've got the 7 commands + 5 keys from the top of this page, you'll run Claude Code smoothly most of the time; for the rest, just type / and ? to look things up in place. Save or print this page and keep it by your monitor, and remember the command list shifts between versions - see an unfamiliar command, check it against the / menu on your machine. If you're just starting out, read the 10 first steps for beginners next; and if you're still not sure what this tool even is, read what Claude Code is.