Skip to main content
Home/Blog/Claude Code Slash Commands Cheat Sheet: Every Command and When to Use It
Developer Tools

Claude Code Slash Commands Cheat Sheet: Every Command and When to Use It

A grouped reference to Claude Code's built-in slash commands — context management, model and reasoning control, review, recovery, and diagnostics — with practical notes on when to reach for each.

By Sean

You know roughly a dozen Claude Code slash commands by muscle memory, and there are another two dozen you've never typed because you weren't sure what they did. The command set has grown fast, several commands have aliases, a few have been removed, and the official docs note that availability depends on your platform, plan, and version. This is a grouped reference you can scan — what each command does and when to actually reach for it.

The single source of truth for what's in your install is /help. Type / to see every available command, and /release-notes to see what changed. The docs at code.claude.com/docs/en/commands are authoritative but version-gated — names and plan availability shift often.

A quick syntax note before the tables: commands are only recognized at the start of a message; anything after the command name is passed as arguments. In the docs, <arg> means required and [arg] means optional.

Context and token management

This is the group you'll use most. The context window is a finite resource, and managing it is the difference between a sharp session and a confused one.

CommandAliasesWhat it does
/clear [name]/reset, /newStarts a new conversation with empty context. The old conversation stays available in /resume; pass a name to label it in the picker.
/compact [focus]Frees context by summarizing the conversation so far. Optionally pass focus instructions for the summary. Preserves continuity.
/context [all]Visualizes context usage as a colored grid, with optimization suggestions and capacity warnings. Pass all to expand the per-item breakdown in fullscreen.
/usage/cost, /statsShows session cost, plan usage limits, and activity stats.

The /clear vs /compact decision trips people up, so be deliberate. Use /clear when you finish one task and move to something unrelated — it prevents the previous task's context from bleeding into the next one. Use /compact when continuity matters mid-task and you just need breathing room. Compaction is aggressive: a ~70,000-token conversation might compress to ~4,000 tokens, so you keep the decisions and direction without the bulk.

For monitoring, keep the scopes straight. /context is about the context window — what's eating your tokens right now. /usage (and its aliases /cost and /stats) is about cost and plan limits. On Pro, Max, Team, or Enterprise plans, /usage breaks usage down by skill, subagent, plugin, and MCP server. One caveat on /cost: the dollar estimate is calculated locally from token counts and published rates, so treat it as an estimate, not your invoice.

Setup and memory

CommandAliasesWhat it does
/initInitializes a project with a CLAUDE.md guide. Set CLAUDE_CODE_NEW_INIT=1 for an interactive flow covering skills, hooks, and memory.
/memoryEdits CLAUDE.md memory files, toggles auto-memory, and views auto-memory entries.
/config/settingsOpens the Settings interface for theme, model, output style, and other preferences.
/add-dir <path>Adds a working directory so Claude can access files outside the current project.
/permissions/allowed-toolsManages allow / ask / deny rules for tools.

/init is the first thing to run in a new repo — CLAUDE.md is where project conventions live, and Claude reads it on every session. /memory is the manual editor for that file plus auto-memory. If you've been hand-editing CLAUDE.md, note that /config is also where the editor mode setting moved to.

Model and reasoning

CommandWhat it does
/model [model]Switches the AI model and saves it as the default for new sessions. No argument opens a picker (press s to switch session-only); left/right arrows adjust effort where supported.
/effort [level|auto]Sets the reasoning effort level. Takes effect immediately.
/goal [condition|clear]Sets a goal; Claude works across turns until the condition is met. No argument shows the current/last goal.

/effort accepts low, medium, high, xhigh, max, or ultracode — but the available levels depend on the model, and max and ultracode are session-only. ultracode is special: it combines xhigh reasoning with automatic workflow orchestration. If you're deciding when to crank effort up, the ultracode deep-dive covers the whole low-to-ultracode ladder and the version gates involved.

/goal is the "set it and walk away" command: give it a completion condition and Claude keeps going until that condition is satisfied, then stops on its own. It's different from /loop, which just runs a prompt on an interval. We wrote a full guide to /goal covering how to write good conditions and how the evaluator decides when you're done. Clear an active goal early with /goal clear (or stop, off, reset, none, cancel).

Review and ship

CommandWhat it does
/diffOpens an interactive diff viewer.
/code-reviewReviews the current diff. Effort levels run low through max, plus ultra for a cloud review. --fix applies findings; --comment posts PR comments.
/review [PR]Reviews a pull request locally.
/security-reviewAnalyzes pending changes for vulnerabilities.
/simplifyRuns a cleanup-only review (newer versions).

The split here is intentional: /code-review hunts for bugs and correctness issues, /simplify is quality-only and won't chase bugs, and /security-review is scoped to vulnerabilities. For PRs specifically, /review [PR] does it locally — and if you used to lean on /pr-comments to read review threads, that command was removed; just ask Claude directly to view the PR comments.

Parallel and long-running work

CommandAliasesWhat it does
/planEnters plan mode.
/agentsManages subagent configurations.
/tasksManages background tasks.
/background/bgDetaches the session as a background agent.
/batchDecomposes a large change into 5–30 units across git worktrees.
/forkSpawns a forked subagent (newer versions).
/loopRuns a prompt repeatedly.
/workflowsOpens the workflow progress view.

This is the heavy-machinery group. /plan for "think before you touch code," /batch when one change is really thirty changes across files, and /background when you want a task to run while you keep working elsewhere. If you're orchestrating subagents and MCP servers together, our MCP, subagents, skills, and hooks overview maps how these pieces fit.

CommandAliasesWhat it does
/resume [session]/continueResumes by ID/name or opens a picker; background sessions appear marked bg.
/branchForks the conversation at the current point.
/rewind/checkpoint, /undoRolls code and/or conversation back to a checkpoint.
/exportExports the conversation as plain text.
/exit/quitExits the CLI.

/rewind is the one to remember when Claude makes a change you don't want — it can roll back code, conversation, or both to a checkpoint. /resume is your recovery hatch after closing a session; /branch lets you explore an alternative path without losing the original.

Diagnostics and help

CommandWhat it does
/helpShows help and available commands.
/statusOpens the Settings Status tab (version, model, account, connectivity). Works while Claude is responding.
/doctorDiagnoses and verifies the install and settings — press f to have Claude fix issues.
/release-notesShows what changed in recent versions.

When something feels off — wrong model, auth weirdness, a command that should exist but doesn't — /status and /doctor are your first stops. /doctor with its f-to-fix shortcut resolves most config problems without you digging through settings.

Extending the command set

Two things worth knowing beyond the built-ins. First, custom commands are now skills: a file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both produce /deploy. Existing .claude/commands/ files keep working, so nothing breaks. Second, MCP servers can expose prompts as commands in the form /mcp__<server>__<prompt>, discovered dynamically from whatever servers you've connected via /mcp.

A few setup commands round out the list: /mcp manages MCP server connections, /hooks views hook configurations, /plugin manages plugins, and /skills lists available skills.

Bottom line

Most of your day runs on a handful of commands: /clear and /compact to manage context, /context and /usage to watch your budget, /model and /effort to dial in reasoning, and /rewind when something goes sideways. The rest — /goal, /batch, /code-review, /doctor — are situational power tools worth knowing exist so you reach for them at the right moment. Because Anthropic ships frequently, command names, version gates, and plan availability change; treat any specific version number as version-gated, and let /help be your real cheat sheet for whatever you've actually got installed.

Frequently Asked Questions

Find answers to common questions

/clear starts a brand-new conversation with empty context — the old session stays available under /resume. /compact frees up context by summarizing the conversation so far while preserving continuity (decisions and direction). Use /clear when you finish one task and start something unrelated, or when a session goes off the rails. Use /compact when you need room but want to keep working on the same task.

/context shows the current session's context-window breakdown as a colored grid, plus optimization suggestions. /usage shows session cost, plan usage limits, and activity stats. /cost and /stats are aliases of /usage (/stats opens on the Stats tab). In short: /context is about the context window, /usage is about cost and plan limits.

/cost still works, but it is now an alias of /usage along with /stats. Its dollar figure is estimated locally from token counts and published rates, so it may differ slightly from your actual bill.

/init initializes a project with a CLAUDE.md guide — a file Claude reads for project context, conventions, and instructions. Setting the environment variable CLAUDE_CODE_NEW_INIT=1 enables an interactive flow that also walks through skills, hooks, and personal memory files.

/model switches the AI model and saves it as the default for new sessions; with no argument it opens a picker (press 's' to switch for the current session only). /effort sets the reasoning level — low, medium, high, xhigh, max, or ultracode — without changing the model. Available effort levels depend on the model, and max and ultracode are session-only.

/goal sets a completion condition and keeps Claude working across turns until that condition is met, then stops. /loop runs a prompt repeatedly on a schedule. /goal is condition-driven and self-terminating; /loop is interval-driven. Clear an active goal early with /goal clear (or stop/off/reset/none/cancel).

/vim was removed — use /config and set Editor mode instead. /pr-comments was also removed — ask Claude directly to view PR comments. Anthropic ships CLI updates frequently, so always check /help and /release-notes for what is in your installed version.

Custom commands have been merged into skills. A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy. Existing .claude/commands/ files keep working, so older custom commands still run.

Building Something Great?

Our development team builds secure, scalable applications. From APIs to full platforms, we turn your ideas into production-ready software.