What this covers
A complete reference to every built-in Claude Code slash command: session lifecycle, usage and cost, configuration, subagent / hook / MCP extensions, diagnostics, and IDE / git integrations.
Key tools and concepts:
- Claude Code: Anthropic’s command-line AI coding agent.
- Slash commands: type
/at the start of the input to open the available command menu. - Skill / Subagent / Hook / MCP: the four mechanisms for extending Claude Code’s behavior.
Who this is for
People who’ve used Claude Code for a few days, know /init and /clear, and want to figure out what the rest of that long menu actually does. If you haven’t installed it yet, read the Claude Code Beginner Guide first.
When to reach for it
- You ran out of tokens and need to tell whether this session is heavy or your monthly plan is capped.
- Context is full and you have to choose between
/compactand/clear. - You want to configure subagents / hooks / MCP for your team but can’t find the entry points.
- A fresh install is stuck on login, IDE, or PATH and you need a diagnostic.
Before you start
- Inside a session, type
/and skim what’s actually available — versions and plugins each add or remove a few. - This article uses the latest stable release as a baseline. If a command doesn’t show up for you, your version is likely older or missing a plugin.
- Distinguish commands from skills: commands are built into Claude Code (core), skills are on-demand workflows (see the Claude Code Skills Guide).
Session lifecycle
This group manages the start, pause, and recycling of a single conversation. Used most often.
| Command | What it does | When to use it |
|---|---|---|
/clear | Clear the conversation history, keep CLAUDE.md | Task done, starting a new one |
/compact | Compress the current session to a summary and continue | Context is filling up but you’re not done |
/compact focus on edited files and todos | Compact with guidance | Tell it what to preserve |
/resume | List resumable sessions | You closed the terminal and want to pick up |
/export | Export the current conversation to a file or clipboard | Archive, share with a teammate, write a retro |
/status | Show account, model, version, working directory | Diagnose “wrong account / wrong version” |
/context | Show what’s filling the context window | See who’s eating tokens before you /compact |
A /compact with a prompt is what experienced users always do. An empty compact preserves small talk; a targeted compact preserves “edited files, key decisions, remaining todos.”
Usage and cost
| Command | What it does | When to use it |
|---|---|---|
/usage | Plan usage (Pro / Max / Team), remaining quota, next reset | ”How many Opus runs do I have left this month?” |
/cost | Token usage and accumulated USD cost (API-billed) | API key mode; want to know what a task cost |
/usage is for subscription accounts (rate-limited windows); /cost is for API key users (tokens and dollars). They don’t conflict — it depends on how you’re logged in.
Project memory and initialization
| Command | What it does |
|---|---|
/init | Create or update CLAUDE.md in the current project root |
/memory | Open the memory editor with project / user scope |
Run /init once per project — after that, edit via /memory or directly in CLAUDE.md. Typing # at the start of the input also quickly appends a memory line.
Configuration and model
| Command | What it does | When to use it |
|---|---|---|
/config | Open the Claude Code settings panel | Theme, font, auto-accept, notifications |
/model | Switch the primary model | Opus / Sonnet / Haiku; on macOS Option + P also works |
/vim | Enable vim mode in the input box | If you live in vim and edit long prompts |
/terminal-setup | Have Claude Code configure terminal keybindings for you | When Shift + Enter won’t insert newlines |
/add-dir | Temporarily add another directory to the session’s working roots | Cross-repo edits, pulling in a scripts folder |
/permissions | View / edit permission rules (which Bash commands, which paths) | Tighten or loosen a tool rule |
/privacy-settings | Open privacy settings | Turn off training data sharing, adjust retention |
/permissions is the most-overlooked command. Every time someone complains “Claude keeps asking me to confirm npm install,” the fix is adding Bash(npm install) to the allow list.
Built-in review workflows
| Command | What it does |
|---|---|
/review | Review a PR or the current diff |
/security-review | Review the current branch from a security angle |
Both are Anthropic-maintained, ship out of the box, and aren’t skills or hooks. Pass a PR number or URL after the command when reviewing a remote PR.
Extension systems: subagent / hook / MCP
These three are the core of Claude Code’s extensibility. Each is an entry point into a subsystem — the menus behind them are their own universes.
| Command | What it does | When to use it |
|---|---|---|
/agents | Manage subagents (create, delete, list) | When “code review” or “test writing” should be its own persona |
/hooks | Configure hooks (PreToolUse / PostToolUse / SessionStart, etc.) | Automate “lint before every command”, “open README at session start” |
/mcp | Manage MCP servers (connect, authenticate, list tools) | Wire in Linear, Slack, Notion, your own database |
The mental model: a subagent is “a different brain,” a hook is “a different reflex,” an MCP is “a different external world.” They compose well — e.g., a PreToolUse hook that calls an MCP tool to validate inputs.
Account and upgrade
| Command | What it does |
|---|---|
/login | Sign in or switch accounts |
/logout | Sign out of the current account |
/upgrade | Open the upgrade page (Pro / Max / Team) |
For multi-account users, the common pain is not knowing which account is active — /status first; if wrong, /login.
Help and diagnostics
| Command | What it does | When to use it |
|---|---|---|
/help | Show the help menu | Look up commands and docs links |
/doctor | Run an environment health check | First thing after installing; first thing when something is weird |
/bug | File a bug report | Reproducible bug you want Anthropic to see |
/release-notes | View recent release notes | After upgrading, to see what’s new |
In /doctor output, pay attention to: CLI version, Node version, which claude is in PATH, account status, network reachability. Wrong version installed, PATH ordering, corporate proxy blocking — /doctor surfaces all of them in one shot.
IDE and git integration
| Command | What it does |
|---|---|
/ide | Connect Claude Code to the open VS Code / JetBrains instance |
/install-github-app | Install the Claude GitHub App so Claude can respond on PRs |
/pr_comments | View comments on the current PR |
After /ide runs once, your IDE shows a Claude Code panel and diffs render directly in the editor — a much better experience than a pure terminal.
Custom commands and skills
You’re not limited to built-ins. Claude Code supports:
- Custom slash commands: drop a prompt template in
.claude/commands/<name>.md(project) or~/.claude/commands/(user). Type/<name>to run it. - Skills: write a full workflow (with scripts, reference docs) in
.claude/skills/<name>/SKILL.md. Invoke with/<name>. - Plugins: bundle a set of commands / skills / agents / hooks as a plugin and manage via
/plugin-style commands.
When to choose custom command vs skill: one prompt with no attached docs → custom command. A multi-step workflow with reference files and team alignment → skill. See the Claude Code Skills Guide for the full comparison.
Drill: build muscle memory
Ranked by how often you’ll reach for them — the first eight cover ~80% of daily use:
/clear— clean slate before switching tasks./compact <hint>— targeted compact when context is tight./resume— pick up after walking away./usageor/cost— keep dollar / quota awareness./init— first move in a new repo./model— Opus for hard tasks, Haiku for trivial lookups./permissions— allowlist your common Bash, stop the confirm spam./doctor— first stop when something feels off.
One tier down: open the menus for /agents, /hooks, /mcp once each so you know where they live. Configure them properly when you actually need them.
Quality check
- Still clicking into settings to “see how much you’ve used”? —
/usagedirectly. - Still freezing when the context bar maxes out? —
/compactwith a specific hint. - Still confirming every
npm test? —/permissionsallowlist. - Still pasting PR comments back into the terminal? —
/pr_commentsreads them in.
Common mistakes
- Mixing up
/clearand/compact:/clearwipes and restarts;/compactsummarizes and continues. Reverse them and you lose context or run out of room. - Running
/compactwithout a hint and losing the “edited files” list — make/compact <what to keep>a habit. - Over-permissive
/permissions, e.g., allowing all Bash — don’t, unless inside an isolated worktree. /loginswitched accounts but/statusstill shows the old one: open a fresh terminal session./doctorreports twoclaudebinaries in PATH: runwhich -a claudein a shell to confirm which one is actually executing.- Confusing built-in commands with skills: built-ins are version-locked and can’t be disabled; skills are mounted on demand and can differ across team members.
FAQ
Q: What’s the difference between /clear and /compact?
A: /clear wipes the conversation entirely; /compact summarizes it and keeps the gist in context. Use /compact when you want to keep going on a long task without paying the full token cost. Use /clear when you’re starting unrelated work.
Q: How do I check my Claude Code usage and cost mid-session?
A: Type /usage for the current session’s token spend, and /status for account-level information. Both honor the active login — if /status shows the wrong account, open a fresh terminal.
Q: Are slash commands the same as skills?
A: No. Built-in slash commands are version-locked and ship with Claude Code. Skills are mounted on demand from .claude/skills/ and can be customized or differ across team members. Both appear in the / menu but their lifecycle is different.
Q: How do I figure out which binary is running when /doctor flags a conflict?
A: Run which -a claude in a regular shell to list every claude on your PATH. Usually the offender is a stale npm-global install shadowing a newer install.
Related
- Every Claude Code Keyboard Shortcut, Explained
- Claude Code Beginner Guide
- Claude Code Skills Guide
- Claude Code Workflow
Tags: #Claude #Claude Code #Tutorial