Claude Code Slash Commands: A Working Reference

Every slash command in Claude Code, what it actually does, when to reach for it, and the small handful you'll use 80% of the time. Updated for the current CLI.

Slash commands are the fastest way to drive Claude Code from the terminal. Type / at any prompt and you get a menu of built-ins plus any custom skills you’ve installed. Most of the day-to-day stuff happens through about eight of them.

This page is a working reference: what each command does, when to reach for it, and notes from real use. Updated for the current Claude Code release.

The eight you’ll actually use

/init

Generates a CLAUDE.md at the root of the current repo, summarizing the codebase so future Claude Code sessions have project context. Run it once when you start using Claude Code on a new repo. Re-run it after big architectural changes.

/review

Performs a code review of the pending changes on your current branch. Reads the diff, checks for common bugs, suggests improvements. Best used right before you push a PR — it catches the things you stopped seeing two hours ago.

/security-review

Like /review but specifically focused on security issues — auth bugs, injection risks, secret leaks, dependency-level concerns. Worth running on any branch that touches authentication or user input handling.

/clear

Wipes conversation history. Useful when context has gotten muddy and the model is conflating an earlier task with the current one. Cheaper and faster than starting a new session.

/help

Shows the current command list. Always up to date — your starting point if you forget something.

/add-dir

Adds an additional directory to the working set. Use when your task crosses repo boundaries — e.g., a backend repo and a shared types repo.

/cost

Shows current session token + cost. Honest reality check on long agent runs.

/agents

Manages subagents — specialized agents with their own scoped tools. The advanced workflow once you’ve outgrown single-shot prompting.

Less common, still useful

/permissions

Edit which tools Claude Code is allowed to use without asking. Useful when you’re doing a lot of file edits and tired of confirming each one.

/model

Switch the active model mid-session. Drop down to a smaller model for grunt work, jump up to a bigger one for tricky refactors.

/compact

Compresses long conversation history into a summary. Less aggressive than /clear — preserves the gist while freeing context.

/mcp

Inspect connected MCP servers, list their tools, debug connections. Where you go when an MCP integration is misbehaving.

/hooks

Manage Claude Code hooks — scripts that run on specific events (file save, tool call, session end). Powerful, niche.

/config

Open the Claude Code settings UI in your terminal — keybindings, default model, theme, telemetry.

/pr

Drafts a pull request body from the current branch’s commits + diff. Pairs well with /review right before pushing.

Custom commands (skills)

Anything in your ~/.claude/skills/ or installed plugins shows up under /. The /init, /review, and /security-review built-ins are themselves skills — you can write your own with the same shape.

For how the skill system actually works, see Anatomy of a Skill. For description-writing patterns that make custom slash commands trigger reliably, see Writing skill descriptions.

Workflow combos

A few slash-command sequences worth memorizing:

Pre-PR cleanup. /review/security-review/pr. Catches bugs, catches security, drafts the PR body — all before you open the browser.

Onboarding to a new repo. /add-dir for adjacent repos → /init → ask Claude to summarize the architecture. CLAUDE.md persists for future sessions.

Long agent run going sideways. /cost to confirm you’re burning budget → /compact to reset context → re-state the goal in one sentence.

For the bigger picture of building agentic workflows in Claude Code, see Anatomy of a Skill and Build your first MCP server.