Slash Commands
A complete reference of slash commands available in Claude Code. Type these at the input prompt to trigger special actions.
General Commands
| Command | Description |
|---|---|
/help | Show all available commands and usage information |
/exit | Exit Claude Code (same as Ctrl+D) |
/clear | Clear the conversation history and start fresh |
/compact | Summarize the conversation to free up context window space |
/cost | Show token usage and cost for the current session |
/memory | View and edit the CLAUDE.md memory file |
/status | Show current session status and configuration |
Code Review Commands
| Command | Description |
|---|---|
/review | Review code changes in the current branch |
/pr-comments | Fetch and address PR review comments from GitHub |
Workflow Commands
| Command | Description |
|---|---|
/commit | Stage and commit changes with an AI-generated message |
/init | Initialize a new CLAUDE.md file for the project |
Custom Commands
You can create custom slash commands by adding markdown files to your .claude/commands/ directory. Each file becomes a command named after the file.
Example: Creating .claude/commands/deploy.md lets you type /deploy to run your deployment instructions.
Custom Command Structure
.claude/
commands/
deploy.md -> /deploy
test-all.md -> /test-all
review-pr.md -> /review-pr
The content of each markdown file becomes the prompt that Claude receives when you invoke the command.
Tips
- Type
/and pressTabto see autocomplete suggestions - Commands are case-insensitive (
/HELPworks the same as/help) - Custom commands support the same markdown formatting as regular prompts
- Use
/compactregularly during long sessions to stay within context limits