Claude Code slash commands and shortcuts, by job
Claude Code slash commands are in-session controls typed at the start of a message: /compact, /clear, and /rewind manage context, /branch and /fork split a conversation, /model and /effort tune reasoning, and /diff and /code-review check the work before you commit. Keyboard shortcuts such as Esc Esc and Shift+Tab do the same faster. All were checked against Claude Code 2.1.283.
This page is for developers who already use Claude Code every day. You know /clear and /help, but a 60-turn session just lost its thread after a blind /compact, and yesterday’s “quick” /model fable quietly became the default for every new session. Anthropic’s commands reference lists 114 entries (checked 2026-09-26). A much smaller set changes how a working day goes, and several of those have a trap the reference mentions only in passing.
Launch flags, claude -p pipes, and resuming from the shell live on the command line page. Writing your own /commands is covered in custom commands and skills.
What you get from knowing the right slash commands
Section titled “What you get from knowing the right slash commands”- A context routine (
/context,/compactwith instructions,/rewind,/clearwith a name) that keeps long sessions accurate. - Three ways to split a conversation (
/branch,/fork,/subtask) and a rule for picking one. - A model and effort habit that does not silently change your defaults.
- A pre-commit check built from
/diff,/code-review, and/security-review, so you verify behaviour instead of rereading every line. - A shortcut table for the keys that save the most round trips.
- Four copy-paste prompts: a lossless compact, a handoff before
/clear, a checkable/goal, and a review-and-fix pass.
How do slash commands behave in a session?
Section titled “How do slash commands behave in a session?”Three rules explain most surprises:
- A command counts only at the start of a message.
please /compact nowis sent to the model as text. Put the command first and any argument after it:/compact keep the failing test names. - Most commands sent while Claude is responding wait for the turn to end. A few are marked to run immediately, among them
/btw,/status,/tasks,/usage,/effort, and/goal. To run anything else now, pressEscto interrupt first. - Custom commands are now skills. A file in
.claude/skills/<name>/SKILL.mdappears in the/menu next to the built-ins. Bundled skills such as/code-review,/simplify,/batch,/debug,/loop, and/doctorare part of the same menu. Type/and a few letters to filter.
The / menu on your build is the source of truth. Claude Code releases often, and the stable release channel (2.1.274 on 2026-09-26) runs about a week behind latest.
How do you keep a long session’s context sharp?
Section titled “How do you keep a long session’s context sharp?”Pick the control by how much it throws away. Run /context first; it draws the context window as a coloured grid and flags heavy tools and bloated memory files.
| Command | What it keeps | Reach for it when |
|---|---|---|
/btw [question] | Everything; the side question never enters the conversation | You need a quick answer (“which file defines the retry policy?”) without polluting the main thread |
/compact [instructions] | A summary of the conversation, shaped by your instructions | The task continues but the early turns are noise |
/rewind or Esc Esc on an empty prompt | Code and conversation up to a checkpoint you pick | The last few turns went the wrong way |
/clear [name] | Nothing in context; the old conversation stays on disk | The task is done or the next one is unrelated |
Two details the reference only mentions in passing. First, /clear takes a name: /clear payments-webhooks labels the conversation you are leaving in the /resume picker, so you no longer need a separate /rename. Second, /rewind can also “summarize from a selected message”, which compacts only the turns after a point you choose. In the same process it can even restore a conversation you cleared. /undo and /checkpoint are aliases of /rewind.
/compact without instructions keeps whatever the summarizer thinks matters, and a debugging session’s value lives in exact strings. Naming them is the difference between continuing and starting over.
Then run /clear current-task and start the next conversation with Continue from @docs/handoff/current-task.md. Run the proof command first and report its result before changing anything. The file survives any reset, and the proof command tells you at once whether the handoff was accurate.
How do you split a conversation without losing it?
Section titled “How do you split a conversation without losing it?”All three commands start from the full current conversation. They differ in where the copy runs and where its result lands.
| Command | Where the copy runs | Where the result goes | Use it for |
|---|---|---|---|
/branch [name] | Here; you switch into the branch | Stays in the branch; return to the original with /resume | Trying a different design without losing the current one |
/fork [prompt] | A new background session | Its own session, visible in claude agents | A parallel line of work you will review separately |
/subtask <task> | A background subagent | Reported back into this conversation | A side job whose answer you need here, such as “find every caller of chargeCard” |
The rule: if you want to compare two approaches, /branch. If the second line of work should run while you keep typing, /fork. If you only need its answer, /subtask. All three are in the / menu on 2.1.283; on an older build, check the menu before you rely on them.
To hand the whole session to the background, /background (alias /bg) detaches it and frees the terminal. /tasks lists background shells and subagents in the current session, and /stop ends a background session while you are attached to it; its transcript and worktree are kept. The agent view guide covers watching many of these at once.
How do you change model and effort without surprises?
Section titled “How do you change model and effort without surprises?”/model saves your choice as the default for new sessions. Run /model with no argument to open the picker, and press s on a row to switch for the current session only. That one key prevents the classic mistake: switching to Claude Fable 5.1 (/model fable) for one hard planning pass and running every session for the next week on it. Fable 5.1 may bill to usage credits depending on your plan, and /usage shows its weekly limit.
Tune effort before you change model. /effort takes low, medium, high, xhigh, max, ultracode, or auto, and /effort status prints the current level. Claude Opus 5.5, the default model from v2.1.280 (the latest channel), runs at medium effort by default; most other models default to high. ultracode lasts for the current session only. ultracode combines xhigh effort with automatic workflow orchestration, which the dynamic workflows guide explains.
The current lineup and prices live on the models hub. The rule this site follows everywhere: start on the default model, raise effort first, and switch model only when your own results say so.
Which commands check the work before you commit?
Section titled “Which commands check the work before you commit?”These commands are how you verify a change without reading every line of it. Run them in this order:
-
See the scope.
/diffshows uncommitted changes and per-turn diffs. A change that touches files outside the task is the first signal to stop and ask why. -
Run the gates. Ask Claude to run the test suite and the type check and to paste the last 20 lines of each. Green gates are the acceptance criterion, not a plausible-looking diff.
-
Review for bugs.
/code-reviewreviews the current diff, a PR number, a branch, or a path. It takes an effort level (lowtomax, orultra) and--fixto apply findings or--commentto post them on the PR./reviewis an alias. -
Review for security.
/security-reviewchecks the diff between your branch and the default branch onoriginfor issues such as injection and auth mistakes. It needs anoriginremote. -
Clean up.
/simplifyruns four review agents in parallel for reuse, simplification, efficiency, and whether the change sits at the right level, then applies the fixes. Rerun the gates afterwards.
/code-review ultra (the older /ultrareview is a deprecated alias) sends the branch to a fleet of cloud reviewer agents that reproduce each finding. Pro and Max include three free runs; after that, Anthropic’s ultrareview docs put a run at typically $5 to $25 (checked 2026-09-26). It is not available to Zero Data Retention organizations. On Bedrock, Google Cloud, and Microsoft Foundry, /code-review ultra runs a local review instead. Keep it for high-risk branches. Review automation moves the same checks into CI so they run on every pull request.
Who signs off: you do. The gates and the review tell you which diffs deserve a line-by-line read: the ones that fail a gate, touch paths outside the task, or change auth, payments, or data deletion.
How do you let Claude work until a condition holds?
Section titled “How do you let Claude work until a condition holds?”/goal <condition> keeps Claude working turn after turn until a separate evaluator model judges the condition met or impossible. /goal with no argument shows the active goal and its progress; /goal clear (or stop, off, reset, none, cancel) ends it. A condition works when it names an end state, the command that proves it, and a constraint:
The evaluator’s “met” is a claim, not proof. Rerun the gates yourself before you commit. Goal workflows covers writing conditions and running goals unattended; /loop repeats a prompt on an interval instead of stopping at a condition.
Which commands fix setup, permissions, and cost?
Section titled “Which commands fix setup, permissions, and cost?”| Command | What it does |
|---|---|
/usage | Session cost, plan usage limits, and activity stats; /cost and /stats are aliases |
/permissions | Manage allow and deny rules for tools |
/fewer-permission-prompts | Scans your transcripts for common read-only Bash and MCP calls and adds a prioritized allowlist to the project .claude/settings.json |
/memory | Edit CLAUDE.md files, turn auto memory on or off, and view its entries |
/mcp | List MCP servers; /mcp reconnect <server> reconnects one |
/hooks | Show configured hooks |
/doctor | Checks installation health, unparseable settings, and unused skills, MCP servers, and plugins, and can fix them |
/debug [description] | Turns on debug logging mid-session and reads the log to diagnose a problem |
/status | Version, model, account, and API connectivity |
/fewer-permission-prompts writes to a file your whole team shares, so review its diff like any other change before you commit it. Memory system explains what belongs in CLAUDE.md and what belongs in auto memory.
Which keyboard shortcuts save the most time?
Section titled “Which keyboard shortcuts save the most time?”| Shortcut | Action |
|---|---|
Esc | Interrupt Claude mid-turn; the work so far is kept, and queued messages go next |
Esc Esc | On an empty prompt, open the rewind menu; with text in the prompt, clear the draft |
Shift+Tab | Cycle permission modes: Manual, acceptEdits, plan, and auto or bypassPermissions when available |
Ctrl+O | Toggle the transcript viewer with full tool calls |
Ctrl+R | Search prompt history |
Ctrl+B | Send a running Bash command or agent to the background; inside tmux, 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 editor |
Option+P (macOS) or Alt+P | Switch model without clearing the prompt |
Ctrl+C | Interrupt; when nothing is running, the first press clears the prompt and a second press exits |
! at the start | Shell mode: run a command and add its output to the session |
@ | File path autocomplete, so Claude reads the exact file you mean |
From v2.1.283 (the latest channel), interactive sessions start in auto mode on supported models, where a classifier reviews each action; claude -p and sessions where settings set disableAutoMode still start in Manual. Shift+Tab into plan before a change that spans many files, or type /plan followed by the task.
When slash commands go wrong
Section titled “When slash commands go wrong”- Every new session suddenly runs on the wrong model. You ran
/model fable(or another model) and it became your default. Recovery: open/model, select the model you want as your default, and next time presssfor a session-only switch. - The command did nothing, or Claude answered it as text. The command was not at the start of the message, or it was queued behind a running turn. Recovery: press
Esc, then send the command on its own line. /compactdropped the detail you needed. Recovery:Esc Escor/rewindto a point before the compact and rerun it with instructions, as in the prompt above. For the next session, write a handoff file before you compact.- You ran
/clearand need the old conversation back. It is still on disk. Recovery:/resumeand pick it by the name you passed to/clear, or open the rewind menu’s previous-session entry if you are still in the same process. - A command from an old guide is missing.
/agentswas removed in v2.1.198 (ask Claude or edit.claude/agents/instead) and/ultraplanwas removed from the reference in v2.1.222 (use plan mode)./review,/cost,/stats, and/ultrareviewstill work as aliases. If the whole/menu is empty of skills, check whether the session started with--disable-slash-commands. /stopis not available. It works only while you are attached to a background session. Recovery: use/exitin a normal session, or stop a background one fromclaude agents.- Permission prompts keep repeating. Recovery:
/fewer-permission-promptsor an allow rule in/permissions. Do not start sessions with--dangerously-skip-permissions; its own help text recommends it only for sandboxes with no internet access. - A broken hook, skill, or plugin makes every command misbehave. Recovery: run
/doctor, or restart withclaude --safe-mode, which disables CLAUDE.md, skills, plugins, hooks, MCP servers, and other customizations so you can find the culprit.
Where to go next with Claude Code commands
Section titled “Where to go next with Claude Code commands”- Previous: Claude Code command line for launch flags, resuming from the shell, and
claude -ppipes. - Next: terminal mastery for tmux panes and running several sessions side by side.
- Turn your repeated prompts into commands: custom commands and skills.
- Enforce what commands only suggest: hooks and automation.
- Keep spend in check: cost control.
- The Codex equivalent: Codex CLI commands.