Skip to main content

Slash Commands

A complete reference of slash commands available in Claude Code. Type these at the input prompt to trigger special actions.

General Commands

CommandDescription
/helpShow all available commands and usage information
/exitExit Claude Code (same as Ctrl+D)
/clearClear the conversation history and start fresh
/compactSummarize the conversation to free up context window space
/costShow token usage and cost for the current session
/memoryView and edit the CLAUDE.md memory file
/statusShow current session status and configuration

Code Review Commands

CommandDescription
/reviewReview code changes in the current branch
/pr-commentsFetch and address PR review comments from GitHub

Workflow Commands

CommandDescription
/commitStage and commit changes with an AI-generated message
/initInitialize 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 press Tab to see autocomplete suggestions
  • Commands are case-insensitive (/HELP works the same as /help)
  • Custom commands support the same markdown formatting as regular prompts
  • Use /compact regularly during long sessions to stay within context limits