A slash command is just a Markdown file. The file name becomes the command name.
1. Create the folder
Project-level (shared with your repo):
mkdir .claude\commands
Or user-level (available in every project): use ~/.claude/commands.
2. Add a command file
Create .claude\commands\review.md. The filename review.md makes the command /review:
Review the current git diff for bugs and risky changes.
Focus on correctness. Be concise. $ARGUMENTS
$ARGUMENTS is replaced by anything you type after the command.
3. Run it
In Claude Code:
/review only the auth module
That runs your prompt with only the auth module substituted into $ARGUMENTS.
Tips
- Subfolders namespace commands:
.claude/commands/git/sync.md→/git:sync. - Keep each command focused on one job.
- Next: install an MCP server.