Lesson 4 · 6 min
Slash Commands
Reusable named workflows the user invokes with /name.
Slash commands are markdown files in .claude/commands/. The body becomes a prompt the model executes. They're the right shape for "do this same multi-step thing again" — code reviews, releases, audits.
Production scenario
Real-world example: /release at a small SaaS
Cutting a release used to be a 12-step checklist. The team committed a slash command:
# .claude/commands/release.md
Run the full release sequence:
1. Confirm `main` is green on CI.
2. Run `npm test` locally; abort if any failure.
3. Bump the patch version in `package.json` and `marketplace.json`.
4. Commit "release: vX.Y.Z" using a HEREDOC.
5. Tag `vX.Y.Z` and push tags.
6. Draft GitHub release notes from the commits since the last tag.
7. Post to #releases on Slack.
Stop and ask before pushing if anything looks off.Anyone on the team types /release and the agent handles the choreography. The institutional knowledge lives in version control.
Why this matters: if you'd type a multi-step prompt more than twice, make it a slash command. The team gets it for free.
Knowledge points in this lesson
- Slash commands live in .claude/commands/
- Markdown body becomes the prompt
- User-invoked: type /name to run
- Imperative — "do this thing now"
- Commit commands to share workflows
Quick check
Claude CodeSelect one
What's the primary purpose of a Claude Code skill?
