Slash Commands

Slash commands are reusable prompt shortcuts you type with a leading /. Claude Code ships ~25 built-ins for the common workflows. You can write your own as one-file markdown templates dropped into ~/.claude/commands/. This page lists every built-in, shows the file format, and gives you a starter library worth installing immediately.

On this page

1. Built-in commands

Type /help in Claude Code to see the live list. The headliners:

CommandDoes
/initScan the repo and write a CLAUDE.md. Run on day one in any new project.
/reviewCategorized review of the current branch's diff (or /review 123 for a PR).
/security-reviewOWASP-style sweep of the diff — injection, auth, secrets, unsafe parsers.
/verifyActually run the app and exercise the change, not just npm test.
/simplifyLook for duplication, dead code, premature abstraction in the diff, fix what's worth fixing.
/runLaunch the project's app (CLI / server / browser) and confirm a change works.
/ultrareviewMulti-agent cloud review (correctness, security, design, perf, tests). User-triggered, billed.

2. Workflow built-ins

CommandDoes
/scheduleCreate / list / run cron-style remote agents. "Check open PRs every morning at 9am."
/loop <interval> <cmd>Repeat a command on an interval inside the current session. Omit interval to let Claude self-pace.
/babysit-prsWatch your open PRs, post nudges, draft replies. Pairs with /loop 5m.
/standupDraft a status update from recent git activity + Linear tickets.
/remember <fact>Add to your memory file. Use sparingly — better to update CLAUDE.md.

3. Meta / management

CommandDoes
/helpLive list of every command + skill currently loaded.
/skills listShow loaded skills with their descriptions.
/mcp listShow connected MCP servers + tool counts.
/plugin listInstalled plugins.
/configOpen settings.json in $EDITOR.
/clearDrop conversation history (keep the session).
/compactManually compact the conversation (the system also does it automatically when context fills).
/costShow token usage and rough cost for the current session.
/login / /logoutManage authentication.
/modelSwitch the active model mid-session.
/fastToggle fast-mode on Opus 4.6+.
/feedbackReport an issue to Anthropic.

4. Custom command file format

A custom command is a single markdown file with optional YAML frontmatter. Filename = command name.

# ~/.claude/commands/standup.md
---
description: Draft a daily standup from recent git activity.
allowed-tools:
  - Bash
  - Read
---

Run git log --since=yesterday --author=$(git config user.email)
and turn each commit into a one-line bullet.

Group by repo if multiple. Add a "Today" section
asking me what I'll work on. Keep under 8 bullets total.

That's it. Save the file, restart the session, type /standup.

5. Arguments & templating

Pass arguments after the command. They're available as $ARGUMENTS in the body:

# ~/.claude/commands/explain.md
---
description: Explain a file or symbol like I'm a smart-but-new engineer.
---

Explain the following in 5 short paragraphs:

$ARGUMENTS

Cover: what it does, how it fits the codebase, the invariants
it enforces, common ways callers misuse it, and any gotchas.
# usage
/explain src/auth/sessions.ts
/explain "the resolveTunnel function"

You can also reference files with @-mentions inline — Claude will read them when the command runs.

6. User vs project scope

ScopePathBest for
User~/.claude/commands/*.mdYour personal toolbox (/standup, /explain).
Project.claude/commands/*.md (in the repo)Team-shared shortcuts (/deploy, /runbook-on-call).

If the same name exists in both, project scope wins.

7. Starter library (steal these)

/commit — Conventional-commit message from staged diff

---
description: Draft a conventional-commit message from the staged diff.
allowed-tools: [Bash]
---

Read git diff --cached and the last 10 commit messages
(git log -10 --pretty=%s). Classify the change into
feat/fix/refactor/docs/test/chore/perf/style/build/ci.
Pick a scope from the changed paths. Write a subject <60 chars,
imperative mood, no trailing period.

Output ONLY the message in a code block. Do NOT run git commit.

/explain-error — Decode a stack trace

---
description: Explain an error/stack trace and propose the fix.
---

Given this error:

$ARGUMENTS

1. Identify the root frame.
2. Open the relevant file and read the surrounding context.
3. Explain in plain English what triggered it.
4. Propose the smallest diff that fixes it.

/runbook — Pull up an on-call runbook

---
description: Open the team runbook for the given service / alert.
allowed-tools: [Read, Grep]
---

Search docs/runbooks/ for a runbook matching:

$ARGUMENTS

If found, paste the "First 5 minutes" and "Common causes" sections.
If not, ask which service the alert is for.

/why-is-ci-failing

---
description: Diagnose the latest failing CI run on the current branch.
allowed-tools: [Bash]
---

Run gh run list --branch $(git branch --show-current) -L 1 --json status,conclusion,databaseId.
If conclusion is failure, fetch logs with gh run view --log-failed.
Summarize the actual error (skip framework noise) and propose the fix.

/ship — End-of-day ship checklist

---
description: Pre-merge sanity sweep.
allowed-tools: [Bash, Read]
---

Verify before I open a PR:

1. git status is clean except intended files.
2. Tests pass: run the project's test command.
3. Typecheck passes.
4. No console.log / debugger / TODO-for-me-later in the diff.
5. CHANGELOG.md updated if there's a user-visible change.
6. New env vars also added to .env.example.

Report the punch list — done vs missing.

8. Pro tips