Slash commands are how you steer a Claude Code session without leaving the keyboard. Some are built in — managing context, cost, models, and connected tools — and some you write yourself. Knowing the right handful turns Claude Code from something you type paragraphs at into something you actually drive.
This is the shortlist: the built-in commands worth committing to muscle memory, and the custom ones most people should build. Command sets evolve between releases, so run /help in your version to see exactly what’s available — but the categories below are stable.
Built-in commands worth memorizing
These ship with Claude Code and handle the mechanics of a session.
Daily-driver built-in commands
| /context | Show how the context window is allocated |
|---|---|
| /clear | Reset the conversation and free the window |
| /compact | Summarize the conversation to reclaim space |
| /model | Switch models without restarting |
| /mcp | List connected MCP servers and their tools |
| /agents | Manage and inspect subagents |
| /hooks | Add and review hooks |
| /help | List every available command |
/context and /clear — the two you’ll lean on most
/context shows where your window is going — system, tools, conversation. When responses start feeling vague or the session slows, check it first. Often the culprit is a bloated conversation or too many connected MCP servers, which this guide on MCP context cost gets into.
/clear is the reset button. When a session has wandered and accumulated junk, clearing it and re-stating just the relevant context is faster than fighting a cluttered window. Make it a reflex between unrelated tasks.
/compact — continuity without the bloat
When you want to keep going but the window is filling, /compact summarizes the conversation so far and frees space while preserving the gist. The difference from /clear: compact keeps continuity, clear throws it away. Use compact mid-task, clear between tasks.
/model — switch tiers on the fly
/model changes the model without restarting the session. Drop to a cheaper, faster model for routine edits and bump back up for a hard problem. If you route through a proxy, the available names reflect your config — see the Claude Code Router setup and the cheap-models guide for that.
Commands for managing your setup
These don’t do work; they show you the state of your tools.
/mcp lists connected servers and the tools each exposes — your first stop when a server isn’t behaving or you’re auditing context cost. /agents opens subagent management, scaffolding new ones and showing which are available. /hooks walks you through adding hooks without hand-editing JSON. Together they’re how you inspect and tune the extension points covered in the power-user guide.
Custom commands you should build
Built-ins handle the session; custom commands handle your repeated prompts. The mechanics — a markdown file in .claude/commands/ — are in creating custom slash commands. Here’s what’s worth building:
/review— your code-review prompt applied to current changes. The single most useful custom command for most teams./commit— generate a commit message in your house format./test— write tests for a given file following your conventions./explain— explain a file or module, taking the path as an argument, for onboarding or unfamiliar code./pr-desc— draft a pull request description from the branch’s diff./security— a focused security pass over the current changes.
Review the current changes for bugs, missing error handling, and
security issues. Point to a file and line for each finding and rank
them: blocker, should-fix, nitpick. If the change is clean, say so.
A practical starter set
You don’t need every command on day one. Learn these built-ins and build these custom ones:
Slash command starter set
- Built-in: /context, /clear, /compact for managing the window
- Built-in: /model to switch tiers, /mcp and /agents to inspect tools
- Custom: /review for code review on demand
- Custom: /commit for your commit message format
- Custom: /explain with an argument for unfamiliar code
- Run /help to see everything your version offers
Wrapping up
The built-in commands you’ll actually use boil down to a handful: /context and /clear to manage the window, /compact for continuity, /model to switch tiers, and /mcp and /agents to inspect your tools. Layer on a few custom commands for the prompts you repeat — /review and /commit first — and you’re driving Claude Code instead of typing at it.
To build the custom ones, follow creating custom slash commands; to see where commands fit among skills, hooks, and subagents, the power-user guide ties it together.