Cheat Sheet: Slash Commands
All 60+ commands, grouped and aliased
- Locate the slash commands you'll use most by family and recall their exact syntax, aliases, and key arguments
- Use the session/context, model/quality, and workflow families correctly, including their version-gated behavior
- Distinguish a memory/config/tools command from a utility, and reach for the right diagnostic when something breaks
- Recall the removed commands (/pr-comments, /vim) and where their behavior moved
- Build a custom slash command using $ARGUMENTS, $0/$1, !`cmd`, and @file, and invoke an MCP prompt as /mcp__server__prompt
A practical slash-command reference for Claude Code, organized into six families with the aliases, key arguments, and version notes you'll reach for most. The set shifts every few releases, so treat `/help` as the final word for your install. This is the lookup companion to the built-in tour in Module 4 — scan it, bookmark it, return to it.
- 1How to read this cheat sheet
- 2Family 1 — Session & context
- 3Family 2 — Model, effort & quality
- 4Family 3 — Workflow orchestration
- 5Family 4 — Memory, config & tools
- 6Family 5 — Utilities, plus removed commands
- 7Family 6 — Custom commands & MCP prompts
How to read this cheat sheet
This is a reference, not a tour — the conceptual walkthrough lives in Module 4. Here you get the full grid so you can look up exact syntax fast.
Three rules govern every command and are worth holding in your head while you scan:
- Recognized only at message start.
/must be the first character of the line; everything after the command name becomes its arguments. /helpis authoritative for your version. Plugins, custom commands, and connected MCP servers all add entries, so your menu is personalized. Type/to autocomplete and filter.- Tags predict behavior. A
[Skill]or[Workflow]tag in/helpmeans Claude can also invoke that command autonomously when it's relevant — not just when you type it. Plain built-ins only fire when you type them.
Notation in the tables below: [optional] arguments are in square brackets, <required> in angle brackets, and | separates choices. Aliases are listed in the Notes column. Version notes like (v2.1.154+) mark when behavior landed or changed.
Note
Counts and currency
Claude Code ships dozens of built-in commands; this sheet groups the ones you'll reach for most into six families — it is not exhaustive, and new commands land often. Treat /help — not any frozen list — as the final word for your install. The default model depends on your plan and changes as new models ship, so run /model to see and switch the options available to you (Sonnet and Opus tiers).
Family 1 — Session & context
The conversation itself: its size, its history, and where you are in it. This is the family you touch most, because managing context is the core skill of working with Claude Code.
| Command | Syntax | Aliases | Notes |
|---|---|---|---|
/clear | /clear [name] | /reset, /new | Empty the context window; prior conversation stays reachable via /resume |
/compact | /compact [instructions] | — | Summarize to reclaim context, keeping CLAUDE.md, skills, and memory; optional focus instructions |
/context | /context [all] | — | Colored grid of token usage plus optimization tips; all shows the full breakdown |
/rewind | /rewind (or Esc Esc) | /checkpoint, /undo | Restore or summarize back to an earlier checkpoint |
/branch | /branch [name] | /fork | Fork the conversation at this point into a new session (CLAUDE_CODE_FORK_SUBAGENT forks to a subagent) |
/resume | /resume [session] | /continue | Switch to another saved conversation by ID/name, or open the picker; background sessions marked since v2.1.144 |
/rename | /rename [name] | — | Rename the current session (auto-generates a name if none given) |
/export | /export [filename] | — | Export the conversation as plain text to clipboard or file |
/copy | /copy [N] | — | Copy the Nth-latest response; picker for individual code blocks (w = write to file) |
/goal | /goal [condition|clear] | — | Claude keeps working until the condition is met; clear removes it |
/btw | /btw <question> | — | Ask a side question without bloating history — context-only, no tool access (f = fork) |
/focus | /focus | — | Focus view: last prompt + summary + response only |
/add-dir | /add-dir <path> | — | Grant the session file access to another working directory |
The everyday rhythm: /clear between unrelated tasks, /compact when a single long task fills the window, and /context to see why it's full before you decide.
Tip
/btw is context-only — it can't investigate
/btw answers from what's already in context and has no tool access, so it can't read files, run commands, or search. That's the point — it keeps a quick aside from bloating history. If the side question needs investigation, spawn a subagent instead.
Watch out
/add-dir files don't show in @ autocomplete
A known bug (#5605): directories added with /add-dir (or --add-dir) don't appear in @-mention tab completion. Type the full path manually. Also note /add-dir grants file access but does not discover that directory's own .claude/ config.
Family 2 — Model, effort & quality
How much brain you spend on the next turn, and the bundled review skills that audit your work. The review commands carry the [Skill] tag — Claude can run them on its own when relevant.
Model & effort
| Command | Syntax | Notes |
|---|---|---|
/model | /model [model] | Switch model and save as default; no-arg opens a picker (s = switch for this session only) |
/effort | /effort [level|auto] | Levels low/medium/high/xhigh/max/ultracode; no-arg opens a slider |
/fast | /fast [on|off] | Faster, less deliberate responses |
Effort levels run low → medium → high → xhigh → max → ultracode. Which exist depends on the model. max and ultracode are session-only (can't be saved as a default), and ultracode = xhigh reasoning + automatic workflow orchestration across subagents. /effort auto resets to the model's default.
Review & quality (bundled skills)
| Command | Syntax | Notes |
|---|---|---|
/code-review | /code-review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [target] | Review the git diff for correctness bugs; --fix applies findings, --comment posts inline GitHub PR comments, ultra runs a deep cloud multi-agent review |
/simplify | /simplify [target] | Cleanup-only review (v2.1.154+): four parallel agents for reuse, simplification, efficiency, abstraction — and apply fixes. No bug hunting |
/security-review | /security-review | Scan the diff for SQL injection, XSS, exposed credentials, insecure config |
Clean division of labor: /code-review finds bugs, /simplify cleans up, /security-review checks security.
Watch out
/simplify is not /code-review
From v2.1.154, /simplify is cleanup-only and will not catch correctness bugs — it runs four agents for reuse, simplification, efficiency, and abstraction, then applies fixes. If you want bugs found, run /code-review. (On versions before 2.1.154, /simplify behaved like /code-review --fix.)
Key insight
Effort is your cost/latency/depth dial
Don't leave effort pinned high. Reach for /effort ultracode only when a task is both hard to reason about and big enough to parallelize — it pairs xhigh reasoning with automatic orchestration. Because max and ultracode are session-only, you set them per-task, not as a forever default.
Family 3 — Workflow orchestration
Scaling work out across plan mode, subagents, the background, and Anthropic's cloud. Several carry [Skill] or [Workflow] tags, so Claude can reach for them itself.
| Command | Syntax | Aliases | Notes |
|---|---|---|---|
/plan | /plan [description] | — | Enter plan mode directly — read-only exploration that drafts a plan before edits |
/batch | /batch <instruction> | — | [Skill] Decompose into 5–30 units, plan, then spawn one background subagent per unit in isolated worktrees. Requires a git repo |
/agents | /agents | — | Open the subagent manager |
/tasks | /tasks | — | List background tasks in the current session |
/background | /background [prompt] | /bg | Detach the session to run as a background agent |
/loop | /loop [interval] [prompt] | — | [Skill] Run a prompt repeatedly while the session is open, e.g. /loop 5m check deploy; reads .claude/loop.md if no prompt |
/deep-research | /deep-research <question> | — | [Workflow] Fan out web searches, cross-check sources, synthesize a cited report |
/run | /run | — | (v2.1.145+) Launch and drive the app to confirm a change works (needs per-project run-skill config) |
/verify | /verify | — | (v2.1.145+) Verify a change by running the app and observing behavior |
/run-skill-generator | /run-skill-generator | — | [Skill] (v2.1.145+) Teach /run and /verify how to build, launch, and drive your project's app by writing a per-project run skill |
/schedule | /schedule [description] | — | Create a cron routine that runs on Anthropic's cloud (/routines lists them) |
/autofix-pr | /autofix-pr [prompt] | — | Spawn a Claude Code on the web session that watches the current branch's PR and pushes fixes when CI fails or reviewers comment; pass a prompt to give it different instructions. Needs the gh CLI + access to Claude Code on the web |
The big four for everyday scaling: /plan to think before acting, /batch to fan a large change out, /background to detach long work, and /loop to poll until something is true.
Example
Polling a deploy with /loop
/loop 5m check if the staging deploy finished and ping me when it's green runs the prompt every 5 minutes while the session stays open. Omit the prompt and /loop reads .claude/loop.md instead — handy for a reusable polling routine you commit to the repo.
Note
/run and /verify need a run-skill
/run and /verify (v2.1.145+) launch and drive the actual app, but they require per-project configuration so Claude knows how to build and start it. Run /run-skill-generator once to teach them — after that, /verify can confirm a change works in the real app, not just in tests.
Family 4 — Memory, config & tools
Everything that shapes the environment: what Claude remembers, what it's allowed to do, and which extensions are loaded.
| Command | Syntax | Aliases | Notes |
|---|---|---|---|
/init | /init | — | Scan the codebase and generate a starter CLAUDE.md (CLAUDE_CODE_NEW_INIT=1 = interactive multi-phase) |
/memory | /memory | — | Edit CLAUDE.md, toggle auto-memory, list loaded instruction files |
/mcp | /mcp | — | Manage MCP servers and OAuth connections |
/permissions | /permissions | /allowed-tools | Manage allow/ask/deny rules; review recent denials (r = retry) |
/hooks | /hooks | — | View hook configurations |
/config | /config | /settings | Settings UI — theme, model, editor (vim) mode, output style, prompt suggestions |
/skills | /skills | — | List skills (t = sort by tokens, Space = hide) |
/plugins | /plugins | — | Manage installed plugins |
/reload-plugins | /reload-plugins | — | Hot-reload plugins without restarting |
/theme | /theme | — | Switch theme (auto/light/dark/colorblind/ANSI/custom) |
/color | /color [color] | — | Set the prompt accent color |
/usage | /usage | /cost, /stats | Session cost + plan usage + breakdown by skill/subagent/plugin/MCP |
/fewer-permission-prompts | /fewer-permission-prompts | — | Scan transcripts and add a safe read-only allowlist to settings |
Keep /init, /memory, and /permissions close: one bootstraps your project's instructions, one curates them, and one controls what runs without asking.
Tip
/fewer-permission-prompts pays for itself
Tired of approving the same harmless git status or read-only MCP calls? /fewer-permission-prompts scans your transcripts for common read-only Bash/MCP calls and writes a prioritized allowlist into project .claude/settings.json — fewer interruptions, no loss of safety on the dangerous stuff.
Key insight
/config replaced the standalone editor toggle
Editing mode (the old /vim) now lives in /config → Editor mode, alongside theme, model, output style, and prompt suggestions. /settings is the same command. For per-color tweaks use /theme and /color directly.
Family 5 — Utilities, plus removed commands
The supporting cast: help, diagnostics, output, sign-in, and surface-switching.
| Command | Syntax | Aliases | Notes |
|---|---|---|---|
/help | /help | — | The authoritative list of commands for your version |
/doctor | /doctor | — | Install/config diagnostics (f = fix). CLI equivalent: claude doctor |
/debug | /debug [desc] | — | Capture a debug report describing an issue |
/diff | /diff | — | Show the current diff |
/heapdump | /heapdump | — | Dump heap state for memory diagnostics |
/feedback | /feedback | /bug, /share | Send feedback, report a bug, or share the session |
/login | /login | — | Authenticate / switch account |
/logout | /logout | — | Sign out |
/teleport | /teleport | /tp | Pull a web (claude.ai) session into the local terminal |
/desktop | /desktop | /app | Open the current session in the Desktop app |
/exit | /exit | /quit | Leave the session |
Removed — don't trust stale tutorials:
| Removed command | Removed in | What to do instead |
|---|---|---|
/pr-comments | v2.1.91 | Ask Claude directly to view a pull request's comments |
/vim | v2.1.92 | Toggle editing modes via /config → Editor mode |
If you type a removed command on a current version it simply isn't recognized — another reason /help, not a blog post, is your source of truth.
Note
Diagnostics, in order of reach
When something's off: /doctor (f to auto-fix install/config issues) → /debug (capture a report) → /heapdump (memory diagnostics). /feedback (with /bug and /share) routes the report to Anthropic. The CLI mirror of /doctor is claude doctor.
Family 6 — Custom commands & MCP prompts
Your / menu isn't fixed — you can add to it, and connected servers add to it for you.
Custom slash commands. Define your own by dropping a Markdown file in one of these locations; the filename (minus .md) becomes the command name:
| Location | Scope | Recommended? |
|---|---|---|
.claude/skills/<name>/SKILL.md | Project | Yes — Claude can also invoke it autonomously |
.claude/commands/<name>.md | Project (legacy) | Works; manual-trigger only |
~/.claude/commands/<name>.md | Personal (all projects, legacy) | Works; manual-trigger only |
Subdirectories like .claude/commands/backend/api-test.md show the path in the description but do not namespace the name — it's still /api-test. Optional YAML frontmatter keys: description, allowed-tools, model, argument-hint.
Dynamic placeholders make a command file act on input and its environment:
| Placeholder | Expands to |
|---|---|
$ARGUMENTS | All arguments, as a single string |
$0 / $1 / $2 | Individual positional arguments by index |
!`command` | Runs the shell command; its stdout is inlined into the prompt |
@path/to/file | Embeds the file's contents into the prompt |
MCP prompts. Each connected MCP server can expose prompts, which surface as commands in the format /mcp__<server>__<prompt> — double-underscore separated, namespaced by server, dynamically discovered so they only appear when that server is connected. Example: a linear server exposing create_issue becomes /mcp__linear__create_issue.
Example
A custom command in four lines
Create .claude/commands/review-file.md:
---
description: Review one file against our standards
argument-hint: <path>
---
Review @$0 for bugs and style. Recent commits for context:
!`git log --oneline -5`Now /review-file src/auth.ts embeds that file (@$0), inlines your last five commits (!`git log...`), and runs the review.
Watch out
Prefer SKILL.md for new commands
.claude/commands/ still works, but the recommended home for a new custom command is .claude/skills/<name>/SKILL.md — that way Claude can invoke it autonomously when relevant, not only when you type the slash. The legacy commands/ folder is manual-trigger only.
Try it: Make the cheat sheet yours
Turn this reference into muscle memory and build one command of your own. Use a throwaway git repo so the review commands have a diff to chew on.
- Audit your menu. Run
/helpand tick off how many of the six families you can name a command from without looking. Note any commands in your/helpthat aren't in this sheet (plugins/MCP add them) — that's your personalized surface. - Drill the aliases. Confirm
/resetbehaves like/clear, and/costlike/usage. Open/configand find Editor mode — the replacement for the removed/vim. - Tune effort. Run
/effortwith no argument to see the slider; note which levels your current model exposes and which are marked session-only. Set/effort high, then/effort autoto reset. - Run the three reviews. Make a small code change. Run
/code-review(try--fix), then/simplify, then/security-review. Observe how each reports a different kind of finding. - Build a custom command. Create
.claude/commands/audit.mdwith frontmatter (description,argument-hint) and a body that uses@$0to embed a file and!`git log --oneline -5`to inline recent commits. Run/audit <some-file>and confirm both expanded. - Find an MCP prompt (if you have a server). Connect any MCP server via
/mcp, then type/mcp__and watch its prompts autocomplete in the/mcp__<server>__<prompt>format.
Deliverable: a short note listing one command from each of the six families, the two /effort levels that are session-only on your model, and the path + filename of the custom command you built.
Key takeaways
- 1Slash commands fire only at the start of a message; everything after the name is arguments, and `/help` is the authoritative list for your version, plugins, and connected MCP servers.
- 2Session/context (/clear=/reset/new, /compact, /context, /rewind=/checkpoint/undo, /branch=/fork, /resume=/continue, /rename, /export, /copy, /goal, /btw, /focus, /add-dir) is the family you touch most.
- 3Effort runs low→medium→high→xhigh→max→ultracode; max and ultracode are session-only and ultracode adds automatic orchestration. /code-review finds bugs, /simplify (v2.1.154+) only cleans up, /security-review checks security.
- 4Workflow scales work out: /plan, /batch, /agents, /tasks, /background=/bg, /loop, /deep-research, /run + /verify, /schedule, /autofix-pr. Memory/config/tools covers /init, /memory, /mcp, /permissions, /hooks, /config=/settings, /skills, /plugins, /usage=/cost/stats.
- 5/pr-comments was removed in v2.1.91 (ask Claude directly) and /vim in v2.1.92 (use /config → Editor mode).
- 6Extend the menu with custom commands using $ARGUMENTS, $0/$1, !`cmd`, and @file — and MCP servers add prompts dynamically as /mcp__<server>__<prompt>.
Quiz
Lock in what you learned
Check your understanding
0 / 4 answered
1.A teammate says 'just run /reset to start fresh' but your notes say /clear. What's going on?
2.You want to (a) apply review fixes to your working tree and (b) clean up duplicated code without changing behavior. Which commands fit?
3.Inside a custom command file (.claude/commands/audit.md), what does the line `` !`git status --short` `` do when you run /audit?
4.You connect an MCP server named `notion` that exposes a `search_pages` prompt. How do you invoke it, and why might a colleague not see it?
Go deeper
Hand-picked sources to keep learning
The authoritative reference for every built-in and bundled skill, aliases, the [Skill]/[Workflow] tags, removed commands, and the custom-command placeholders.
How custom commands and the $ARGUMENTS/$0/!`cmd`/@file placeholders behave programmatically, including frontmatter keys.
How connected servers surface prompts in the /mcp__<server>__<prompt> format and how to manage servers with /mcp.
The effort ladder (low through ultracode), which levels are session-only, and how /model saves a default.
The in-session environment where slash commands run, plus the keyboard shortcuts (Esc Esc for /rewind, Shift+Tab for modes) that pair with them.
Changelog and issues — confirm exactly when a command was added, renamed, or removed (e.g. /pr-comments in v2.1.91, /vim in v2.1.92).