Skip to main content
Slash commands are user-facing actions invoked with a / prefix in the Claude Code REPL. For example, typing /review triggers an AI-powered code review and /cost displays your current token usage. Commands live in src/commands/ and are registered in src/commands.ts.

Command types

There are three command types, each with different behavior:
TypeDescriptionExamples
PromptCommandSends a formatted prompt to the LLM with injected tools/review, /commit
LocalCommandRuns in-process, returns plain text/cost, /version
LocalJSXCommandRuns in-process, returns React JSX/install, /doctor

Command definition pattern

All commands follow this TypeScript shape:
const command = {
  type: 'prompt',
  name: 'my-command',
  description: 'What this command does',
  progressMessage: 'working...',
  allowedTools: ['Bash(git *)', 'FileRead(*)'],
  source: 'builtin',
  async getPromptForCommand(args, context) {
    return [{ type: 'text', text: '...' }]
  },
} satisfies Command
  • type — one of 'prompt', 'local', or 'local-jsx'
  • allowedTools — restricts which agent tools the LLM can call when handling this command
  • getPromptForCommand — constructs the prompt sent to the model (only for PromptCommand)

Command categories

Git & Code Quality

Commands for git workflows, code review, and code quality analysis.

Session & Context

Commands for managing conversation sessions, context, and memory.

Configuration

Commands for settings, permissions, themes, keybindings, and IDE integration.

Diagnostics & Setup

Commands for environment diagnostics, installation, remote setup, and status monitoring.

All categories at a glance

CategoryCommands
Git & version control/commit, /commit-push-pr, /branch, /diff, /pr_comments, /rewind
Code quality/review, /security-review, /advisor, /bughunter
Session management/compact, /context, /resume, /session, /share, /export, /summary, /clear
Memory & knowledge/memory, /add-dir, /files
Tasks & agents/tasks, /agents, /ultraplan, /plan
Settings/config, /permissions, /model, /effort, /privacy-settings
Appearance/theme, /output-style, /color, /fast, /brief
Input & editing/vim, /keybindings
MCP & plugins/mcp, /plugin, /reload-plugins, /skills
Authentication/login, /logout, /oauth-refresh
IDE & desktop/bridge, /bridge-kick, /ide, /desktop, /mobile, /teleport
Diagnostics & status/doctor, /status, /stats, /cost, /version, /usage, /rate-limit-options
Installation & setup/install, /upgrade, /init, /onboarding, /terminalSetup
Remote & environment/remote-env, /remote-setup, /env, /sandbox-toggle
Misc/help, /exit, /feedback, /voice, /copy, /release-notes, /rename, /tag

Build docs developers (and LLMs) love