Claude CodeClaude Code 2.1 · terminal and VS Code · macOS, Linux, Windows
Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
32 small wins to finish your pathNext lesson →

Custom slash commands

A custom slash command is a markdown file that Claude Code turns into a command, using its name as the trigger and its body as the prompt.

Last updated: 28 Sep, 2026 · Claude Code

A prompt you retype every week should be a word with a slash in front of it.

Drop a markdown file into .claude/commands/ and its name becomes a command. The body is the prompt.

markdown
Look for silent data loss in this project.

Check every place a value is written to a store or a file and answer one
question: can this overwrite something that already exists without warning?

Report each risk as file, function, and one sentence. Do not fix anything.
bash
/bug-hunt

It runs that prompt in this project, with everything it already knows about the code.

A command needs no syntax beyond markdown, and the file is committed with the project, so the command exists for everybody who clones it.

When to write a command

  • Prompts you keep rewriting. The review you always ask for, the report you always want.
  • Prompts that took a while to get right. Wording that works is worth keeping.
  • Team conventions. Everyone asking the same question the same way gets comparable answers.

They are skills now

Worth knowing before you read anything older: custom commands and skills have been merged. A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both give you /deploy and behave the same way. Existing command files keep working.

The difference is what the fuller form gives you: a description Claude can route on, supporting files, tool restrictions, and control over whether Claude may invoke it without being asked. That is the next lesson.

The commands that come with it

Your own commands sit next to a set that ships with Claude Code. Much of what Claude Code does is reached through one of them, so here they are in one place.

CommandWhat it doesCovered in
/helpLists the commands available
/initWrites a starting CLAUDE.md for the projectThe CLAUDE.md lesson
/memoryOpens your CLAUDE.md files, and turns auto memory on or offThe memory lesson
/contextShows what is using the context windowContext and compaction
/compactSummarises the conversation now, optionally with a focusContext and compaction
/clearStarts a new conversation with an empty context
/resumeGoes back to an earlier conversationThe sessions lesson
/rewindRolls the code, the conversation or both back to a checkpointRewind and checkpoints
/planEnters plan mode from the promptThe plan mode lesson
/permissionsShows and edits allow, ask and deny rulesThe settings.json lesson
/hooksShows the hooks loaded for this sessionThe hooks lesson
/mcpAdds, removes and reconnects MCP serversThe MCP lesson
/modelSwitches the modelModels and cost
/usageShows tokens used and estimated costModels and cost
/diffShows the changes in your working tree, including Claude's edits
/btwAsks a side question without adding it to the conversation
/doctorChecks your setup and can fix what it finds
/ideConnects a session in an outside terminal to VS Code

/clear is the one people reach for too late. When you move on to an unrelated task, a fresh conversation beats a compacted one, because nothing from the old task is left competing for the window.

Seeing what exists
Type / in a session to see everything available: built-in commands, the bundled skills like /doctor and /code-review, and anything you or your project has added. In VS Code, the / menu has a Slash commands entry under Customize that lists them with a filter box.
Try it yourself
  • Write a command for the question you asked twice this week.
  • Run /doctor and read what it checks.
PreviousMemory

You understood something today that you didn't yesterday.