Files
claude-code-best-practice/best-practice/claude-commands.md
T
Shayan Rais dc37a9fe40 Refresh claude-commands.md descriptions for v2.1.119
- /branch: note CLAUDE_CODE_FORK_SUBAGENT env var causes /fork to spawn a
  forked subagent instead of branching the conversation (v2.1.117)
- /focus: clarify "Only available in fullscreen rendering" (v2.1.110)
- /skills: add "Press t to sort by token count" (v2.1.110/111)
- /clear: reword to contrast with /compact — /clear starts fresh, /compact
  preserves the same conversation
- Bump Last Updated badge and version to v2.1.119

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-26 15:42:35 +05:00

19 KiB

Commands Best Practice

Last Updated Version
Implemented

Claude Code commands — frontmatter fields and official built-in slash commands.

← Back to Claude Code Best Practice Claude

Frontmatter Fields (15)

Field Type Required Description
name string No Display name and /slash-command identifier. Defaults to the directory name if omitted
description string Recommended What the command does. Shown in autocomplete and used by Claude for auto-discovery
when_to_use string No Additional context for when Claude should invoke the skill — trigger phrases or example requests. Appended to description in the listing and counts toward the 1,536-character cap
argument-hint string No Hint shown during autocomplete (e.g., [issue-number], [filename])
arguments string/list No Named positional arguments for $name substitution in command content. Accepts a space-separated string or YAML list — names map to argument positions in order
disable-model-invocation boolean No Set true to prevent Claude from automatically invoking this command
user-invocable boolean No Set false to hide from the / menu — command becomes background knowledge only
paths string/list No Glob patterns that limit when this skill is activated. Accepts a comma-separated string or a YAML list. When set, Claude loads the skill automatically only when working with files matching the patterns
allowed-tools string No Tools allowed without permission prompts when this command is active
model string No Model to use when this command runs (e.g., haiku, sonnet, opus)
effort string No Override the model effort level when invoked (low, medium, high, max)
context string No Set to fork to run the command in an isolated subagent context
agent string No Subagent type when context: fork is set (default: general-purpose)
shell string No Shell for !`command` blocks — accepts bash (default) or powershell. Requires CLAUDE_CODE_USE_POWERSHELL_TOOL=1
hooks object No Lifecycle hooks scoped to this command

Official (75)

# Command Tag Description
1 /login Auth Sign in to your Anthropic account
2 /logout Auth Sign out from your Anthropic account
3 /setup-bedrock Auth Configure Amazon Bedrock authentication, region, and model pins through an interactive wizard. Only visible when CLAUDE_CODE_USE_BEDROCK=1 is set. First-time Bedrock users can also access this wizard from the login screen
4 /setup-vertex Auth Configure Google Vertex AI authentication, project, region, and model pins through an interactive wizard. Only visible when CLAUDE_CODE_USE_VERTEX=1 is set. First-time Vertex AI users can also access this wizard from the login screen
5 /upgrade Auth Open the upgrade page to switch to a higher plan tier
6 /color [color|default] Config Set the prompt bar color for the current session. Available colors: red, blue, green, yellow, purple, orange, pink, cyan. Use default to reset
7 /config Config Open the Settings interface to adjust theme, model, output style, and other preferences. Alias: /settings
8 /focus Config Toggle the focus view, which shows only the last prompt, a summary of tool calls, and the final response. Useful for reducing visual noise during long sessions. Only available in fullscreen rendering
9 /keybindings Config Open or create your keybindings configuration file
10 /permissions Config Manage allow, ask, and deny rules for tool permissions. Opens an interactive dialog where you can view rules by scope, add or remove rules, manage working directories, and review recent auto mode denials. Alias: /allowed-tools
11 /privacy-settings Config View and update your privacy settings. Only available for Pro and Max plan subscribers
12 /sandbox Config Toggle sandbox mode. Available on supported platforms only
13 /statusline Config Configure Claude Code's status line. Describe what you want, or run without arguments to auto-configure from your shell prompt
14 /stickers Config Order Claude Code stickers
15 /terminal-setup Config Configure terminal keybindings for Shift+Enter and other shortcuts. Only visible in terminals that need it, like VS Code, Cursor, Windsurf, Alacritty, or Zed
16 /theme Config Change the color theme. Includes light and dark variants, colorblind-accessible (daltonized) themes, ANSI themes that use your terminal's color palette, an "Auto (match terminal)" option that follows your terminal's light/dark mode, and custom themes loaded from ~/.claude/themes/ or plugins. Select "New custom theme…" to create your own
17 /tui [default|fullscreen] Config Set the terminal UI renderer and relaunch Claude Code with the current conversation intact. default uses inline rendering; fullscreen uses an alt-screen TUI
18 /voice [hold|tap|off] Config Toggle voice dictation, or enable it in a specific mode. Requires a Claude.ai account
19 /context Context Visualize current context usage as a colored grid. Shows optimization suggestions for context-heavy tools, memory bloat, and capacity warnings
20 /cost Context Alias for /usage
21 /extra-usage Context Configure extra usage to keep working when rate limits are hit
22 /insights Context Generate a report analyzing your Claude Code sessions, including project areas, interaction patterns, and friction points
23 /stats Context Alias for /usage. Opens on the Stats tab
24 /status Context Open the Settings interface (Status tab) showing version, model, account, and connectivity. Works while Claude is responding, without waiting for the current response to finish
25 /usage Context Show session cost, plan usage limits, and activity stats. /cost and /stats are aliases
26 /doctor Debug Diagnose and verify your Claude Code installation and settings. Results show with status icons. Press f to have Claude fix any reported issues
27 /feedback [report] Debug Submit feedback about Claude Code. Alias: /bug
28 /heapdump Debug Write a JavaScript heap snapshot and memory breakdown to ~/Desktop for diagnosing high memory usage. Useful when filing bug reports about memory growth
29 /help Debug Show help and available commands
30 /powerup Debug Discover Claude Code features through quick interactive lessons with animated demos
31 /release-notes Debug View the changelog in an interactive version picker. Select a specific version to see its release notes, or choose to show all versions
32 /tasks Debug List and manage background tasks. Alias: /bashes
33 /copy [N] Export Copy the last assistant response to clipboard. Pass a number N to copy the Nth-latest response: /copy 2 copies the second-to-last. When code blocks are present, shows an interactive picker to select individual blocks or the full response. Press w in the picker to write the selection to a file instead of the clipboard, which is useful over SSH
34 /export [filename] Export Export the current conversation as plain text. With a filename, writes directly to that file. Without, opens a dialog to copy to clipboard or save to a file
35 /agents Extensions Manage agent configurations
36 /chrome Extensions Configure Claude in Chrome settings
37 /hooks Extensions View hook configurations for tool events
38 /ide Extensions Manage IDE integrations and show status
39 /mcp Extensions Manage MCP server connections and OAuth authentication
40 /plugin Extensions Manage Claude Code plugins
41 /reload-plugins Extensions Reload all active plugins to apply pending changes without restarting. Reports counts for each reloaded component and flags any load errors
42 /skills Extensions List available skills. Press t to sort by token count
43 /memory Memory Edit CLAUDE.md memory files, enable or disable auto-memory, and view auto-memory entries
44 /effort [low|medium|high|xhigh|max|auto] Model Set the model effort level. Available levels depend on the model and include low, medium, high, xhigh, and max (session-only). Without an argument, opens an interactive slider to pick the level. auto resets to the model default. Takes effect immediately without waiting for the current response to finish
45 /fast [on|off] Model Toggle fast mode on or off
46 /model [model] Model Select or change the AI model. For models that support it, use left/right arrows to adjust effort level. The change takes effect immediately without waiting for the current response to finish. When switching mid-conversation after prior output, Claude warns before applying the change
47 /passes Model Share a free week of Claude Code with friends. Only visible if your account is eligible
48 /plan [description] Model Enter plan mode directly from the prompt. Pass an optional description to enter plan mode and immediately start with that task, for example /plan fix the auth bug
49 /ultraplan <prompt> Model Draft a plan in an ultraplan session, review it in your browser, then execute remotely or send it back to your terminal
50 /add-dir <path> Project Add a working directory for file access during the current session. Most .claude/ configuration is not discovered from the added directory
51 /diff Project Open an interactive diff viewer showing uncommitted changes and per-turn diffs. Use left/right arrows to switch between the current git diff and individual Claude turns, and up/down to browse files
52 /init Project Initialize project with a CLAUDE.md guide. Set CLAUDE_CODE_NEW_INIT=1 for an interactive flow that also walks through skills, hooks, and personal memory files
53 /review Project Review a pull request locally in your current session. For a deeper cloud-based review, see /ultrareview
54 /security-review Project Analyze pending changes on the current branch for security vulnerabilities. Reviews the git diff and identifies risks like injection, auth issues, and data exposure
55 /team-onboarding Project Generate a team onboarding guide from your Claude Code usage history. Analyzes sessions, commands, and MCP server usage from the past 30 days
56 /ultrareview [PR] Project Run a deep, multi-agent code review of the given pull request in a cloud sandbox. Produces a structured review with prioritized findings; complements the local /review command
57 /autofix-pr [prompt] Remote Spawn a Claude Code on the web session that watches the current branch's PR and pushes fixes when CI fails or reviewers leave comments. Detects the open PR from your checked-out branch with gh pr view; to watch a different PR, check out its branch first. Requires the gh CLI and access to Claude Code on the web
58 /desktop Remote Continue the current session in the Claude Code Desktop app. macOS and Windows only. Alias: /app
59 /install-github-app Remote Set up the Claude GitHub Actions app for a repository. Walks you through selecting a repo and configuring the integration
60 /install-slack-app Remote Install the Claude Slack app. Opens a browser to complete the OAuth flow
61 /mobile Remote Show QR code to download the Claude mobile app. Aliases: /ios, /android
62 /remote-control Remote Make this session available for remote control from claude.ai. Alias: /rc
63 /remote-env Remote Configure the default remote environment for web sessions started with --remote
64 /schedule [description] Remote Create, update, list, or run routines. Claude walks you through the setup conversationally. Alias: /routines
65 /teleport Remote Pull a Claude Code on the web session into this terminal: opens a picker, then fetches the branch and conversation. Also available as /tp. Requires a claude.ai subscription
66 /web-setup Remote Connect your GitHub account to Claude Code on the web using your local gh CLI credentials. /schedule prompts for this automatically if GitHub is not connected
67 /branch [name] Session Create a branch of the current conversation at this point. Alias: /fork. When CLAUDE_CODE_FORK_SUBAGENT is set, /fork instead spawns a forked subagent and is no longer an alias for this command
68 /btw <question> Session Ask a quick side question without adding to the conversation
69 /clear Session Start a new conversation with empty context. The previous conversation stays available in /resume. To free up context while continuing the same conversation, use /compact instead. Aliases: /reset, /new
70 /compact [instructions] Session Compact conversation with optional focus instructions
71 /exit Session Exit the CLI. Alias: /quit
72 /recap Session Generate a one-line summary of the current session on demand, without affecting the ongoing conversation
73 /rename [name] Session Rename the current session and show the name on the prompt bar. Without a name, auto-generates one from conversation history
74 /resume [session] Session Resume a conversation by ID or name, or open the session picker. Alias: /continue
75 /rewind Session Rewind the conversation and/or code to a previous point, or summarize from a selected message. See checkpointing. Alias: /checkpoint, /undo

Bundled skills such as /debug can also appear in the slash-command menu, but they are not built-in commands.


Sources