Slash Commands Reference
Complete reference for all built-in and custom slash commands in Claude Code.
Built-in Commands
Session Management
| Command | Description |
|---|---|
/clear | Clear conversation history |
/exit | Exit Claude Code |
/resume | Resume a previous conversation |
/compact [instructions] | Compact conversation with optional focus |
/rewind | Rewind conversation and/or code |
Configuration
| Command | Description |
|---|---|
/config | Open Settings interface (Config tab) |
/status | Open Settings interface (Status tab) |
/model | Select or change the AI model |
/permissions | View or update permissions |
/privacy-settings | View and update privacy settings |
/output-style [style] | Set output style |
/vim | Enter vim mode |
Tools & Integrations
| Command | Description |
|---|---|
/mcp | Manage MCP server connections |
/hooks | Manage hook configurations |
/plugin | Manage Claude Code plugins |
/agents | Manage custom AI subagents |
/ide | Manage IDE integrations |
Project & Files
| Command | Description |
|---|---|
/init | Initialize project with CLAUDE.md |
/memory | Edit CLAUDE.md memory files |
/add-dir | Add working directories |
/context | Visualize current context usage |
Git & Code Review
| Command | Description |
|---|---|
/review | Request code review |
/pr-comments | View pull request comments |
/security-review | Security review of changes |
/install-github-app | Setup GitHub Actions |
Diagnostics
| Command | Description |
|---|---|
/doctor | Check installation health |
/cost | Show token usage statistics |
/usage | Show plan limits and rate status |
/bashes | List background tasks |
/todos | List current todo items |
Other
| Command | Description |
|---|---|
/help | Get usage help |
/bug | Report bugs to Anthropic |
/export [filename] | Export conversation |
/login | Switch Anthropic accounts |
/logout | Sign out |
/release-notes | View release notes |
/sandbox | Enable sandboxed bash |
/statusline | Setup status line UI |
/terminal-setup | Install keybindings |
Custom Slash Commands
Create custom commands as Markdown files.
Locations
| Location | Scope |
|---|---|
.claude/commands/ | Project (team-shared) |
~/.claude/commands/ | Personal (all projects) |
Syntax
markdown
---
allowed-tools: Bash(git add:*), Bash(git status:*)
description: Create a git commit
model: claude-sonnet-4-5
argument-hint: commit message
---
Create a commit with message: $ARGUMENTSArguments
| Placeholder | Purpose |
|---|---|
$ARGUMENTS | All arguments |
$1, $2 | Specific positions |
Frontmatter Options
| Option | Description |
|---|---|
allowed-tools | Tools command can use |
description | Command description |
model | Model to use |
argument-hint | Help text for arguments |
Examples
Git Commit Command
.claude/commands/commit.md:
markdown
---
allowed-tools: Bash(git add:*), Bash(git commit:*)
description: Stage and commit changes
argument-hint: commit message
---
Stage all changes and create a commit with message: $ARGUMENTSUsage:
/commit fix: resolve login issueDeploy Command
.claude/commands/deploy.md:
markdown
---
allowed-tools: Bash(npm:*), Bash(vercel:*)
description: Deploy to production
---
Run npm build and deploy to Vercel productionTest Command
.claude/commands/test.md:
markdown
---
allowed-tools: Bash(npm test:*)
description: Run tests with coverage
---
Run the test suite with coverage report and summarize resultsBash Execution
Prefix with ! to run bash before command:
!/my-commandFile References
Use @ to include file contents:
markdown
Review the changes in @src/main.tsMCP Slash Commands
MCP servers expose prompts as slash commands:
/mcp__<server>__<prompt> [arguments]Examples:
/mcp__github__list_prs
/mcp__notion__search_pages "project plans"
/mcp__memory__save_note "meeting notes"Tips
- Tab completion: Commands autocomplete
- Help: Use
/helpfor command list - Arguments: Most commands accept arguments
- Chaining: Combine commands in prompts
Next Steps
- Hooks Reference - Automate with hooks
- MCP Guide - Connect external tools
- CLI Reference - Command-line options