Claude Code slash commands: cheat sheet and custom commands
A Claude Code slash command cheat sheet grouped by when you use them, plus how to write custom commands with skills, pass arguments, and fix ones that fail.
Claude Code has dozens of slash commands, and most people use three of them. The rest solve real problems: seeing what's filling the context window, rolling back a bad edit, reviewing a diff before you push. This cheat sheet groups the useful ones by when you'd reach for them, from Anthropic's commands reference, checked on 16 November 2026, then shows how to write your own.
Type / to see everything available, or / plus a few letters to filter. A command only counts at the start of a message; anything after it becomes its arguments.
Setting up a repository
| Command | What it does |
|---|---|
/init | Generates a starter CLAUDE.md from your codebase |
/memory | Opens CLAUDE.md and auto memory files, and toggles auto memory |
/mcp | Shows MCP servers, their status, and handles sign-in |
/permissions | Lists, adds, and removes permission rules |
/hooks | Shows configured hooks |
/agents | Points you to where subagents are defined |
/config | Opens the settings menu |
/statusline | Generates a status line script from a description |
/install-github-app | Sets up Claude Code GitHub Actions |
During a task
| Command | What it does |
|---|---|
/plan | Switches into plan mode before a large change |
/model | Changes the model |
/effort | Changes how much reasoning Claude applies |
/context | Shows what's filling the context window |
/compact [focus] | Summarizes the conversation to free space, keeping what you name |
/btw | Asks a side question without adding it to the history |
/output-style [style] | Switches response style, such as concise |
/goal [condition] | Keeps Claude working until a condition is met |
/tasks | Lists background work, including subagents |
/usage | Shows session cost, plan usage, and a usage breakdown (/cost is an alias) |
Before you ship
| Command | What it does |
|---|---|
/diff | Shows what changed |
/code-review | Reviews the current diff for bugs in a fresh context; --fix applies findings, a PR number reviews that PR (/review is an alias) |
/verify | Builds and runs the app to check the result |
Between sessions
| Command | What it does |
|---|---|
/clear | Starts fresh on a new task, keeping project memory |
/rename [name] | Names the session so you can find it later |
/resume | Returns to an earlier conversation |
/branch | Branches the conversation to try another direction |
/fork | Copies the conversation into a new background session |
/background | Detaches the session to keep running in the background |
When something goes wrong
| Command | What it does |
|---|---|
/rewind | Rolls code and conversation back to a checkpoint, or summarizes part of it |
/doctor | Diagnoses and fixes installation and configuration issues |
/debug | Diagnoses runtime issues |
/feedback | Reports a bug |
Some entries in the full list are bundled skills or workflows rather than built-in commands, for example /loop, which runs a prompt repeatedly while the session stays open. They're prompts handed to Claude, like skills you write.
Making your own commands
A custom command is a skill. Create .claude/skills/<name>/SKILL.md in the repository, and /name runs it:
---
description: Write a pull request description for the current branch.
disable-model-invocation: true
---
!`git diff main...HEAD --stat`
Write a PR description: what changed in 2 to 4 bullets, why in one
sentence, and how it was tested. Under 200 words.
disable-model-invocation: true makes it a command only you run, rather than one Claude loads on its own. Files in .claude/commands/ still work and accept the same frontmatter except name and paths, but Anthropic recommends skills for new work, because they also support supporting files and automatic loading.
Arguments. Type them after the command, such as /fix-issue 482. In the skill, $ARGUMENTS holds all arguments, $0 the first, and names declared in an arguments field work as $name. Add argument-hint: [issue-number] so autocomplete shows what to type.
More examples are in Claude Code skills: 6 examples.
When a custom command doesn't run
- Check the location:
.claude/skills/<name>/SKILL.md, or~/.claude/skills/for all your projects. - Check the frontmatter: the opening
---must be the first line, and the YAML must parse. - Restart if you just created the skills directory.
- Typed in the middle of a message? Commands only work at the start.
Where Lockstep fits
Lockstep's CLI is a command-line tool rather than a set of slash commands. npx lockstep-cli onboard sets up a repository, and from then on Claude Code is briefed at the start of each session on the team's approved decisions that apply, captured from PRDs, Slack, and pull requests. lockstep brief prints the same decisions as a copyable brief.
See how it works.
Sources checked 16 November 2026
Related reading
For every extension type, see CLAUDE.md vs skills vs hooks vs subagents. For permission rules behind /permissions, see Claude Code permissions. For /resume and moving sessions between machines, see how to resume a Claude Code session.
Frequently asked questions
- How do I see all Claude Code slash commands?
- Type / at the prompt to see every command available to you, or / followed by letters to filter. A command is only recognized at the start of a message; text after it becomes its arguments.
- How do I create a custom slash command in Claude Code?
- Write a skill: a folder at .claude/skills/<name>/ with a SKILL.md file. The folder name becomes the command, such as /pr-description. Files in .claude/commands/ still work and accept the same frontmatter fields except name and paths, but Anthropic recommends skills for new work.
- What is the difference between slash commands and skills?
- A custom slash command used to be a markdown file in .claude/commands/. Skills replace it: same command syntax, plus supporting files, automatic loading when relevant, and options like disable-model-invocation. Built-in commands such as /clear are coded into Claude Code; bundled skills like /loop are prompts handed to Claude.
- How do I pass arguments to a custom command?
- Type them after the command, such as /fix-issue 482. In the skill, $ARGUMENTS holds all of them, $0 or $ARGUMENTS[0] the first, and named arguments declared in the arguments field are available as $name.
- Why isn't my custom command working?
- Check that the file is in .claude/skills/<name>/SKILL.md or .claude/commands/, that the frontmatter's opening --- is the first line, and that the YAML parses. A newly created skills directory may need a restart to be picked up.
Keep reading