Custom slash commands in Claude Code.
Every Claude Code project supports them. They live in .claude/commands/ as plain markdown files. The filename becomes the command. The file contents become the prompt.
Example:
Create .claude/commands/review.md:
Review the staged changes for:
- N+1 queries
- missing error handling
- security issues (injection, auth bypass, leaked secrets)
- tests covering the new branches
Be specific. Quote line numbers.
Now /review runs that prompt against your current context. No more pasting the same checklist into chat every time you open a PR.
Why I use it:
The prompts you reuse are the ones you've refined the most. Saving them locks in the improvements instead of typing a worse version next time.
They commit with the repo. Your team gets them automatically. A new hire inherits your best workflows on day one without anyone writing a doc.
You can pass arguments with $ARGUMENTS.
/ticket 4123 can pull context for a Linear issue and scaffold a branch off it.
The four I keep in every repo:
/review for staged diffs
/test writes tests for the file I'm in
/explain walks through unfamiliar code paths before I touch them
/migrate drafts a SQL migration plus the rollback
The benefit is that once a prompt works well, you never write it again. Neither does anyone else on your team.
Cost: zero. Setup time: about a few minutes per command.
0
0 comments
Wil Waldon
1
Custom slash commands in Claude Code.
powered by
Frontier AI Labs
skool.com/ai-and-automation-3750
A community built to master AI. Learn prompt engineering, productivity, and business strategies from a 15+ year software developer.
Build your own community
Bring people together around your passion and get paid.
Powered by