Slash Commands
Slash commands are built-in commands you can type during a Claude Code session to control behavior, manage context, and access useful utilities. Every slash command starts with / and is processed immediately by the CLI rather than being sent as a prompt.
Command Reference
| Command | Description |
|---|---|
/help | Display a list of all available commands and their descriptions. |
/clear | Clear the conversation history and start fresh with a clean context. |
/compact | Summarize the current conversation to free up context window space. |
/status | Show session status including loaded CLAUDE.md files and current configuration. |
/cost | Display the token usage and estimated cost for the current session. |
/review | Ask Claude to review code changes, typically the current git diff. |
/init | Generate a CLAUDE.md file for the current project based on the codebase. |
/config | View or modify Claude Code configuration settings. |
Using Slash Commands
Slash commands are typed directly into the Claude Code prompt. They do not require any special syntax beyond the leading forward slash.
> /help
This prints the full list of available commands with brief descriptions.
> /compact
This triggers a context summarization. Claude compresses the conversation history into a shorter summary, freeing up tokens for continued work.
Common Workflows
Starting a New Project
When you open Claude Code in a new repository for the first time, run /init to generate a starter CLAUDE.md file:
> /init
Claude will analyze your codebase and create a CLAUDE.md with your detected tech stack, available scripts, and project structure.
Monitoring Costs
Keep an eye on token usage during long sessions with /cost:
> /cost
This shows the total tokens consumed and the estimated dollar cost so far.
Reviewing Changes
After making a series of edits, use /review to get Claude to examine the current diff:
> /review
Claude will look at all staged and unstaged changes and provide feedback on code quality, potential bugs, and style consistency.
Resetting Context
If the conversation has drifted off track or accumulated too much history, use /clear to start over:
> /clear
This wipes the conversation but keeps your CLAUDE.md instructions loaded.
Tips
- You can type a slash command at any point in a session. It does not interrupt ongoing work.
- Combine
/compactwith long-running tasks to avoid hitting context limits. - Use
/statusto verify your CLAUDE.md was loaded correctly after starting a session.