Skip to content

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, /compact with instructions, /rewind, /clear with 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 now is 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, press Esc to interrupt first.
  • Custom commands are now skills. A file in .claude/skills/<name>/SKILL.md appears in the / menu next to the built-ins. Bundled skills such as /code-review, /simplify, /batch, /debug, /loop, and /doctor are 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.

CommandWhat it keepsReach for it when
/btw [question]Everything; the side question never enters the conversationYou 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 instructionsThe task continues but the early turns are noise
/rewind or Esc Esc on an empty promptCode and conversation up to a checkpoint you pickThe last few turns went the wrong way
/clear [name]Nothing in context; the old conversation stays on diskThe 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.

CommandWhere the copy runsWhere the result goesUse it for
/branch [name]Here; you switch into the branchStays in the branch; return to the original with /resumeTrying a different design without losing the current one
/fork [prompt]A new background sessionIts own session, visible in claude agentsA parallel line of work you will review separately
/subtask <task>A background subagentReported back into this conversationA 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:

  1. See the scope. /diff shows uncommitted changes and per-turn diffs. A change that touches files outside the task is the first signal to stop and ask why.

  2. 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.

  3. Review for bugs. /code-review reviews the current diff, a PR number, a branch, or a path. It takes an effort level (low to max, or ultra) and --fix to apply findings or --comment to post them on the PR. /review is an alias.

  4. Review for security. /security-review checks the diff between your branch and the default branch on origin for issues such as injection and auth mistakes. It needs an origin remote.

  5. Clean up. /simplify runs 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?”
CommandWhat it does
/usageSession cost, plan usage limits, and activity stats; /cost and /stats are aliases
/permissionsManage allow and deny rules for tools
/fewer-permission-promptsScans your transcripts for common read-only Bash and MCP calls and adds a prioritized allowlist to the project .claude/settings.json
/memoryEdit CLAUDE.md files, turn auto memory on or off, and view its entries
/mcpList MCP servers; /mcp reconnect <server> reconnects one
/hooksShow configured hooks
/doctorChecks 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
/statusVersion, 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?”
ShortcutAction
EscInterrupt Claude mid-turn; the work so far is kept, and queued messages go next
Esc EscOn an empty prompt, open the rewind menu; with text in the prompt, clear the draft
Shift+TabCycle permission modes: Manual, acceptEdits, plan, and auto or bypassPermissions when available
Ctrl+OToggle the transcript viewer with full tool calls
Ctrl+RSearch prompt history
Ctrl+BSend a running Bash command or agent to the background; inside tmux, press it twice
Ctrl+TShow or hide Claude’s task checklist
Ctrl+SStash the current prompt; press again on an empty prompt to restore it
Ctrl+GEdit the prompt in your default editor
Option+P (macOS) or Alt+PSwitch model without clearing the prompt
Ctrl+CInterrupt; when nothing is running, the first press clears the prompt and a second press exits
! at the startShell 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.

  • 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 press s for 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.
  • /compact dropped the detail you needed. Recovery: Esc Esc or /rewind to 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 /clear and need the old conversation back. It is still on disk. Recovery: /resume and 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. /agents was removed in v2.1.198 (ask Claude or edit .claude/agents/ instead) and /ultraplan was removed from the reference in v2.1.222 (use plan mode). /review, /cost, /stats, and /ultrareview still work as aliases. If the whole / menu is empty of skills, check whether the session started with --disable-slash-commands.
  • /stop is not available. It works only while you are attached to a background session. Recovery: use /exit in a normal session, or stop a background one from claude agents.
  • Permission prompts keep repeating. Recovery: /fewer-permission-prompts or 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 with claude --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”