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:
/costis now an alias for/usage. They are the same screen./usageshows session cost, plan limits, reset time, and (on Pro/Max/Team/Enterprise) a usage breakdown by skill, subagent, plugin, and MCP server./statsis also an alias./vimwas removed in v2.1.92. Toggle Vim editing in/configunder Editor mode instead./pr-commentswas removed in v2.1.91. Just ask Claude to read the PR comments directly, or use theghCLI.
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,/upgradeonly shows on Pro and Max, and/privacy-settingsonly 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>.mdfiles 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.
| Command | What it does | When to use it |
|---|---|---|
/clear | Start a fresh conversation, empty context, keep CLAUDE.md. Aliases: /reset, /new | Task done, starting unrelated work |
/compact [instructions] | Summarize the conversation so far to free context and continue | Context filling up but you’re not done |
/context [all] | Visualize context usage as a colored grid with optimization tips | See what’s eating tokens before you compact |
/resume [session] | Resume by ID or name, or open the session picker | You closed the terminal and want to pick up |
/rewind | Roll code and/or conversation back to a checkpoint, or summarize part of it. Aliases: /checkpoint, /undo | A change broke something and you want to undo |
/export [filename] | Export the conversation as plain text to a file or clipboard | Archive, share with a teammate, write a retro |
/rename [name] | Rename the current session | Long-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,/rewindcannot 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
/rewindas local undo and Git as permanent history.
Usage and cost
| Command | What it does | When to use it |
|---|---|---|
/usage | Session 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-credits | Configure 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
| Command | What it does |
|---|---|
/init | Generate a starter CLAUDE.md in the project root |
/memory | Edit 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
| Command | What it does | When to use it |
|---|---|---|
/config | Open Settings (theme, model, output style, Editor/Vim mode). Alias: /settings | Any preference change, including Vim mode |
/model [model] | Switch model and save it as the default for new sessions | Opus for hard tasks, Sonnet for everyday work |
/effort [level] | Set reasoning effort: low, medium, high, xhigh, max, ultracode | Crank up for gnarly debugging, down to save tokens |
/terminal-setup | Configure 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 roots | Cross-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 |
/permissions | View/edit allow, ask, and deny rules for tools and paths. Alias: /allowed-tools | Stop the “confirm every command” spam |
/privacy-settings | Privacy 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
| Command | What it does | When to use it |
|---|---|---|
/plan [description] | Enter plan mode from the prompt; Claude proposes an approach before editing | Any large or risky change |
/agents | Manage subagents (create, edit, list) | “Code review” or “test writing” should be its own persona |
/tasks | View and manage everything running in the background. Alias: /bashes | Track background work in this session |
/background [prompt] | Detach the session to run as a background agent and free the terminal. Alias: /bg | Long jobs you don’t want to babysit |
/branch [name] | Branch the conversation at this point to try a different direction | Explore 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
| Command | What it does |
|---|---|
/diff | Interactive 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-review | Analyze 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.
| Command | What it does | When to use it |
|---|---|---|
/agents | Manage subagents | A task deserves its own specialized persona |
/hooks | View hook configs for tool events (PreToolUse / PostToolUse / SessionStart, etc.) | Automate “lint before every command”, “open README at session start” |
/mcp | Manage MCP servers (connect, authenticate, enable/disable, list tools) | Wire in Linear, Slack, Notion, GitHub, your own database |
/skills | List available skills; sort by token count; hide skills from the menu | Audit what is mounted and what it costs in context |
/plugin | Manage 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
| Command | What it does |
|---|---|
/login | Sign in to your Anthropic account |
/logout | Sign out of the current account |
/upgrade | Open 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
| Command | What it does | When to use it |
|---|---|---|
/status | Settings → Status tab: version, model, account, connectivity | Diagnose “wrong account / wrong version” |
/help | Show help and the command list | Look up commands and doc links |
/doctor | Diagnose your installation and settings; press f to auto-fix | First thing after install; first thing when something is weird |
/debug [description] | Enable debug logging and analyze the session debug log | Reproduce a runtime issue and capture logs |
/feedback [report] | Submit feedback or a bug with session context. Aliases: /bug, /share | A reproducible bug you want Anthropic to see |
/release-notes | Browse the changelog in a version picker | After 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
| Command | What it does |
|---|---|
/ide | Manage IDE integrations and show status (VS Code / JetBrains) |
/install-github-app | Set 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.mdand a skill at.claude/skills/deploy/SKILL.mdboth 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:
/clear— clean slate before switching tasks./context— see where the window is going before you trim./compact <hint>— targeted compact when context is tight./rewind— undo a bad edit (orEsctwice)./usage— keep dollar and quota awareness./init— first move in a new repo./modeland/effort— match brainpower to the task./plan— think before a big change./permissions— allowlist your common Bash, kill the confirm spam./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
/clearand/compact:/clearwipes and restarts;/compactsummarizes and continues. Reverse them and you lose context or run out of room. - Running
/compactwith no hint and losing the edited-files list — make/compact <what to keep>a habit. - Expecting
/rewindto undo a deleted file. It can’t: file removal viarmis 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
/vimor/costand getting “Unknown command”:/vimmoved into/config, and/costis now an alias for/usage. /doctorreports twoclaudebinaries on PATH: runwhich -a claudein 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.
Related
- Every Claude Code Keyboard Shortcut, Explained
- Claude Code Beginner Guide
- Claude Code Skills Guide
- Claude Code Workflow
Tags: #Claude #Claude Code #Tutorial