Skip to content

Slash Commands Reference

Complete reference for all built-in and custom slash commands in Claude Code.

Built-in Commands

Session Management

CommandDescription
/clearClear conversation history
/exitExit Claude Code
/resumeResume a previous conversation
/compact [instructions]Compact conversation with optional focus
/rewindRewind conversation and/or code

Configuration

CommandDescription
/configOpen Settings interface (Config tab)
/statusOpen Settings interface (Status tab)
/modelSelect or change the AI model
/permissionsView or update permissions
/privacy-settingsView and update privacy settings
/output-style [style]Set output style
/vimEnter vim mode

Tools & Integrations

CommandDescription
/mcpManage MCP server connections
/hooksManage hook configurations
/pluginManage Claude Code plugins
/agentsManage custom AI subagents
/ideManage IDE integrations

Project & Files

CommandDescription
/initInitialize project with CLAUDE.md
/memoryEdit CLAUDE.md memory files
/add-dirAdd working directories
/contextVisualize current context usage

Git & Code Review

CommandDescription
/reviewRequest code review
/pr-commentsView pull request comments
/security-reviewSecurity review of changes
/install-github-appSetup GitHub Actions

Diagnostics

CommandDescription
/doctorCheck installation health
/costShow token usage statistics
/usageShow plan limits and rate status
/bashesList background tasks
/todosList current todo items

Other

CommandDescription
/helpGet usage help
/bugReport bugs to Anthropic
/export [filename]Export conversation
/loginSwitch Anthropic accounts
/logoutSign out
/release-notesView release notes
/sandboxEnable sandboxed bash
/statuslineSetup status line UI
/terminal-setupInstall keybindings

Custom Slash Commands

Create custom commands as Markdown files.

Locations

LocationScope
.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: $ARGUMENTS

Arguments

PlaceholderPurpose
$ARGUMENTSAll arguments
$1, $2Specific positions

Frontmatter Options

OptionDescription
allowed-toolsTools command can use
descriptionCommand description
modelModel to use
argument-hintHelp 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: $ARGUMENTS

Usage:

/commit fix: resolve login issue

Deploy Command

.claude/commands/deploy.md:

markdown
---
allowed-tools: Bash(npm:*), Bash(vercel:*)
description: Deploy to production
---

Run npm build and deploy to Vercel production

Test 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 results

Bash Execution

Prefix with ! to run bash before command:

!/my-command

File References

Use @ to include file contents:

markdown
Review the changes in @src/main.ts

MCP 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

  1. Tab completion: Commands autocomplete
  2. Help: Use /help for command list
  3. Arguments: Most commands accept arguments
  4. Chaining: Combine commands in prompts

Next Steps

Claude Code Documentation Hub