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โ
| Command | Description |
|---|---|
/clear | Reset 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) |
/rewind | Rewind 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 |
/fork | Copy 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+) |
/recap | Instantly 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 |
/exit | End the Claude Code session. Alias: /quit |
Checking informationโ
| Command | Description |
|---|---|
/help | Show a list of all available commands |
/status | The Status tab of the settings interface (version, model, account, connection status) |
/cost | Token usage statistics (detailed by API/subscription) |
/stats | Visualize daily usage, session history, usage streak, and model preferences |
/usage | Subscription plan usage limits and rate limit status (subscribers only) |
/doctor | Installation diagnostics (Node.js, API connectivity, tokens, settings validation) |
/context | Visualize current context usage as a colored grid |
/insights | Generate a session analysis report (work areas, interaction patterns, friction points) |
/release-notes | View the full changelog (the latest version appears closest to the prompt) |
Settings and authenticationโ
| Command | Description |
|---|---|
/config | The 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+) |
/permissions | View/edit the current list of allowed/denied actions. Alias: /allowed-tools |
/login | Authenticate with Anthropic or an API provider |
/logout | Sign out of the authenticated session |
/theme | Change the color theme (dark/light, colorblind-friendly themes, terminal-palette-based ANSI themes included) |
/statusline | Configure the status line UI (running it without arguments auto-configures from your shell prompt) |
/keybindings | Open/create the keybindings settings file |
/extra-usage | Configure extra usage for when you hit a rate limit |
/output-style [style] | Switch the output style (Default, Explanatory, Learning, or a custom style) |
/upgrade | Open the upgrade page for a higher plan (subscribers only) |
/privacy-settings | View/change privacy settings (Pro and Max only) |
Working with codeโ
| Command | Description |
|---|---|
/copy | Copy the last response to the clipboard (if it contains code blocks, you can pick an individual block or the whole response) |
/diff | Interactive diff viewer (uncommitted changes + per-turn diffs. Switch with the left/right arrows, navigate files with up/down) |
/tasks | List 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-review | Analyze 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.
| Command | Description |
|---|---|
/simplify | Check 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-api | Load a Claude API/Agent SDK reference matching your project's language (Python, TypeScript, etc.) |
/dataviz | Chart/dashboard design guide skill. Includes a runnable color palette validator (v2.1.198+) |
/powerup | Interactive 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-onboarding | Analyzes 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โ
| Command | Description |
|---|---|
/terminal-setup | Configure 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) |
/focus | Toggle focus view โ shows only the last prompt, one-line tool call summaries (diffstats), and the final response. Persists across sessions. Fullscreen rendering only |
/mcp | Manage MCP server connections and OAuth authentication |
/ide | Manage 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+) |
/desktop | Switch the current CLI session to the Desktop app (macOS/Windows). Alias: /app |
/mobile | Show a QR code for downloading the mobile app. Aliases: /ios, /android |
/fast [on|off] | Toggle Fast Mode |
/sandbox | Toggle sandbox mode (only available on supported platforms) |
/remote-control | Make the current session remotely controllable from claude.ai. Alias: /rc |
/remote-env | Set the default remote environment for web sessions started with --remote |
/teleport | Bring a Claude Code on the web session into your current terminal (session picker โ branch checkout + conversation restore). Alias: /tp. Requires a claude.ai subscription |
/voice | Toggle voice dictation (push-to-talk). Requires a Claude.ai account |
/chrome | Configure Chrome integration |
/radio | Open 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โ
| Command | Description |
|---|---|
/agents | Manage subagent configuration |
/skills | View available skills (press t to sort by token count) |
/plugin | Install/remove/manage plugins |
/reload-plugins | Reload active plugins (apply changes without restarting) |
/hooks | Manage hook settings (automation on tool events) |
/memory | Edit CLAUDE.md, enable/disable auto memory, review auto memory entries |
/init | Analyze 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-setup | Connect 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-app | Install the Claude app for GitHub Actions |
/install-slack-app | Install 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.
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โ
| Shortcut | Description |
|---|---|
Ctrl+C | Cancel the current input or generation |
Ctrl+D | Exit the Claude Code session |
Ctrl+L | Clear the terminal screen (conversation history is preserved) |
Ctrl+O | Toggle verbose output |
Ctrl+G | Edit the prompt in your default text editor |
Ctrl+R | Reverse-search command history |
Ctrl+B | Move the running task to the background |
Ctrl+F | Kill all background agents (press twice within 3 seconds to confirm) |
Ctrl+T | Toggle the task list |
Ctrl+V | Paste an image from the clipboard |
Esc + Esc | Rewind to a checkpoint / summarize |
Shift+Tab | Cycle permission modes (default โ auto-accept โ Plan) |
Alt+P | Switch models (keeps your prompt) |
Alt+T | Toggle Extended Thinking |
Alt+M | Cycle permission modes (some environments) |
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โ
| Shortcut | Description |
|---|---|
Ctrl+K | Delete from the cursor to the end of the line |
Ctrl+U | Delete the entire line |
Ctrl+Y | Paste the deleted text |
Alt+B | Move back one word |
Alt+F | Move forward one word |
Multi-line inputโ
| Method | Shortcut |
|---|---|
| Backslash | \ + Enter (all terminals) |
| macOS default | Option+Enter |
| Shift+Enter | Works out of the box in iTerm2, WezTerm, Ghostty, Kitty |
| Control sequence | Ctrl+J |
In the VS Code, Alacritty, Zed, and Warp terminals, run /terminal-setup to install the binding.
Quick input prefixesโ
| Prefix | Description |
|---|---|
/ | 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
/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:
| Color | Status |
|---|---|
| ๐ข Green | Approved |
| ๐ก Yellow | Awaiting review |
| ๐ด Red | Changes requested |
| โช Gray | Draft |
| ๐ฃ Purple | Merged |
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)
! outputSince 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.