Claude Code has two command layers. Shell commands start or resume a session from your terminal. Slash commands run inside a session and control what happens in it. A command that seems not to work is often typed in the wrong layer.
This cheat sheet covers the commands you will actually use: launch commands and flags, the slash commands worth memorizing, keyboard shortcuts and input prefixes, plus the entry points for CLAUDE.md, hooks, and subagents. Everything was checked against the official documentation on November 15, 2026. Commands change between releases, so treat the docs as the final word.
Command layers and input prefixes
| Type | Where you type it | Examples | What it does |
|---|---|---|---|
| Launch command | Your shell | claude, claude -c, claude -p "question" | Starts a session, resumes one, or runs a one-shot task |
| Slash command | The Claude Code prompt | /clear, /model, /compact | Controls the current session: context, model, permissions, settings |
| Input prefix | Start of a prompt | !, @, /, ? | Switches to shell mode, mentions a file, opens the command menu, shows shortcut help |
A slash command is a command you type with a leading / inside a session. Type / to open the menu and keep typing to filter it. A command is only recognized at the start of a message; the text after it becomes its arguments. In /compact keep the API design notes, the trailing text tells the compaction what to preserve.
Launch commands and flags
Common launch commands
| Command | What it does |
|---|---|
claude | Start an interactive session |
claude "task" | Start an interactive session with an initial prompt |
claude -p "question" | Print mode: answer, then exit; useful in scripts |
cat file | claude -p "question" | Pipe file contents into a one-shot query |
claude -c | Continue the most recent conversation in this directory |
claude -c -p "question" | Continue that conversation with a one-shot query |
claude -r "session" "question" | Resume a session by ID or name |
claude update | Update to the latest version |
claude doctor | Run read-only install and settings diagnostics without starting a session |
claude auth login / logout / status | Sign in, sign out, or check auth status |
claude mcp | Configure MCP servers |
claude setup-token | Generate a long-lived OAuth token for CI and scripts |
Flags worth knowing
| Flag | What it does |
|---|---|
--model <model> | Set the model for this session: an alias like sonnet or opus, or a full model name |
--permission-mode <mode> | Start in default, acceptEdits, plan, auto, dontAsk, or bypassPermissions |
--continue / -c | Load the most recent conversation in this directory |
--resume / -r | Resume a specific session; with no value, open the session picker |
--fork-session | Give the resumed session a new ID instead of reusing the original |
--worktree / -w [name] | Start in an isolated git worktree |
--add-dir <path> | Add another working directory |
--agents <JSON> | Define subagents for this session only |
--agent <name> | Run the whole session as a named subagent |
--mcp-config <file or JSON> | Load MCP servers from a file or inline JSON |
--settings <file or JSON> | Override settings for this session |
--append-system-prompt <text> | Append text to the default system prompt |
--allowedTools / --disallowedTools | Pre-approve or deny specific tools |
--tools <list> | Restrict which built-in tools are available |
--output-format text|json|stream-json | Set the print-mode output format |
--max-turns <n> | Cap the number of agentic turns in print mode |
--max-budget-usd <amount> | Stop a print-mode run when the estimated spend reaches the amount |
--effort <level> | Set effort: low, medium, high, xhigh, max, or ultracode; available levels depend on the model |
--fallback-model <list> | Try the listed models in order when the primary is unavailable |
--name / -n <name> | Name the session so it is easier to find with /resume |
--safe-mode | Start with all customizations disabled to troubleshoot configuration |
--bare | Minimal mode: skip hooks, skills, MCP servers, CLAUDE.md, and other auto-discovery |
--version / -v | Print the version |
claude --help does not list every flag; the official CLI reference says so explicitly. A flag missing from --help is not necessarily unavailable.
Slash commands by task
Availability varies by platform, plan, and version. If a command is not in your / menu, that does not mean you typed it wrong.
Daily session control
| Command | What it does |
|---|---|
/help | Show help and available commands |
/clear [name] | Start a new conversation with empty context; aliases /reset, /new |
/compact [instructions] | Summarize the conversation to free up context |
/context [all] | Show context usage as a colored grid; all expands the breakdown |
/usage | Show session cost, plan usage limits, and activity stats; aliases /cost, /stats |
/resume [session] | Resume by ID or name, or open the picker; alias /continue |
/rewind | Roll code and/or conversation back to a checkpoint, or summarize from a message; aliases /checkpoint, /undo |
/branch [name] | Branch the current conversation and keep the original |
/fork [prompt] | Copy the conversation into a new background session and keep working here |
/export [filename] | Export the conversation as plain text |
/recap | Generate a one-line summary of the current session |
/rename [name] | Rename the session; the name shows on the prompt bar |
/tasks | View and manage background work in this session; alias /bashes |
/btw [question] | Ask a side question without adding it to the conversation |
/exit | Exit Claude Code; alias /quit |
/clear, /compact, and /rewind are easy to mix up. /clear starts a fresh conversation and you can still resume the old one. /compact stays in the same conversation and summarizes it. /rewind goes back to an earlier point, optionally including code.
Model and interface
| Command | What it does |
|---|---|
/model [model] | Switch models and save the choice as the default for new sessions; no argument opens the picker |
/effort [level|auto|status] | Set the effort level; status prints the current one |
/fast [on|off] | Toggle fast mode |
/config [key=value ...] | Open settings, or set a value directly, e.g. /config theme=dark; alias /settings |
/status | Open the Settings interface on the Status tab: version, model, account, connectivity |
/output-style [style] | List or switch output styles |
/statusline | Configure the status line |
/theme | Change the color theme |
/keybindings | Open your keyboard shortcut file |
/terminal-setup | Install a Shift+Enter newline binding in VS Code, Cursor, and similar terminals |
/doctor | Check installation, settings, extensions, and CLAUDE.md, and propose fixes; alias /checkup |
Project, memory, and extensions
| Command | What it does |
|---|---|
/init | Generate a starter CLAUDE.md; if one exists, it suggests improvements instead of overwriting |
/memory | Edit CLAUDE.md files, toggle auto memory, and view auto-memory entries |
/add-dir <path> | Add a working directory to this session |
/cd <path> | Move the session to another working directory and keep the conversation |
/agents | In the current version, print a reminder to ask Claude to create or manage subagents, or edit .claude/agents/ yourself (v2.1.197 and earlier opened an interactive interface) |
/hooks | Browse configured hooks read-only, labeled by source |
/mcp [reconnect|enable|disable ...] | Manage MCP connections and OAuth |
/plugin [subcommand] | Manage plugins: install, enable, disable, list |
/skills | List available skills; filter by name, description, or source |
/reload-skills | Re-scan skill and command directories without restarting |
Permissions and review
| Command | What it does |
|---|---|
/permissions | Manage allow, ask, and deny rules; alias /allowed-tools |
/plan [description] | Enter plan mode, optionally with a task |
/sandbox | Toggle sandbox mode (supported platforms) |
/diff | Review working-tree changes, including edits Claude has made |
/code-review [level] [--fix] [pr#|branch|path] | Review the current diff or a target for correctness bugs; --fix applies findings; alias /review |
/security-review | Check the current branch's changes for security risks |
Other useful commands
| Command | What it does |
|---|---|
/bug [report] | Report a bug or share the conversation, with a consent screen; alias /share |
/feedback [report] | Send product feedback |
/login / /logout | Sign in or out of your Anthropic account |
/release-notes | Browse the changelog in a version picker |
/mobile | Show a QR code for the Claude mobile app |
Keyboard shortcuts and input
Shortcuts
| Shortcut | What it does |
|---|---|
Esc | Interrupt the current response or tool call; close a dialog; decline a permission prompt |
Esc Esc | Clear the input draft; on an empty prompt, open the rewind menu |
Ctrl+C | Interrupt a running operation; when nothing is running, clear the input, then exit on the next press |
Ctrl+D | Exit; the first press shows a confirmation hint, the second press within 800 ms exits |
Ctrl+L | Redraw the screen |
Ctrl+O | Toggle the transcript viewer, including tool calls and the model used |
Ctrl+R | Reverse-search command history |
Ctrl+B | Background running tasks; tmux users press it twice |
Ctrl+T | Show or hide Claude's task checklist |
Ctrl+S | Stash the current prompt; press again on an empty prompt to restore it |
Ctrl+G | Edit the prompt in your default text editor |
Ctrl+V | Paste an image from the clipboard (Cmd+V in iTerm2, Alt+V on Windows and WSL) |
Shift+Tab | Cycle permission modes |
Option+P (macOS) / Alt+P | Switch models without clearing your prompt |
Option+T / Alt+T | Toggle extended thinking |
Option+O / Alt+O | Toggle fast mode |
Tab | Accept an autocomplete suggestion |
Up / Down or Ctrl+P / Ctrl+N | Navigate command history |
The Shift+Tab cycle runs default (labeled Manual in the UI) → acceptEdits → plan. Optional modes slot in after plan: bypassPermissions first, then auto, if enabled. dontAsk is not in the cycle; start with --permission-mode dontAsk instead.
What the modes mean in practice: default asks before actions; acceptEdits auto-approves file edits; plan is read-only research that produces a plan first; auto lets a classifier decide which actions can proceed; dontAsk allows only pre-approved tools and denies the rest; bypassPermissions skips permission checks and belongs in an isolated container or VM.
Input prefixes and multiline
| Type this | What it does |
|---|---|
/ | Open the command and skill menu |
! | Shell mode: run a command and bring its output into the session |
@ | File path autocomplete |
? on an empty prompt | Toggle the keyboard shortcut help panel |
\ + Enter | Newline; works in all terminals |
Ctrl+J | Newline; works in any terminal |
Shift+Enter | Newline; native in iTerm2, WezTerm, Ghostty, Kitty, Warp, and Windows Terminal |
Option+Enter | Newline; on macOS, configure Option as Meta first |
CLAUDE.md and memory
CLAUDE.md holds persistent project instructions that load at the start of every session. Two commands are the entry points:
/initreads the project and generates a starterCLAUDE.md. If the file already exists, it suggests improvements rather than overwriting it./memorylists user, project, and local memory files and opens them for editing. It also toggles auto memory, which is Claude's own notes, separate from the CLAUDE.md files you write.
There are four scopes:
| Scope | Location | Purpose |
|---|---|---|
| Managed policy | macOS: /Library/Application Support/ClaudeCode/CLAUDE.md; Linux/WSL: /etc/claude-code/CLAUDE.md; Windows: C:\Program Files\ClaudeCode\CLAUDE.md | Organization-wide rules managed by IT |
| User | ~/.claude/CLAUDE.md | Personal preferences for all your projects |
| Project | ./CLAUDE.md or ./.claude/CLAUDE.md | Team-shared instructions, committed to the repo |
| Local | ./CLAUDE.local.md | Personal project preferences; add it to .gitignore |
You can import other files with @path/to/file, up to four levels deep. An @ inside a code block does not trigger an import. To confirm what actually loaded, run /context all and check the Memory files list.
Hooks and subagents
Hooks: browse with /hooks, edit in settings
/hooks opens a read-only browser of the hooks that are active, labeled by source: user settings, project settings, local settings, a plugin, or the current session. To change or remove one, edit the settings file:
~/.claude/settings.jsonfor all your projects.claude/settings.jsonfor one project, shareable through the repo.claude/settings.local.jsonfor one project, local only
Hook events cover session start, prompt submission, before and after tool calls, the end of a response, subagent start and stop, and context compaction. Common ones are SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SubagentStart, and PreCompact. The full event table and JSON schema are in the hooks reference.
Subagents: /agents is a pointer, files are the config
In the current version, /agents does not open a management UI. It prints a reminder to ask Claude to create or manage subagents, or to edit .claude/agents/ or ~/.claude/agents/ yourself. Only v2.1.197 and earlier opened the interactive interface, so older tutorials are out of date.
Subagent definitions live in:
.claude/agents/for the project, committed for the team~/.claude/agents/for all your projects--agents '<JSON>'for the current session only, useful for quick tests- a plugin's
agents/directory while the plugin is enabled
You can invoke one in natural language, use an @ mention to direct one task to it, or run the whole session as that subagent with --agent. Claude also delegates to built-in subagents such as Explore and Plan on its own.
Where custom commands went
If you followed an older guide, you may be looking for .claude/commands/. Custom slash commands have been merged into skills.
- Existing
.claude/commands/*.mdfiles still work. The file name is the command name, sodeploy.mdbecomes/deploy. - For new work, prefer a skill at
.claude/skills/<name>/SKILL.md. The folder name becomes the command name, and a skill can include supporting files such as scripts and templates. /skillslists available skills;/reload-skillsre-scans without restarting.- You can stack skills in one message:
/skill-a /skill-b do something, up to six.
Aliases and removed commands
Aliases
| You might type | It is the same as |
|---|---|
/reset, /new | /clear |
/continue | /resume |
/checkpoint, /undo | /rewind |
/cost, /stats | /usage |
/settings | /config |
/allowed-tools | /permissions |
/checkup | /doctor |
/review | /code-review |
/bashes | /tasks |
/quit | /exit |
/share | /bug |
Removed or renamed
| Command | Status |
|---|---|
/vim | Removed in v2.1.92; use /config → Editor mode |
/pr-comments | Removed in v2.1.91; ask Claude to view PR comments instead |
/ultraplan | Removed; use plan mode (/plan or Shift+Tab) |
What to memorize first
You do not need to memorize the whole table. Three tiers are enough:
- Every day:
Escto interrupt,Shift+Tabfor permission modes,/clearfor a fresh start,/compactto free context,/modelto switch models,/resumeto get a session back. - Every week:
/initand/memoryfor CLAUDE.md,/permissionsfor rules,/contextto inspect the window,/rewindto go back,/usageto check spend. - Look up when needed:
/hooks,/agents,/mcp,/doctor, and the shell side:-p,-c,-r, and--agents.
When in doubt, type / and read the menu, or check the official docs. The menu matches the release you are running, which a static cheat sheet cannot.
Sources and version
Official documentation, fetched on November 15, 2026:
- Commands
- CLI reference
- Interactive mode
- How Claude remembers your project
- Hooks reference
- Create custom subagents
- Extend Claude with skills
Version note: as of November 15, 2026, the latest CHANGELOG entry is 2.1.325. Command availability depends on platform, plan, and version; check the official docs, claude --help, and /help in a session for the final word.