Claude Code Commands Cheat Sheet: Shortcuts, Flags, Settings
Claude Code commands on one page: slash commands, keyboard shortcuts, CLI flags and where every settings file lives, all checked against the official docs.
By Yotam DahanUpdated 12 min readClaude Code
On this page
- Start, resume and update (in your shell)
- Everyday slash commands
- Models, modes and permissions
- Set up a project
- Check work and track usage
- Account and everything else
- Keyboard shortcuts
- Prefixes and multi-line input
- Permission modes at a glance
- Where settings and memory files live
- A starter settings.json
- What to do next
Claude Code commands come in two kinds: slash commands you type inside a session, such as /clear or /model, and shell commands with flags you type before it starts, such as claude -c. This cheat sheet lists the ones you will actually use, grouped by job, plus the keyboard shortcuts and the location of every settings file. Everything was checked against Anthropic's official commands reference in October 2026, when the current version was 2.1.302.
New to the tool? The beginner tutorial shows most of these in action, one step at a time.
/clear
Starts a fresh conversation. Use it between unrelated tasks so old context stops confusing Claude and using your plan.
/context
Shows what is filling the context window. Run it when Claude seems to forget earlier details.
/rewind
Opens the rewind menu to restore code, conversation or both. Pressing Esc twice on an empty prompt does the same.
Start, resume and update (in your shell)
Type these in Terminal or PowerShell, not inside Claude Code. The full list is in the CLI reference.
| Command | What it does |
|---|---|
claude | Start an interactive session in the current folder |
claude "your task" | Start a session with your first prompt already sent |
claude -p "question" | Answer once and exit, with no interactive session (print mode) |
claude -c | Continue the most recent conversation in this folder |
claude -r | Choose an earlier conversation to resume; claude -r "name" jumps to a named one |
claude -n "name" | Start a session with a name you can resume by later |
claude --model sonnet | Start on a specific model, by alias or full name |
claude --permission-mode plan | Start in a specific permission mode |
claude --add-dir ../shared | Also give access to another folder |
claude --version | Show the installed version |
claude update | Install the newest version now |
claude doctor | Check your install and settings without starting a session |
claude auth status | Show which account you are signed in with (add --text for plain text) |
claude mcp list | List the MCP servers you have added |
claude --desktop | Open the current folder in the desktop app (macOS and x64 Windows, subscription accounts) |
Everyday slash commands
| Command | What it does | Reach for it when |
|---|---|---|
/help | Show help and available commands | You forget a command |
/clear | Start a new conversation with an empty context (also /new, /reset) | You switch to an unrelated task |
/compact [focus] | Summarize the conversation so far to free space | A long task is filling the context |
/context | Show what is filling the context window, as a colored grid | Claude seems to forget earlier details |
/resume | Reopen an earlier conversation (also /continue) | You want yesterday's session back |
/rename [name] | Name the current session | Before /clear, so you can find it later |
/branch | Split off a copy of the conversation to try another direction | You want to experiment without losing the current path |
/rewind | Roll code and conversation back to an earlier point (also /undo, /checkpoint) | A change went wrong |
/btw [question] | Ask a side question that isn't added to the conversation | You need a quick check mid-task |
/copy | Copy the last response to the clipboard | You want to paste an answer elsewhere |
/export [file] | Save the conversation as plain text | You want a record |
/recap | Get a one-line summary of the session so far | You come back after a break |
/exit | Leave Claude Code (also /quit) | You are done |
Models, modes and permissions
| Command | What it does |
|---|---|
/model [name] | Switch model and save it as your default; press s in the picker to switch for this session only |
/effort [level] | Set how hard the model thinks: low, medium, high, xhigh or max |
/fast | Toggle fast mode, a faster Opus at a higher price; on subscription plans it bills to usage credits |
/plan [task] | Enter plan mode, optionally starting with a task |
/permissions | View and edit your allow, ask and deny rules |
/config | Open settings (also /settings); /config theme=dark sets one value directly |
/theme | Change the color theme |
/output-style [style] | Change how Claude formats its responses |
Set up a project
| Command | What it does |
|---|---|
/init | Generate a starter CLAUDE.md file for the project |
/memory | Open and edit your CLAUDE.md files, and switch auto memory on or off |
/mcp | Manage connected MCP servers and their sign-ins |
/skills | List the skills available in this session |
/plugin | Browse, install and manage plugins |
/hooks | View the hooks that are configured |
/add-dir <path> | Give this session access to another folder |
/cd <path> | Move the session to another folder and keep the conversation |
/keybindings | Open your keyboard shortcuts file |
/terminal-setup | Set up new-line shortcuts for your terminal (Shift+Enter in VS Code and Cursor, Option keys in Apple Terminal) |
/statusline | Configure the status line under the prompt |
/doctor | Run a setup checkup that finds problems and offers to fix them |
Skills and MCP each have their own guide: how to create a Claude skill and what MCP is.
Check work and track usage
| Command | What it does |
|---|---|
/diff | Review the changes in your working folder, including Claude's edits |
/code-review | Review the current changes for bugs (also /review); add --fix to apply the findings |
/security-review | Check the changes on your branch for security problems |
/usage | See session cost, plan usage limits and activity (also /cost, /stats) |
/status | See version, model, account and connection details |
/insights | Get an HTML report on how you use Claude Code |
/release-notes | See what changed in each version |
Account and everything else
| Command | What it does |
|---|---|
/login and /logout | Sign in or out of your Anthropic account |
/upgrade | Open the page to move to a higher plan |
/usage-credits | Turn on or request usage credits for when you hit a limit |
/rate-limit-options | Choose what happens when a usage limit stops a task |
/privacy-settings | View and update privacy settings (Pro and Max) |
/feedback | Send feedback or a bug report (/bug opens the same dialog) |
/powerup | Take short interactive lessons on Claude Code features |
/desktop | Continue this session in the desktop app |
/remote-control | Continue this session from your phone or a browser (also /rc) |
/mobile | Show a QR code to download the Claude mobile app |
/loop [interval] [prompt] | Repeat a prompt on an interval while the session stays open |
/schedule | Create routines that run in the cloud on a schedule |
/goal [condition] | Keep Claude working across turns until a condition is met |
Can't remember which command fits? Claude Code can answer questions about itself, so ask it directly:
I'm about to [TASK]. Which slash commands, shortcuts or settings would help me most? Explain each one in a single line and tell me when not to use it.Keyboard shortcuts
From the interactive mode reference. Mac and Windows keys are the same unless noted.
| Shortcut | What it does |
|---|---|
| Esc | Stop Claude mid-step (it keeps the work done so far); close a dialog |
| Esc twice | With an empty prompt, open the rewind menu; with text, clear the draft |
| Shift+Tab | Cycle permission modes |
| Ctrl+C | Interrupt; with nothing running, first press clears the prompt, second press exits |
| Ctrl+D | Press twice on an empty prompt to exit |
| Up and Down arrows | Browse your earlier prompts |
| Ctrl+R | Search your prompt history |
| Tab | Accept an autocomplete suggestion |
| Ctrl+O | Show the full transcript, with every tool call |
| Ctrl+T | Show or hide Claude's task checklist |
| Ctrl+B | Move a running command to the background |
| Ctrl+G | Open your prompt, or a proposed plan, in your text editor |
| Ctrl+S | Stash the current draft; press again on an empty prompt to bring it back |
| Ctrl+L | Redraw the screen if the display gets garbled |
| Ctrl+V (Cmd+V in iTerm2, Alt+V on Windows) | Paste an image from the clipboard |
| Option+P (Mac) or Alt+P | Switch model without losing your draft |
| Option+T (Mac) or Alt+T | Toggle extended thinking, on models where it can be switched off |
| ? on an empty prompt | Show the shortcut help panel |
In the desktop app, Shift+Tab doesn't cycle modes, so use the mode selector instead. Press Cmd+/ on a Mac or Ctrl+/ on Windows to see the app's own shortcuts.
Prefixes and multi-line input
| Type this | What happens |
|---|---|
/ at the start | Run a command or skill |
! at the start | Run a shell command yourself; the output goes into the conversation and Claude responds to it |
@ | Mention a file or folder, with path autocomplete |
\ then Enter, or Ctrl+J | New line without sending, in any terminal |
| Shift+Enter | New line in iTerm2, Apple Terminal, Windows Terminal, Ghostty, Kitty, WezTerm and Warp; run /terminal-setup once in VS Code or Cursor |
Permission modes at a glance
| The status line shows | Mode | Runs without asking |
|---|---|---|
⏸ manual mode on | Manual (config value default) | Reads only |
⏵⏵ accept edits on | acceptEdits | Reads, file edits and common file commands such as mkdir and mv |
⏸ plan mode on | plan | Reading and exploring; no edits until you approve a plan |
⏵⏵ auto mode on | auto | Most actions, with a background safety check; the starting mode in current versions |
Where settings and memory files live
~ means your home folder (%USERPROFILE% on Windows), ~/.claude is a hidden folder inside it, and a plain .claude means the folder inside your project. Details are in the official settings guide.
| File | Applies to | What it holds |
|---|---|---|
~/.claude/settings.json | You, in every project | Personal settings: theme, default model, your own permission rules |
.claude/settings.json | Everyone in the project | Shared permissions, hooks and plugins; commit it to share it |
.claude/settings.local.json | You, in this project | Personal overrides; "Yes, and don't ask again" approvals are saved here |
managed-settings.json | Your whole organization | Company policy that nothing overrides; lives in /Library/Application Support/ClaudeCode/ (Mac), /etc/claude-code/ (Linux) or C:\Program Files\ClaudeCode\ (Windows) |
~/.claude.json | You | Sign-in state, your MCP servers, folder trust; Claude Code maintains it for you |
~/.claude/CLAUDE.md | You, in every project | Personal instructions |
CLAUDE.md or .claude/CLAUDE.md | The project | Project instructions |
CLAUDE.local.md | You, in this project | Private project notes; add it to .gitignore |
.claude/rules/*.md | The project | Instructions split by topic, optionally only for certain files |
.claude/skills/<name>/SKILL.md | The project (or ~/.claude/skills/ for you) | Skills you run with /name |
.claude/agents/*.md | The project (or ~/.claude/agents/ for you) | Subagent definitions |
.mcp.json | The project | MCP servers shared with the team |
~/.claude/keybindings.json | You | Custom keyboard shortcuts |
~/.claude/projects/<project>/memory/ | You, per project | Auto memory: notes Claude writes for itself |
When the same setting appears in several files, the one highest in this order wins:
Managed settings
Your organization's policy, which nothing else overrides
Command line
A --settings value, for that one session
Project local
.claude/settings.local.json, your personal project overrides
Shared project
.claude/settings.json, committed for the team
User
~/.claude/settings.json, your defaults everywhere
Lists such as permission rules are combined across files instead of replaced, and a deny rule anywhere beats an allow rule anywhere. What belongs inside the CLAUDE.md files has its own guide: the CLAUDE.md file explained.
A starter settings.json
Save this as .claude/settings.json in a project, or as ~/.claude/settings.json to apply it everywhere:
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"permissions": {
"defaultMode": "default",
"deny": [
"Read(./.env)",
"Read(./.env.*)",
"Read(./secrets/**)"
]
}
}"defaultMode": "default" makes new terminal sessions start in Manual mode, so Claude asks before each edit and command. The deny rules stop Claude's file tools from reading environment files, where passwords and keys usually live, and anything in a secrets folder.
Claude Code reloads most settings edits automatically. Run /status to confirm which files loaded.
Quick check0 of 3 correct
Which command starts a fresh conversation when you switch to an unrelated task?
Not quite.
/clear empties the context. /compact keeps the same conversation and summarizes it.
Where do your personal settings for every project live?
Not quite.
The file in your home folder applies everywhere. The .claude folder inside a project only applies there.
Your team's .claude/settings.json allows a command and your user settings deny it. What happens?
Not quite.
Permission rules are combined across files, and a deny rule anywhere beats an allow rule anywhere.
What to do next
Print this page or keep it pinned, and learn three commands a week instead of all of them at once, starting with /clear, /context and /rewind. When long sessions start eating into your plan, the guide to Claude Code usage limits shows which of these commands stretch it furthest. The Claude Code course has a lesson dedicated to the shortcuts that save the most time.
Printable one-pager plus 12 situation recipes
The 30 commands and shortcuts you use most on a single printable page, plus 12 'when this happens, type this' recipes for the moments people get stuck.
Enter your email and the full section opens right here. You also get a free lesson from the course.
Frequently asked questions
Why don't I see some of these commands?
Some commands depend on your platform, plan or setup. For example, /desktop only appears on macOS and x64 Windows when you sign in with a Claude subscription, and /upgrade doesn't show on Enterprise plans. If a newer command is missing everywhere, run claude update.
Can I create my own slash commands?
Yes. A custom command is a skill: a folder containing a SKILL.md file, saved in .claude/skills/ for one project or ~/.claude/skills/ for all your projects, which you then run as /folder-name. Older single-file commands in .claude/commands/ still work too.
Can I change the keyboard shortcuts?
Yes. Run /keybindings to create or open ~/.claude/keybindings.json, where you can rebind or switch off most actions, and changes apply without a restart. A few text-editing shortcuts, such as Ctrl+W, can't be remapped.
Does Claude Code have a Vim mode?
Yes. Turn it on in /config under Editor mode, or set editorMode to vim in ~/.claude/settings.json. The old /vim command has been removed.
Where are my Claude Code conversations stored?
On your own computer, as plain-text files under ~/.claude/projects/, deleted after 30 days by default; the cleanupPeriodDays setting changes that. Running claude purge deletes everything Claude Code has stored for one project.
Keep reading
How to Use Claude Code: A First-Weekend Tutorial (2026)
Learn how to use Claude Code by building a one-page site for a local business: the conversation, permissions, plan mode, undo, and 10 tips that save hours.
Claude Code · 10 min readCLAUDE.md File: What It Is, Where It Goes, 3 Templates
What a CLAUDE.md file is, where it goes, what to write and what to leave out, plus three copy-ready templates for business owners, marketers and websites.
Claude Code · 10 min readClaude Code Usage Limits Explained: How to Use Fewer Tokens
How Claude Code usage works on Pro, Max, Team and API plans: the 5-hour and weekly limits, how to check your usage, why you hit limits and 8 ways to use less.
Claude Code · 9 min read