Skip to main content

Slash Commands

Slash commands (/) are shortcuts that trigger specific actions instantly during a Claude Code conversation. Instead of typing long sentences, you can run frequent tasks immediately with short commands that start with /.

Complete list of built-in slash commandsโ€‹

Session managementโ€‹

CommandDescription
/clearReset the conversation history (empty the context window). Aliases: /reset, /new
/compact [instructions]Compress the conversation history into a summary (optionally specify what the summary should focus on)
/rewindRewind previous turns (code + conversation, conversation only, code only, or summary options). Aliases: /checkpoint, /undo
/resume [session]Resume a previous session (by ID/name or via the session picker UI). Alias: /continue
/branch [name]Branch the current conversation at that point. After branching, you can return to the original with /resume
/forkCopy the current conversation into a new background session (shown as a separate row in claude agents; the original session keeps working). The previous in-session subagent forking has been split off into /subtask (v2.1.212+)
/recapInstantly generate a one-line summary of the current session (separate from the automatic recap shown when you return after stepping away)
/rename [name]Rename the current session (auto-generated if the name is omitted)
/export [filename]Export the current conversation to a file or the clipboard
/exitEnd the Claude Code session. Alias: /quit

Checking informationโ€‹

CommandDescription
/helpShow a list of all available commands
/statusThe Status tab of the settings interface (version, model, account, connection status)
/costToken usage statistics (detailed by API/subscription)
/statsVisualize daily usage, session history, usage streak, and model preferences
/usageSubscription plan usage limits and rate limit status (subscribers only)
/doctorInstallation diagnostics (Node.js, API connectivity, tokens, settings validation)
/contextVisualize current context usage as a colored grid
/insightsGenerate a session analysis report (work areas, interaction patterns, friction points)
/release-notesView the full changelog (the latest version appears closest to the prompt)

Settings and authenticationโ€‹

CommandDescription
/configThe Config tab of the settings interface (theme, permissions, notifications, etc.). Set values directly from the prompt with /config key=value (e.g. /config thinking=false) โ€” supported in interactive mode, -p, and Remote Control (v2.1.181+). Alias: /settings
/model [model]Change the Claude model in use (adjust effort with the left/right arrow keys). Can switch even while waiting for a response
/effort [level|auto]Set the model effort level (low, medium, high, xhigh, max). auto restores the default. Running it without arguments opens an interactive slider (left/right arrows + Enter). Applies immediately without waiting for the current response to finish (v2.1.111+)
/permissionsView/edit the current list of allowed/denied actions. Alias: /allowed-tools
/loginAuthenticate with Anthropic or an API provider
/logoutSign out of the authenticated session
/themeChange the color theme (dark/light, colorblind-friendly themes, terminal-palette-based ANSI themes included)
/statuslineConfigure the status line UI (running it without arguments auto-configures from your shell prompt)
/keybindingsOpen/create the keybindings settings file
/extra-usageConfigure extra usage for when you hit a rate limit
/output-style [style]Switch the output style (Default, Explanatory, Learning, or a custom style)
/upgradeOpen the upgrade page for a higher plan (subscribers only)
/privacy-settingsView/change privacy settings (Pro and Max only)

Working with codeโ€‹

CommandDescription
/copyCopy the last response to the clipboard (if it contains code blocks, you can pick an individual block or the whole response)
/diffInteractive diff viewer (uncommitted changes + per-turn diffs. Switch with the left/right arrows, navigate files with up/down)
/tasksList and manage background tasks. Alias: /bashes
/plan [description]Enter Plan Mode directly from the prompt. Pass a description to start on that task right away
/review [PR]Review a PR locally in the current session (for quick feedback)
/ultrareview [PR]Multi-agent deep code review in a cloud sandbox. First 3 free for Pro/Max, billed as extra usage afterward. Reviews take 5โ€“10 minutes and run in the background (v2.1.86+, research preview)
/ultraplan <prompt>Write a plan in a cloud session โ†’ review it in the browser โ†’ run remotely or send it to your terminal
/autofix-pr [prompt]Create a Claude Code on the web session that watches the current branch's PR โ€” it automatically pushes fixes when CI fails or review comments come in. Auto-detects the PR via gh pr view. Requires the gh CLI
/security-reviewAnalyze the current branch for security vulnerabilities (injection, auth issues, data exposure, etc.)
/feedback [content]Submit Claude Code feedback. Alias: /bug

Bundled Skills (Built-in Skills)โ€‹

Bundled skills appear in the / menu alongside built-in commands, but internally they run as prompts. They spawn parallel agents, read files, and adapt to your codebase.

CommandDescription
/simplifyCheck the changed code for quality, reusability, and efficiency with 3 parallel agents, then apply fixes
/batch <instructions>Process large-scale code changes in parallel. Splits the work into 5โ€“30 units, each executed in its own isolated worktree
/debug [description]Read the session debug logs to troubleshoot (optionally scope the analysis with a description)
/loop [interval] <prompt>Schedule a recurring prompt (e.g. /loop 5m check the build status)
/claude-apiLoad a Claude API/Agent SDK reference matching your project's language (Python, TypeScript, etc.)
/datavizChart/dashboard design guide skill. Includes a runnable color palette validator (v2.1.198+)
/powerupInteractive in-terminal tutorial (10 power-ups with progress tracking). Open and read each one, check it off, and your progress goes up (v2.1.90+)
/team-onboardingAnalyzes your last 30 days of usage (commands, MCP, task types) and generates an ONBOARDING.md for new teammates. A teammate pastes it into Claude to start an interactive onboarding (v2.1.101+)

Environment and connectionsโ€‹

CommandDescription
/terminal-setupConfigure terminal keybindings (Shift+Enter, etc. Only shown in terminals that need it)
/tui [default|fullscreen]Switch the terminal UI renderer โ€” fullscreen is a flicker-free alt-screen renderer. Running it without arguments shows the current renderer. Switches while keeping the conversation (v2.1.89+, opt-in)
/focusToggle focus view โ€” shows only the last prompt, one-line tool call summaries (diffstats), and the final response. Persists across sessions. Fullscreen rendering only
/mcpManage MCP server connections and OAuth authentication
/ideManage IDE integration and check its status
/add-dir <path>Add a working directory to the current session
/cd <path>Change the session's working directory โ€” moving mid-session doesn't break the prompt cache (v2.1.169+)
/desktopSwitch the current CLI session to the Desktop app (macOS/Windows). Alias: /app
/mobileShow a QR code for downloading the mobile app. Aliases: /ios, /android
/fast [on|off]Toggle Fast Mode
/sandboxToggle sandbox mode (only available on supported platforms)
/remote-controlMake the current session remotely controllable from claude.ai. Alias: /rc
/remote-envSet the default remote environment for web sessions started with --remote
/teleportBring a Claude Code on the web session into your current terminal (session picker โ†’ branch checkout + conversation restore). Alias: /tp. Requires a claude.ai subscription
/voiceToggle voice dictation (push-to-talk). Requires a Claude.ai account
/chromeConfigure Chrome integration
/radioOpen the Claude FM lo-fi radio stream in your browser (prints the stream URL if no browser is available). Not supported on Amazon Bedrock, Google Cloud Agent Platform, or Microsoft Foundry

Extensionsโ€‹

CommandDescription
/agentsManage subagent configuration
/skillsView available skills (press t to sort by token count)
/pluginInstall/remove/manage plugins
/reload-pluginsReload active plugins (apply changes without restarting)
/hooksManage hook settings (automation on tool events)
/memoryEdit CLAUDE.md, enable/disable auto memory, review auto memory entries
/initAnalyze the project and auto-generate CLAUDE.md
/schedule [description]Create/update/list/run routines (automation driven by schedules, API calls, and GitHub events). Claude walks you through setup interactively. Alias: /routines
/web-setupConnect your GitHub account to Claude Code on the web using your local gh CLI credentials. /schedule points you here automatically if GitHub isn't connected
/install-github-appInstall the Claude app for GitHub Actions
/install-slack-appInstall the Slack app (OAuth authentication)

MCP prompt commandsโ€‹

Prompts provided by MCP servers can be invoked as slash commands:

/mcp__<server-name>__<prompt-name>

They are discovered automatically from connected MCP servers. See MCP Server Setup for details.

Always check the latest list with /help

Claude Code is continuously updated. Type /help to see every command available in your current version. Typing any characters after / also filters the list.

Keyboard shortcutsโ€‹

General controlsโ€‹

ShortcutDescription
Ctrl+CCancel the current input or generation
Ctrl+DExit the Claude Code session
Ctrl+LClear the terminal screen (conversation history is preserved)
Ctrl+OToggle verbose output
Ctrl+GEdit the prompt in your default text editor
Ctrl+RReverse-search command history
Ctrl+BMove the running task to the background
Ctrl+FKill all background agents (press twice within 3 seconds to confirm)
Ctrl+TToggle the task list
Ctrl+VPaste an image from the clipboard
Esc + EscRewind to a checkpoint / summarize
Shift+TabCycle permission modes (default โ†” auto-accept โ†” Plan)
Alt+PSwitch models (keeps your prompt)
Alt+TToggle Extended Thinking
Alt+MCycle permission modes (some environments)
macOS Option key setup

To use Alt (Option) shortcuts on macOS, set the Option key to act as Meta in your terminal:

  • iTerm2: Settings โ†’ Profiles โ†’ Keys โ†’ "Esc+"
  • Terminal.app: Settings โ†’ Profiles โ†’ Keyboard โ†’ "Use Option as Meta Key"
  • VS Code: run /terminal-setup

Text editingโ€‹

ShortcutDescription
Ctrl+KDelete from the cursor to the end of the line
Ctrl+UDelete the entire line
Ctrl+YPaste the deleted text
Alt+BMove back one word
Alt+FMove forward one word

Multi-line inputโ€‹

MethodShortcut
Backslash\ + Enter (all terminals)
macOS defaultOption+Enter
Shift+EnterWorks out of the box in iTerm2, WezTerm, Ghostty, Kitty
Control sequenceCtrl+J
Setting up Shift+Enter

In the VS Code, Alacritty, Zed, and Warp terminals, run /terminal-setup to install the binding.

Quick input prefixesโ€‹

PrefixDescription
/Slash command or skill invocation
!Bash mode (runs directly without going through Claude; Claude responds automatically to the output โ€” set respondToBashCommands: false to restore the previous context-only behavior, v2.1.186+)
@File path autocomplete

Frequently used commands in practiceโ€‹

/clear โ€” starting a new taskโ€‹

Use it when you're starting a completely new task at the end of a long conversation. It keeps the previous conversation from becoming "noise" for the new task.

> The payment module implementation is done

/clear

> Now implement the notification system
Warning

/clear erases the entire previous conversation. If it contains important information, save it to CLAUDE.md first. If you cleared by accident, /rewind can restore the conversation to the point before /clear (v2.1.191+).

/compact โ€” saving contextโ€‹

Use it when the conversation has gotten long but you don't want a full reset. It condenses the conversation so far into its key points, freeing up context space.

> We've been working for 3 hours now...

/compact

Claude: Here's a summary of the work so far:
- Auth module complete (JWT, refresh token)
- 12 tests passing
- Remaining: payment integration, notification system

Shall we continue?

You can also add custom instructions to steer the summary:

/compact focus the summary on the payment-related work

/cost & /stats โ€” checking usageโ€‹

/cost

Token usage:
- Input: 38,100 tokens
- Output: 4,281 tokens
- Estimated cost: $0.23
/stats

๐Ÿ“Š Daily usage visualization
๐Ÿ”ฅ Streak: 7 days
๐Ÿ“ˆ Recent model: claude-opus-4-6 (82%)

API key users check costs with /cost; subscribers check plan limits with /usage.

/init โ€” auto-generating CLAUDE.mdโ€‹

Use it the first time you run Claude Code in a new project. Claude Code analyzes the project structure and automatically drafts a CLAUDE.md for you.

/init

Claude: Analyzing the project...
- Checked package.json: Next.js 14, TypeScript
- Directory structure analysis complete
- Created CLAUDE.md. Please review and adjust it.

/resume โ€” continuing a previous sessionโ€‹

/resume

Sessions:
1. payment-module-refactor (2 hours ago)
2. notification-system (yesterday)
3. session abc123 (3 days ago)

> select 1

Naming sessions ahead of time (/rename payment-module-refactor) makes them easy to find.

Prompt Suggestionsโ€‹

When you start a session, example commands appear as gray text in the prompt input. Suggestions are based on your project's git history and tailored to the files you've worked on recently.

After Claude responds, it also suggests next steps based on the conversation history:

  • Tab: accept the suggestion
  • Enter: accept and run immediately
  • Start typing: ignore the suggestion

Suggestions reuse the parent conversation's prompt cache, so they add almost no extra cost.

# Disable suggestions
export CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false

Task listโ€‹

For complex work, Claude automatically creates a task list. Toggle its visibility in the terminal status area with Ctrl+T.

  • Up to 10 tasks displayed at once
  • Persists across context compaction
  • Share across sessions: CLAUDE_CODE_TASK_LIST_ID=my-project claude

PR review status indicatorโ€‹

When working on a branch with an open PR, a clickable PR link appears at the bottom:

ColorStatus
๐ŸŸข GreenApproved
๐ŸŸก YellowAwaiting review
๐Ÿ”ด RedChanges requested
โšช GrayDraft
๐ŸŸฃ PurpleMerged

Requires the gh CLI. Updates automatically every 60 seconds.

Creating custom slash commandsโ€‹

Turn frequent tasks into / commands to cut down on repetitive typing. See Skills System for details.

Location and structureโ€‹

.claude/
commands/
review.md # /review command
test.md # /test command
deploy-check.md # /deploy-check command

Custom command example: code reviewโ€‹

.claude/commands/review.md:

Review the code changed so far.

Focus on:
1. Security vulnerabilities (OWASP Top 10)
2. Performance issues (N+1 queries, unnecessary loops)
3. Type safety
4. Edge case handling
5. Test coverage

Classify each finding by severity (high / medium / low).

Now typing /review in a conversation runs the prompt above automatically.

Passing arguments to custom commandsโ€‹

Use $ARGUMENTS in a command to pass extra arguments at run time.

.claude/commands/explain.md:

Explain the following code or concept so a beginner can understand it: $ARGUMENTS

Usage:

/explain JWT refresh token

Global custom commandsโ€‹

Commands you want available everywhere โ€” not just in one project โ€” go in the global location:

~/.claude/commands/
morning.md # daily morning routine
refactor.md # refactoring checklist

Bash mode (the ! prefix)โ€‹

Run shell commands directly, without going through Claude. The output is added to the conversation context, and Claude responds to it automatically.

! npm test
! git status
! ls -la
  • Real-time progress display
  • Move to the background with Ctrl+B
  • Autocomplete previous ! commands (Tab)
v2.1.186 โ€” automatic responses to ! output

Since v2.1.186, Claude automatically reacts to the output after a ! command runs (e.g., it sees a failing test and immediately analyzes the cause). To restore the previous behavior โ€” output goes into context only, and Claude doesn't act on it first โ€” set "respondToBashCommands": false in settings.json.

Vim editor modeโ€‹

Enable Vim keybindings with /vim to use Vim's core features: Normal/Insert mode switching, motions, text objects, and more. You can also make it permanent in /config.