Every Claude Code Slash Command, Explained: /usage to /agents

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.

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 /compact and /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.

CommandWhat it doesWhen to use it
/clearClear the conversation history, keep CLAUDE.mdTask done, starting a new one
/compactCompress the current session to a summary and continueContext is filling up but you’re not done
/compact focus on edited files and todosCompact with guidanceTell it what to preserve
/resumeList resumable sessionsYou closed the terminal and want to pick up
/exportExport the current conversation to a file or clipboardArchive, share with a teammate, write a retro
/statusShow account, model, version, working directoryDiagnose “wrong account / wrong version”
/contextShow what’s filling the context windowSee 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

CommandWhat it doesWhen to use it
/usagePlan usage (Pro / Max / Team), remaining quota, next reset”How many Opus runs do I have left this month?”
/costToken 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

CommandWhat it does
/initCreate or update CLAUDE.md in the current project root
/memoryOpen 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

CommandWhat it doesWhen to use it
/configOpen the Claude Code settings panelTheme, font, auto-accept, notifications
/modelSwitch the primary modelOpus / Sonnet / Haiku; on macOS Option + P also works
/vimEnable vim mode in the input boxIf you live in vim and edit long prompts
/terminal-setupHave Claude Code configure terminal keybindings for youWhen Shift + Enter won’t insert newlines
/add-dirTemporarily add another directory to the session’s working rootsCross-repo edits, pulling in a scripts folder
/permissionsView / edit permission rules (which Bash commands, which paths)Tighten or loosen a tool rule
/privacy-settingsOpen privacy settingsTurn 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

CommandWhat it does
/reviewReview a PR or the current diff
/security-reviewReview 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.

CommandWhat it doesWhen to use it
/agentsManage subagents (create, delete, list)When “code review” or “test writing” should be its own persona
/hooksConfigure hooks (PreToolUse / PostToolUse / SessionStart, etc.)Automate “lint before every command”, “open README at session start”
/mcpManage 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

CommandWhat it does
/loginSign in or switch accounts
/logoutSign out of the current account
/upgradeOpen 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

CommandWhat it doesWhen to use it
/helpShow the help menuLook up commands and docs links
/doctorRun an environment health checkFirst thing after installing; first thing when something is weird
/bugFile a bug reportReproducible bug you want Anthropic to see
/release-notesView recent release notesAfter 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

CommandWhat it does
/ideConnect Claude Code to the open VS Code / JetBrains instance
/install-github-appInstall the Claude GitHub App so Claude can respond on PRs
/pr_commentsView 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:

  1. /clear — clean slate before switching tasks.
  2. /compact <hint> — targeted compact when context is tight.
  3. /resume — pick up after walking away.
  4. /usage or /cost — keep dollar / quota awareness.
  5. /init — first move in a new repo.
  6. /model — Opus for hard tasks, Haiku for trivial lookups.
  7. /permissions — allowlist your common Bash, stop the confirm spam.
  8. /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”? — /usage directly.
  • Still freezing when the context bar maxes out? — /compact with a specific hint.
  • Still confirming every npm test? — /permissions allowlist.
  • Still pasting PR comments back into the terminal? — /pr_comments reads them in.

Common mistakes

  • Mixing up /clear and /compact: /clear wipes and restarts; /compact summarizes and continues. Reverse them and you lose context or run out of room.
  • Running /compact without 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.
  • /login switched accounts but /status still shows the old one: open a fresh terminal session.
  • /doctor reports two claude binaries in PATH: run which -a claude in 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.

Tags: #Claude #Claude Code #Tutorial