Claude Code Slash Commands: Full Reference Guide
Explore the full reference guide for Claude Code slash commands to boost your productivity and streamline your workflow.

Claude Code slash commands are the fastest way to control session behaviour without leaving the terminal. Most developers learn two or three and miss the rest.
This guide covers every built-in command, what it actually does, and how to build custom commands for repeated workflows. Bookmark it and run /help to confirm what is live in your version.
Key Takeaways
- Slash commands control session behaviour: They modify how Claude Code operates: context, mode, and output review, not running code directly.
/compactis the most important command: It summarises the conversation to preserve token budget without losing working context.- Custom commands extend your workflow: Any Markdown file in
.claude/commands/becomes a reusable slash command for your project. /initgenerates CLAUDE.md automatically: It scans the project and creates a starting-point memory file faster than writing one from scratch.- Most commands work in headless mode:
/clear,/compact, and custom commands all function in CI/CD pipelines. /helpis always current: Running it inside a session returns the command list for your installed version.
What Are Claude Code Slash Commands and How Do They Differ from CLI Flags?
Slash commands are typed inside an active Claude Code session and control real-time session behaviour. CLI flags are passed at launch and cannot be changed mid-session. Both are part of Claude Code, but they operate at different layers.
Slash commands work inside a running session. CLI flags like --headless or --dangerously-skip-permissions are set at startup.
- Session-level control: Slash commands modify behaviour in real time: clearing context, compacting memory, or triggering a code review.
- Launch-time flags: CLI flags configure the environment before the session starts and cannot be updated mid-run.
- Natural language vs commands: Prompts tell Claude what to do with code; slash commands trigger specific internal behaviours. Both are used together in a session.
- Two command types: Built-in commands ship with Claude Code and are always available. Custom commands are defined by you in
.claude/commands/. - Always check
/helpfirst: The returned list reflects your installed version, not documentation that may be out of date.
For flags, startup options, and non-interactive usage, the full CLI commands reference covers that layer of the tool separately.
What Does /clear Do and When Should You Use It?
/clear wipes the entire conversation context and starts a fresh session. Use it when switching to a completely unrelated task, not as a way to reduce token usage mid-task.
/clear removes all prior messages, file reads, and task history. It is a full reset.
- Full context wipe: All prior messages, file reads, and task history are gone after
/clearruns. - CLAUDE.md reloads automatically: Project-level memory files are reloaded on the new session. User-level memory persists across sessions by design.
- Switch tasks cleanly: Use
/clearonly when moving to something completely unrelated, where carry-over context would confuse outputs. - Not for token management: If you want to reduce token usage without losing the working thread,
/compactis the right command. - Cost implication: A cleared session reloads context from scratch, including any file reads Claude had already completed. Use it deliberately.
Running /clear mid-task means starting over. If you are in the middle of a multi-step change, use /compact instead.
What Does /compact Do and When Should You Use It?
/compact summarises the current conversation into a condensed representation, reducing token usage while preserving working context and recent decisions. Use it proactively before the window fills.
Claude Code operates within a 200K token context window. On large codebases or long sessions, this fills faster than expected.
- Preserves working context:
/compactkeeps the thread alive./cleardiscards it entirely. - Proactive use wins: Run
/compactbefore output quality degrades, not after. By the time responses worsen, useful context may already be lost. - Review the summary: After compacting, Claude confirms what was retained. Check that critical decisions and file states are captured.
- Extended sessions:
/compactsignificantly extends the usable session on complex, multi-file tasks where context accumulates quickly. - Not a last resort: Treat it as routine session hygiene on any session longer than 30 minutes.
For sessions working on large features, combining /compact with plan mode vs auto mode decisions gives you the most control over token usage and task execution.
What Does /review Do and What Does It Actually Check?
/review triggers a structured code review of the current working state. It evaluates recent changes for correctness, potential issues, and alignment with project conventions.
/review is not the same as asking Claude to "review this code" in a prompt.
- Structured output format:
/reviewactivates a dedicated review mode with consistent output: issues, suggestions, and a summary. Free-form prompts produce conversational responses instead. - Scope is the current session: It reviews code written or modified in the current session, not the entire codebase on every call.
- Use at checkpoints: Run
/reviewafter a significant generation block, before committing, or at natural task transitions. - Not a constant interrupt: Running
/reviewon every small change slows the session without proportionate benefit. - Action it as a checklist: The structured output of severity-labelled findings is designed to be worked through before running tests.
The /review output is most useful when you treat it as a pre-commit gate rather than a mid-task commentary.
What Do /help, /settings, and /release-notes Do?
These three commands handle session information and configuration. /help shows available commands, /settings manages session configuration, and /release-notes displays the changelog for your installed version.
Use this group for housekeeping and version awareness rather than task execution.
/helpis your version-accurate reference: It returns the full list of available commands for your installed version, without leaving the terminal./settingsopens configuration: Covers permission levels, tool access, and output preferences without editing config files directly./release-notesshows your version changelog: Displays changes for the installed Claude Code version, useful after an update.- Post-update workflow: Run
/release-notesafter updating to check for new commands, then run/helpto confirm they are active in the current session.
Keep these three in mind after every Claude Code update. New commands ship without announcements in most terminal environments.
What Do /init, /terminal, and /vim Do?
/init generates a CLAUDE.md file from your project structure. /terminal opens an embedded terminal pane. /vim enables Vim keybindings. All three reduce context-switching during active development.
These commands integrate Claude Code more tightly into your working environment.
/initsaves 15-30 minutes: It scans the current directory and generates a CLAUDE.md with your stack, structure, and key files as a starting point.- Edit after
/init: The generated file is a draft, not a final configuration. Review and refine it before relying on it. - When to run
/init: At the start of working with an unfamiliar codebase, or when setting up a new project before writing CLAUDE.md from scratch. /terminalkeeps you in context: Opens an embedded terminal pane for running commands, checking test output, or verifying file state./vimfor Vim users: Enables Vim keybindings in the Claude Code editor interface, removing the input model switch cost for developers who use Vim navigation by default.
Run /init on any new project before writing a single prompt. The generated CLAUDE.md gives Claude Code its first accurate picture of your codebase.
How Do Custom Slash Commands Work in .claude/commands/?
Any Markdown file placed in .claude/commands/ at the project root becomes a slash command. A file named deploy-check.md is invoked as /deploy-check. Claude executes the file contents as if you had typed the prompt directly.
Custom commands turn repeated prompts into one-keystroke operations.
- File equals command: Name the file what you want to type.
pre-commit-review.mdbecomes/pre-commit-review. - Contents are executed as prompts: Write the command file as a complete instruction set in Markdown. Claude runs it with full access to the current session context.
- Practical use cases: Pre-commit review checklists, code style enforcement prompts, structured debugging sequences, deployment verification steps.
- User-level commands: Place
.claude/commands/in~/.claude/commands/to make commands available across all projects, not just the current one. - No argument passing: Custom commands execute static file content. Dynamic behaviour requires prompt engineering within the file itself.
Custom commands work in automated pipelines too. See the guide on running Claude Code in headless mode for how to call them non-interactively.
Conclusion
Slash commands are a small surface with high leverage. The difference between burning through context on a long session and managing it deliberately comes down to /compact usage.
The custom command system in .claude/commands/ is what most developers never find. It turns Claude Code from a reactive tool into a consistent workflow layer.
Run /help in your next session to see the current command list for your version. Then create one custom command for the most-repeated prompt you type manually.
Want to Build Consistent Claude Code Workflows at Scale?
Most teams get Claude Code working for individual developers but never reach consistent output across a team. The gap is almost always in the CLAUDE.md setup, the custom command structure, and the session management habits.
At LowCode Agency, we are a strategic product team, not a dev shop. We build AI-powered development workflows using Claude Code as an orchestration layer, configured so it produces reliable, repeatable output across every developer on the team.
- Workflow scoping: We map your development process and identify where Claude Code commands and custom prompts reduce the most manual overhead.
- CLAUDE.md architecture: We design the project memory file so Claude Code understands your codebase conventions from the first session.
- Custom command library: We build the
.claude/commands/set for your specific review, deploy, and enforcement workflows. - Headless and CI integration: We configure Claude Code to run in your pipeline with the right commands, flags, and output handling.
- Team rollout: We set up the shared command structure so every developer on the team uses the same workflow layer, not individual ad-hoc prompts.
- Prompt engineering: We write the custom command files so Claude Code produces structured, actionable output on every run, not variable free-form responses.
- Full product team: Strategy, design, development, and QA from a single team that treats your Claude Code setup as a product, not a configuration task.
We have built 350+ products for clients including Coca-Cola, American Express, and Medtronic.
If you want Claude Code producing consistent results across your entire team, talk to our team.
Last updated on
April 10, 2026
.









