Every Claude Code Slash Command That Matters (2026 Reference)

A current, hands-on reference to Claude Code's built-in slash commands as of June 2026: session lifecycle, /rewind checkpoints, /usage cost, /plan and /effort, subagent / hook / MCP extensions, plus what changed (/vim and /pr-comments are gone).

TL;DR

Type / at the start of the input in Claude Code to open the command menu. As of June 2026 the CLI (v2.1.x) ships 80-plus built-in commands plus a handful of bundled skills, but you only need about ten daily: /clear, /compact, /context, /rewind, /usage, /init, /model, /plan, /permissions, and /doctor. This reference groups every command worth knowing by job, flags the three recent changes that trip people up (/cost is now just an alias for /usage; /vim and /pr-comments were removed), and gives you the exact moment to reach for each one.

If you haven’t installed Claude Code yet, read the Claude Code Beginner Guide first.

What changed in 2026 (read this if you used an older guide)

Three command changes catch people who learned Claude Code in 2025:

  • /cost is now an alias for /usage. They are the same screen. /usage shows session cost, plan limits, reset time, and (on Pro/Max/Team/Enterprise) a usage breakdown by skill, subagent, plugin, and MCP server. /stats is also an alias.
  • /vim was removed in v2.1.92. Toggle Vim editing in /config under Editor mode instead.
  • /pr-comments was removed in v2.1.91. Just ask Claude to read the PR comments directly, or use the gh CLI.

The biggest addition is /rewind (checkpoints), covered below. It is the single most underused safety command in the tool.

Who this is for

People who have used Claude Code for a few days, know /init and /clear, and want to figure out what the rest of that long menu actually does. The menu changes with your version and plan, so this article is organized by job to be done, not by alphabetical command list.

Before you start

  • Inside a session, type / and skim what is actually available. Availability depends on platform, plan, and version. For example, /upgrade only shows on Pro and Max, and /privacy-settings only shows on Pro and Max.
  • A command is only recognized at the start of your message. Text after the command name is passed to it as arguments.
  • Distinguish built-in commands from skills: built-ins are coded into the CLI; skills are prompts handed to Claude that it can also trigger automatically. As of 2026 custom slash commands have merged into skills, but your existing .claude/commands/<name>.md files still work unchanged. See the Claude Code Skills Guide.

Session lifecycle

This group manages the start, pause, and recycling of a single conversation. You will use it most.

CommandWhat it doesWhen to use it
/clearStart a fresh conversation, empty context, keep CLAUDE.md. Aliases: /reset, /newTask done, starting unrelated work
/compact [instructions]Summarize the conversation so far to free context and continueContext filling up but you’re not done
/context [all]Visualize context usage as a colored grid with optimization tipsSee what’s eating tokens before you compact
/resume [session]Resume by ID or name, or open the session pickerYou closed the terminal and want to pick up
/rewindRoll code and/or conversation back to a checkpoint, or summarize part of it. Aliases: /checkpoint, /undoA change broke something and you want to undo
/export [filename]Export the conversation as plain text to a file or clipboardArchive, share with a teammate, write a retro
/rename [name]Rename the current sessionLong-running sessions you keep resuming

Always pass a hint to /compact. An empty compact keeps small talk; /compact focus on edited files, key decisions, and remaining todos keeps the parts you actually need.

/context is the command to run before you decide between /compact and /clear. The grid shows whether the window is full of file reads, tool output, or memory bloat, so you know what to trim.

/rewind: the checkpoint safety net

Claude Code automatically snapshots files before each edit. Run /rewind, or press Esc twice when the input is empty, to open the rewind menu. It lists every prompt you sent this session; pick a point and choose one of:

  • Restore code and conversation — revert both to that point.
  • Restore conversation — rewind the chat, keep current code (useful when Claude got confused but the code is fine).
  • Restore code — revert files, keep the conversation (useful when execution failed but Claude’s plan was right).
  • Summarize from here / up to here — compress one side of the conversation into a summary without touching files (a targeted /compact).

Two limits worth memorizing, per the official checkpointing docs:

  • Bash changes are not tracked. If Claude ran rm, mv, cp, npm install, or pushed to a remote, /rewind cannot undo those. Only direct file-edit tools are checkpointed.
  • It is not a replacement for Git. Checkpoints persist across sessions and are cleaned up after 30 days (configurable). Treat /rewind as local undo and Git as permanent history.

Usage and cost

CommandWhat it doesWhen to use it
/usageSession cost, plan limits, next reset, and a usage breakdown by skill/subagent/plugin/MCP (Pro/Max/Team/Enterprise)“How much have I burned, and when does my limit reset?”
/usage-creditsConfigure usage credits to keep working past a limit (formerly /extra-usage)You hit a plan cap mid-task and need to continue

/cost and /stats both open /usage now. There is no separate “API dollars” vs “subscription quota” command anymore: one screen reads your active login and shows the relevant numbers. If you are on a subscription, the tiers as of June 2026 are Claude Pro $20/mo (bundles Claude Code), Max $100/mo (5x) and Max $200/mo (20x).

Project memory and initialization

CommandWhat it does
/initGenerate a starter CLAUDE.md in the project root
/memoryEdit CLAUDE.md files, toggle auto-memory, and view auto-memory entries

Run /init once per repo, then refine via /memory or by editing CLAUDE.md directly. Typing # at the start of the input also appends a quick memory line. Set CLAUDE_CODE_NEW_INIT=1 for an interactive /init that also walks you through skills, hooks, and personal memory files.

Configuration, model, and reasoning effort

CommandWhat it doesWhen to use it
/configOpen Settings (theme, model, output style, Editor/Vim mode). Alias: /settingsAny preference change, including Vim mode
/model [model]Switch model and save it as the default for new sessionsOpus for hard tasks, Sonnet for everyday work
/effort [level]Set reasoning effort: low, medium, high, xhigh, max, ultracodeCrank up for gnarly debugging, down to save tokens
/terminal-setupConfigure terminal keybindings (Shift+Enter newlines)When Shift+Enter won’t insert newlines in VS Code, Cursor, Zed, etc.
/add-dir <path>Add another directory to the session’s working rootsCross-repo edits, pulling in a scripts folder
/cd <path>Move the session to a new working directory (preserves prompt cache)Switching the whole session to another project
/permissionsView/edit allow, ask, and deny rules for tools and paths. Alias: /allowed-toolsStop the “confirm every command” spam
/privacy-settingsPrivacy settings (Pro/Max only)Turn off training-data sharing, adjust retention

Claude Code runs Anthropic models only: Opus 4.7 (top tier) and Sonnet 4.6 (the workhorse) as of June 2026, both with a 1M-token context window. Use /model to switch the primary model and /effort to dial reasoning per task — /effort xhigh for architecture and tricky bugs, /effort low for trivial lookups.

/permissions is the most-overlooked command. The fix for “Claude keeps asking me to confirm npm install” is adding Bash(npm install) to the allow list here. The /fewer-permission-prompts skill can scan your transcripts and propose an allowlist automatically.

Planning and parallel work

CommandWhat it doesWhen to use it
/plan [description]Enter plan mode from the prompt; Claude proposes an approach before editingAny large or risky change
/agentsManage subagents (create, edit, list)“Code review” or “test writing” should be its own persona
/tasksView and manage everything running in the background. Alias: /bashesTrack background work in this session
/background [prompt]Detach the session to run as a background agent and free the terminal. Alias: /bgLong jobs you don’t want to babysit
/branch [name]Branch the conversation at this point to try a different directionExplore an alternative without losing the current thread

/plan is the cheapest way to avoid a bad multi-file edit: Claude lays out the steps, you approve or correct, then it executes. Combine it with /rewind and you have a clean experiment loop — plan, run, rewind if it went sideways.

Reviewing a diff before you ship

CommandWhat it does
/diffInteractive diff viewer for uncommitted changes and per-turn diffs
/review [PR]Review a pull request locally in the current session
/code-review [level] [--fix]Review the diff for bugs and cleanups; --fix applies findings; ultra runs a deep cloud review
/security-reviewAnalyze pending branch changes for security risks (injection, auth, data exposure)
/simplify [target]Cleanup-only review (reuse, simplification, efficiency); applies fixes, doesn’t hunt bugs

/review and /security-review are read-only deep passes. /code-review --fix is the one that edits your working tree, and /code-review ultra (alias /ultrareview) fans the review out across agents in a cloud sandbox — Pro and Max get three free runs, then it draws from usage credits.

Extension systems: subagent / hook / MCP

These are the core of Claude Code’s extensibility. Each is an entry point into its own subsystem.

CommandWhat it doesWhen to use it
/agentsManage subagentsA task deserves its own specialized persona
/hooksView hook configs for tool events (PreToolUse / PostToolUse / SessionStart, etc.)Automate “lint before every command”, “open README at session start”
/mcpManage MCP servers (connect, authenticate, enable/disable, list tools)Wire in Linear, Slack, Notion, GitHub, your own database
/skillsList available skills; sort by token count; hide skills from the menuAudit what is mounted and what it costs in context
/pluginManage plugins (list, install, enable, disable)Bundle commands/skills/agents/hooks for a team

The mental model: a subagent is “a different brain,” a hook is “a different reflex,” and an MCP server is “a different external world.” They compose — for example, a PreToolUse hook that calls an MCP tool to validate inputs before a write.

Account and upgrade

CommandWhat it does
/loginSign in to your Anthropic account
/logoutSign out of the current account
/upgradeOpen the upgrade page (Pro/Max only)

For multi-account users, the usual pain is not knowing which account is active — run /status first; if it’s wrong, /login.

Help and diagnostics

CommandWhat it doesWhen to use it
/statusSettings → Status tab: version, model, account, connectivityDiagnose “wrong account / wrong version”
/helpShow help and the command listLook up commands and doc links
/doctorDiagnose your installation and settings; press f to auto-fixFirst thing after install; first thing when something is weird
/debug [description]Enable debug logging and analyze the session debug logReproduce a runtime issue and capture logs
/feedback [report]Submit feedback or a bug with session context. Aliases: /bug, /shareA reproducible bug you want Anthropic to see
/release-notesBrowse the changelog in a version pickerAfter upgrading, to see what’s new

In /doctor output, watch for: CLI version, Node version, which claude is on your PATH, account status, and network reachability. Wrong version installed, PATH ordering, corporate proxy blocking — /doctor surfaces all of them in one shot, and f lets Claude fix the fixable ones.

IDE and GitHub integration

CommandWhat it does
/ideManage IDE integrations and show status (VS Code / JetBrains)
/install-github-appSet up the Claude GitHub Actions app for a repository

After /ide connects once, your editor shows a Claude Code panel and diffs render inline — a far better experience than a pure terminal.

Custom commands and skills

You’re not limited to built-ins:

  • Custom slash commands / skills: a file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy. The skill form adds a directory for supporting files and frontmatter that controls whether you or Claude invokes it. Use $ARGUMENTS (or $1, $2) to accept parameters.
  • Plugins: bundle commands, skills, agents, and hooks, then manage with /plugin.

When to choose what: one prompt with no attached docs is fine as a command file; a multi-step workflow with reference files and team alignment belongs in a skill. See the Claude Code Skills Guide for the full comparison.

Build muscle memory: the daily ten

Ranked by how often you’ll reach for them — these cover roughly 80% of daily use:

  1. /clear — clean slate before switching tasks.
  2. /context — see where the window is going before you trim.
  3. /compact <hint> — targeted compact when context is tight.
  4. /rewind — undo a bad edit (or Esc twice).
  5. /usage — keep dollar and quota awareness.
  6. /init — first move in a new repo.
  7. /model and /effort — match brainpower to the task.
  8. /plan — think before a big change.
  9. /permissions — allowlist your common Bash, kill the confirm spam.
  10. /doctor — first stop when something feels off.

One tier down: open /agents, /hooks, and /mcp once each so you know where they live. Configure them when you actually need them.

Common mistakes

  • Mixing up /clear and /compact: /clear wipes and restarts; /compact summarizes and continues. Reverse them and you lose context or run out of room.
  • Running /compact with no hint and losing the edited-files list — make /compact <what to keep> a habit.
  • Expecting /rewind to undo a deleted file. It can’t: file removal via rm is a Bash action, not a tracked edit. Commit early with Git for anything you can’t afford to lose.
  • Over-permissive /permissions, like allowing all Bash — don’t, unless you’re inside an isolated worktree.
  • Looking for /vim or /cost and getting “Unknown command”: /vim moved into /config, and /cost is now an alias for /usage.
  • /doctor reports two claude binaries on PATH: run which -a claude in a shell to confirm which one is actually executing — usually a stale npm-global install shadowing a newer one.

FAQ

Q: What’s the difference between /clear, /compact, and /rewind? A: /clear starts a fresh conversation with empty context (the old one stays in /resume). /compact summarizes the current conversation to free space and keeps going. /rewind rolls code and/or the conversation back to an earlier checkpoint, so it’s an undo, not a cleanup. Use /compact for long tasks, /clear for unrelated new work, and /rewind when a change broke something.

Q: Where did /cost and /vim go? A: /cost still works but it’s just an alias for /usage, which shows session cost, plan limits, reset time, and a per-skill/agent/MCP breakdown on paid plans. /vim was removed in v2.1.92 — toggle Vim editing in /config under Editor mode.

Q: Can /rewind undo everything Claude did? A: No. It tracks direct file edits, not Bash side effects. If Claude ran rm, mv, npm install, or pushed to a remote, those persist after a rewind. Checkpoints last 30 days and are local undo, not a Git replacement. Commit anything important.

Q: Are slash commands the same as skills? A: Built-in commands are coded into the CLI, version-locked, and can’t be disabled. Skills are prompts handed to Claude that it can invoke automatically or that you trigger with /<name>; they live in .claude/skills/ and can differ across team members. Custom command files in .claude/commands/ still work and are the simplest form of a skill.

Q: Which model and effort should I use in Claude Code? A: As of June 2026 Claude Code runs Anthropic models only — Opus 4.7 for hard reasoning and architecture, Sonnet 4.6 for everyday coding, both at 1M-token context. Switch with /model, then use /effort xhigh for difficult work and /effort low to conserve tokens on trivial tasks.

Tags: #Claude #Claude Code #Tutorial