Claude Code
Reference

Slash commands and Vim mode guide for the Claude Code CLI. Every command in one searchable reference — validated against Claude Code v2.1.183.

Slash Command Vim Binding
Quick tips: Prefix any shell command with ! to run it directly (e.g. !git status). Type @ for file path autocomplete. Custom skills appear alongside built-in commands when you type /.
01

Session Management

8 cmds
Clear conversation/clear

Starts a new conversation with empty context; the previous one stays available in /resume. Pass a name to label it.

aliases: /reset /new

Compact conversation/compact [instructions]

Compresses the conversation into a summary to reclaim context space. Optional instructions guide what gets preserved.

Resume session/resume [session]

Picks up a previous conversation by session ID or name, or opens a picker. Background sessions appear marked bg.

alias: /continue

Branch conversation/branch [name]

Branches the conversation here so you can try a different direction; switches you in and keeps the original, returnable via /resume.

Fork to subagent/fork <directive>

Spawns a forked subagent that inherits the full conversation and works on the directive in the background while you keep going; its result returns when done. Redefined in v2.1.161 (was an alias for /branch).

Rename session/rename [name]

Gives the session a custom name shown on the prompt bar, or auto-generates one from conversation history.

Rewind/rewind

Rolls conversation and/or code back to a previous checkpoint, or summarizes from a selected message.

aliases: /checkpoint /undo

Exit CLI/exit

Closes the session and returns you to your shell. In an attached background session, detaches and keeps it running.

alias: /quit

02

Context & Usage

7 cmds
Context window/context [all]

Displays a colored grid of context-window consumption with optimization hints. Pass all to expand the per-item breakdown.

Plan usage/usage

Shows session cost plus plan limits and activity stats; on paid plans, breaks usage down by skill, subagent, plugin, and MCP server.

aliases: /cost /stats

Token cost/cost

Opens usage focused on session cost — input/output tokens and cache hits. Alias for /usage.

Usage stats/stats

Opens usage on the Stats tab — daily patterns, session history, and model preferences. Alias for /usage.

Usage credits/usage-credits

Configures usage credits so Claude keeps working after you hit a limit. Renamed from /extra-usage.

Side question/btw <question>

Asks a quick question with full visibility into the session, answered in a dismissible overlay without adding to history. Works while Claude is busy.

Session recap/recap

Generates a one-line summary of the session so far on demand.

03

Model & Output

6 cmds
Switch model/model [model]

Switches the active model and saves it as the default for new sessions; use arrow keys to adjust effort, or press s for this session only.

Effort level/effort [level|auto]

Sets reasoning effort: low, medium, high, xhigh, max, or ultracode (max and ultracode are session-only). auto resets to the model default.

Fast mode/fast [on|off]

Toggles fast mode: same model, optimized for faster output at the cost of some thoroughness.

Advisor/advisor [model|off]

Enables or disables the advisor, which consults a second model (opus, sonnet, or fable) for guidance at key moments. (v2.1.98+)

Voice input/voice [hold|tap|off]

Toggles voice dictation for prompts; hold-to-record by default, or /voice tap for tap-to-toggle. Requires a Claude.ai account.

Status dialog/status

Opens the Settings Status tab — version, model, account, and connectivity. Works even while Claude is responding.

04

Configuration

12 cmds
Settings UI/config [key=value]

Opens the interactive settings UI, or set a value directly (e.g. /config thinking=false). Run /config help to list keys.

alias: /settings

Permissions/permissions

Manages allow / ask / deny rules for tools by scope, plus working directories and recent auto-mode denials.

alias: /allowed-tools

Hooks/hooks

Manages shell commands that run automatically in response to tool events (pre/post hooks).

Memory/memory

Opens CLAUDE.md memory files for editing and manages auto-memory settings.

Init project/init

Creates a CLAUDE.md file in the project root with starter instructions tailored to your codebase.

Keybindings/keybindings

Opens keybindings config to customize keyboard shortcuts and add chord bindings.

Status line/statusline

Configures the persistent status bar showing model, context, and live info.

Theme/theme

Changes color theme between light, dark, colorblind-accessible, and ANSI palettes.

Terminal setup/terminal-setup

Configures terminal keybindings for Shift+Enter multi-line input and other shortcuts.

Sandbox/sandbox

Toggles sandboxed execution mode that restricts file system and network access.

Privacy/privacy-settings

View and update data privacy preferences (Pro and Max subscribers).

Fewer prompts/fewer-permission-prompts

[Skill] Scans your transcripts for common read-only Bash/MCP calls and adds an allowlist to project .claude/settings.json to cut permission prompts.

05

Tools & Integrations

13 cmds
MCP servers/mcp

Manages MCP server connections and OAuth; reconnect a server, or enable/disable one or all without opening the dialog.

Plugins/plugin [subcommand]

Installs, removes, and manages plugins. Pass list, install, enable, or disable to act directly.

Reload plugins/reload-plugins [--force]

Hot-reloads active plugins — skills, agents, hooks, plugin MCP/LSP servers — without restarting.

Reload skills/reload-skills

Re-scans skill and command directories so files added or changed on disk become available mid-session. (v2.1.152+)

Skills/skills

Lists available skills; press t to sort by token count, Space to hide a skill. Plugin skills appear here too.

Agents/agents

Manages subagent configurations — specialized agents with their own tools, model, and instructions.

IDE integration/ide

Manages IDE integrations and shows connection status (VS Code, Cursor, JetBrains).

Chrome/chrome

Configures the Claude in Chrome integration for browser-based workflows and debugging.

Schedule/schedule [description]

Creates, lists, or runs routines that execute on Anthropic-managed cloud infrastructure, set up conversationally.

alias: /routines

Loop/loop [interval] [prompt]

[Skill] Runs a prompt repeatedly while the session stays open; omit the interval and Claude self-paces between iterations.

alias: /proactive

Claude API reference/claude-api [migrate]

[Skill] Loads Claude API / Agent SDK reference for your language; migrate upgrades existing API code to a newer model.

Deep research/deep-research <question>

[Workflow] Fans out web searches, fetches and cross-checks sources, and synthesizes a cited report.

Workflows/workflows

Opens the workflow progress view to watch, pause, resume, or save running and completed workflows.

06

Code & Review

12 cmds
View diff/diff

Interactive diff viewer for uncommitted changes and per-turn diffs; arrows switch between the git diff and individual turns.

Plan mode/plan [description]

Enters plan mode — Claude explores and designs an approach for approval before editing. Pass a task to start immediately.

Code review/code-review [level] [--fix]

[Skill] Reviews the diff for correctness bugs and cleanups; --fix applies findings, --comment posts inline PR comments, ultra runs a deep cloud review.

PR review/review [PR]

Reviews a pull request locally in the current session.

Security review/security-review

Scans pending changes on the branch for security vulnerabilities — injection, auth issues, and data exposure.

Simplify/simplify [target]

[Skill] Four parallel agents review for reuse, simplification, efficiency, and abstraction, and apply cleanup fixes (no bug-hunting). (v2.1.154+)

Ultra review/ultrareview [PR]

Runs a deep, multi-agent code review in a cloud sandbox. Preferred form is /code-review ultra; /ultrareview is an alias.

Ultra plan/ultraplan <prompt>

Drafts a plan in an ultraplan session you review in the browser, then executes remotely or sends it back to your terminal.

Batch changes/batch <instruction>

[Skill] Decomposes a codebase-wide change into 5–30 units, runs one background subagent per unit in its own git worktree, and opens a PR each. Requires git.

Run app/run

[Skill] Launches and drives your project's app to see a change working in the running app, not just tests. (v2.1.145+)

Verify change/verify

[Skill] Confirms a change works by building and running the app and observing the result, rather than relying on tests. (v2.1.145+)

Auto-fix PR/autofix-pr [prompt]

Spawns a web session that watches the current branch's PR and pushes fixes when CI fails or reviewers comment. Requires gh.

07

Sharing & Account

11 cmds
Copy response/copy [N]

Copies Claude's last response to clipboard; pass N for an earlier one, or pick individual code blocks (press w to write to a file).

Export conversation/export [filename]

Exports the full conversation as plain text to clipboard or a specified file.

Remote control/remote-control

Makes this session controllable from claude.ai so you can continue it from another device.

alias: /rc

Remote environment/remote-env

Chooses the default cloud-agent environment for teleporting sessions to cloud dev machines.

Teleport session/teleport

Pulls a Claude Code on the web session into this terminal — picks a session, fetches its branch and conversation. Subscription required.

alias: /tp

Web setup/web-setup

Connects your GitHub account to Claude Code on the web using your local gh credentials.

Desktop app/desktop

Continues the current session in the Claude Code desktop app (macOS/Windows, subscription).

alias: /app

Login/login

Signs in to your Anthropic account to authenticate Claude Code.

Logout/logout

Signs out and clears stored credentials from this machine.

Upgrade plan/upgrade

Opens the upgrade page to switch to a higher plan tier. Shown on Pro and Max plans.

Share passes/passes

Shares a free week of Claude Code with friends through a referral link. Shown if your account is eligible.

08

Miscellaneous

21 cmds
Help/help

Overview of available commands, usage tips, and documentation links.

Diagnostics/doctor

Diagnoses your install and settings; press f to have Claude fix any reported issues.

Debug mode/debug [description]

[Skill] Enables debug logging mid-session and troubleshoots by reading the session debug log. Off by default unless you started with --debug.

Background session/background [prompt]

Detaches the current session to run as a background agent and frees this terminal. Pass a prompt to send one more instruction first.

alias: /bg

Stop session/stop

Stops the current background session; the transcript and any worktree are kept. Only available while attached.

Background tasks/tasks

Views and manages everything running in the background — agents and async shell commands.

alias: /bashes

Add directory/add-dir <path>

Adds an additional working directory so Claude can access files outside the launch directory.

Change directory/cd <path>

Moves this session to a new working directory, preserving the prompt cache by appending the new CLAUDE.md. (v2.1.169+)

Focus view/focus

Toggles focus view — only your last prompt, a one-line tool summary with diffstats, and the final response. Fullscreen only.

Terminal renderer/tui [default|fullscreen]

Sets the terminal UI renderer and relaunches into it with your conversation intact. fullscreen enables the alt-screen renderer.

Prompt color/color [color|default]

Sets the prompt-bar color for the session; run with no argument for a random color.

Insights/insights

Generates a report on your sessions — project areas, interaction patterns, and friction points.

Team onboarding/team-onboarding

Generates a team onboarding guide from your last 30 days of usage that a teammate can paste in to get set up.

Powerup/powerup

Discovers Claude Code features through quick interactive lessons with animated demos.

Radio/radio

Opens Claude FM lo-fi radio in your browser; prints the stream URL when no browser is available.

Feedback/feedback [report]

Submits feedback, reports a bug, or shares your conversation with session context.

aliases: /bug /share

Release notes/release-notes

Views the changelog in an interactive version picker.

GitHub app/install-github-app

Sets up the Claude GitHub Actions app for CI/CD integration and automated code review.

Slack app/install-slack-app

Installs the Claude Slack app via OAuth to interact with Claude from Slack channels.

Stickers/stickers

Order physical Claude Code stickers for your laptop or workspace.

Mobile app/mobile

Displays a QR code to download the Claude mobile app.

aliases: /ios /android

Recently removed or renamed: /pr-comments (removed v2.1.91 — ask Claude or use /review) · /todos (gone — use /tasks and Ctrl+T) · /output-style (folded into /config) · /extra-usage/usage-credits · /vim (removed v2.1.92 — use /config → Editor mode).

09

Plugins

Guide

Plugins extend Claude Code with custom slash commands, agents, MCP servers, and hooks. They're distributed as directories with a plugin.json manifest.

Install a plugin

Use /plugin to browse marketplaces and install, enable, or disable plugins. For local development, load a directory with --plugin-dir (repeatable) or a hosted .zip with --plugin-url.

Plugin structure

The manifest lives at .claude-plugin/plugin.json (name, description, version). Everything else — skills/, commands/, agents/, hooks/, .mcp.json, .lsp.json — sits at the plugin root, not inside .claude-plugin/.

Hot reload

After editing plugin files, run /reload-plugins to reload skills, agents, hooks, and plugin MCP/LSP servers without restarting. Pass --force if the reload would invalidate the prompt cache.

Marketplaces

Anthropic runs two public marketplaces: claude-plugins-official (curated, auto-registered) and the community catalog, added with /plugin marketplace add anthropics/claude-plugins-community and installed from as @claude-community.

Plugin MCP servers

Plugins bundle MCP servers via a root .mcp.json (or inline in plugin.json). Plugin skills are namespaced as /plugin-name:skill so they never collide with your own.

Creating a plugin

Run claude plugin init <name> to scaffold a manifest and starter skill, then claude plugin validate before sharing. Or convert an existing .claude/ setup into a plugin directory.

10

Skills (Custom Slash Commands)

Guide

A skill is a folder with a SKILL.md file; the folder name becomes the command. Custom commands are now merged into skills — a .claude/commands/deploy.md file and a .claude/skills/deploy/SKILL.md both create /deploy and work the same way.

Where skills live

Personal skills go in ~/.claude/skills/<name>/SKILL.md (all projects); project skills in .claude/skills/<name>/SKILL.md (this repo). Enterprise > personal > project on name clashes.

Skill frontmatter

Only description is recommended — Claude uses it to decide when to load the skill. Optional fields include name, allowed-tools, model, effort, argument-hint, and paths. The Markdown body is the prompt.

Who can invoke it

By default both you and Claude can invoke any skill. Set disable-model-invocation: true so only you can run it (good for /deploy), or user-invocable: false to hide it from the / menu so only Claude loads it.

Tool restrictions

allowed-tools grants tools without a permission prompt while the skill is active; disallowed-tools removes tools from Claude's pool — useful for autonomous loops that should never call AskUserQuestion.

Dynamic context

A !`command` line runs a shell command and inlines its output before Claude sees the skill, so !`git diff HEAD` arrives with the live diff already filled in. $ARGUMENTS (or $0, $1) captures input.

Listing & reloading

Use /skills to see everything, or type / and filter. Edits to SKILL.md apply live; new top-level skill directories need a restart, or /reload-skills to re-scan.

11

MCP Servers

Guide

MCP (Model Context Protocol) servers give Claude access to external tools, APIs, and data sources. They run as separate processes and communicate via stdio or HTTP.

Add a remote (HTTP) server

HTTP is preferred for hosted services: claude mcp add --transport http notion https://mcp.notion.com/mcp. Add --header "Authorization: Bearer …" for token auth. SSE and WebSocket transports also exist.

Add a local (stdio) server

Run a local process, separating server args with --: claude mcp add --env KEY=val airtable -- npx -y airtable-mcp-server. Everything after -- is passed to the server untouched.

Configuration scopes

--scope local (default) is just you in this project; --scope project is shared via a .mcp.json file in the repo; --scope user is you across all projects.

OAuth & approval

For OAuth servers, add the URL then run /mcp in-session to authenticate in the browser. Project-scoped servers from .mcp.json show as ⏸ Pending approval until you approve them once.

Managing servers

Use claude mcp list to see servers, claude mcp get <name> for details, claude mcp remove <name> to delete, or /mcp in-session for status and tool counts.

Tool search (deferred loading)

With tool search on (the default), MCP tool schemas load on demand via the ToolSearch tool, so servers with many tools don't bloat the context window. Troubleshoot connections in /mcp; pass env vars with --env KEY=value.


Vim Mode — keyboard editing for the prompt Optional · click to expand
12

Vim Mode -- Mode Switching

Vim

Enable via /config → Editor mode. The /vim slash command was removed in v2.1.92 -- use the config menu instead.

KeyActionFrom
EscEnter NORMAL modeINSERT, VISUAL
iInsert before cursorNORMAL
IInsert at beginning of lineNORMAL
aInsert after cursorNORMAL
AInsert at end of lineNORMAL
oOpen new line belowNORMAL
OOpen new line aboveNORMAL
vStart character-wise VISUAL selectionNORMAL
VStart line-wise VISUAL selectionNORMAL
13

Vim -- Navigation

Normal
Basic Movement
KeyAction
hMove left
jMove down
kMove up
lMove right
SpaceMove right
Word & Line
KeyAction
wNext word
eEnd of word
bPrevious word
0Beginning of line
$End of line
^First non-blank character
Document & Character Jumps
KeyAction
ggTop of input
GBottom of input
f{char}Jump to next occurrence of character
F{char}Jump to previous occurrence of character
t{char}Jump to just before next occurrence
T{char}Jump to just after previous occurrence
;Repeat last f/F/t/T
,Repeat last f/F/t/T in reverse
14

Vim -- Editing

Normal
Delete
KeyAction
xDelete character under cursor
ddDelete entire line
DDelete to end of line
dwDelete word forward
deDelete to end of word
dbDelete word backward
Change (delete + INSERT)
KeyAction
ccChange entire line
CChange to end of line
cwChange word forward
ceChange to end of word
cbChange word backward
Yank, Paste & Other
KeyAction
yy / YYank (copy) entire line
ywYank word
yeYank to end of word
ybYank word backward
pPaste after cursor
PPaste before cursor
>>Indent line
<<Dedent line
JJoin current line with next
uUndo last edit
.Repeat last change
15

Vim -- Text Objects

Vim

Use with operators: d (delete), c (change), y (yank). Example: ci" = change inside quotes. They also work after v/V to extend a VISUAL selection.

ObjectDescription
iw / awInner / around word
iW / aWInner / around WORD (whitespace-delimited)
i" / a"Inner / around double quotes
i' / a'Inner / around single quotes
i( / a(Inner / around parentheses
i[ / a[Inner / around brackets
i{ / a{Inner / around braces
16

Vim -- Not Supported

Limits

These standard Vim features are not available in Claude Code's Vim mode:

  • Block-wise VISUAL (Ctrl+V)
  • Redo (Ctrl+R is history search)
  • Macros (q, @)
  • Marks (m, ')
  • Named registers
  • Vim search (/pattern, ?)
  • Substitute (:s)
  • Ex commands (:w, :q)
  • Page navigation (Ctrl+D/U)
  • Count prefixes (3j, 5w)
Vim mode notes: Esc switches INSERT/VISUAL to NORMAL -- it doesn't cancel input editing (double-Esc on an empty prompt opens the rewind menu). VISUAL mode (v, V) is supported -- only block-wise Ctrl+V isn't; in VISUAL, operators (d, y, c, >) act on the selection. u undoes your last edit; /rewind is separate and rolls conversation and code back to a checkpoint. Enable vim via /config → Editor mode.