Slash command
Also called Custom command · Prompt shortcut · /command
A typed /name shortcut that runs a built-in action or expands a saved prompt, so the prompts you reuse live in the repo.
A slash command is a shortcut you type into the agent's input, /name, that either triggers a built-in action or expands into a stored prompt. Built-ins handle the harness itself: /clear to start a fresh session, /compact to trigger compaction, /init to draft an AGENTS.md, /help. Custom commands are prompt files you keep in the project; typing /review might paste a two-paragraph review checklist with the current diff attached, and the model takes it from there.
Custom commands solve the 'I keep typing the same thing' problem, and they solve it better than putting the text in a rules file. Anything in the rules file is loaded into every turn whether relevant or not, spending context on instructions the current task doesn't need. A slash command loads its text only when you call it. That makes it the right home for long, occasional prompts: the release checklist, the migration playbook, the 'write a field note about this' template.
Keep commands in the repo so the whole team gets them, give them arguments where it helps (/fix-issue 123), and let them reference files rather than inline everything. When a command needs supporting scripts or several steps, it has outgrown the format and should become a skill. A good test: if a new teammate would benefit from the shortcut on day one, commit it.
- Claude CodeCustom commands are markdown files in
.claude/commands/(project) or~/.claude/commands/(personal);$ARGUMENTSpasses whatever you typed after the name. - Most toolsSaved prompts exist under other names (rules, notepads, prompt files); the idea is the same, load a reusable prompt on demand.
“How are you getting such consistent PR descriptions out of it?”
“A slash command. /pr expands to our template plus the diff summary, so every description follows the same shape.”
“Send me the file, I'll drop it into our commands folder.”
Course 01 puts every one of these terms to work: you install Claude Code, run the loop, and ship a real project — permission modes, compaction, hooks and all.
Start Course 01 →