You already use built-in slash commands like /init and /model. You can
add your own. A custom slash command is just a prompt you type often, saved
to a file so you can fire it with a few keystrokes instead of retyping it.
A custom command is a markdown file. Drop it in one of two places:
| Location | Scope |
|---|---|
.claude/commands/<name>.md | Project - shared with anyone who clones the repo |
~/.claude/commands/<name>.md | User - available in every project you open |
The file name becomes the command name. .claude/commands/review.md gives
you /review in the console.
There is no special language here. Whatever you write in the body is the
prompt Claude receives when you run the command. A review.md might contain:
Review the staged changes with `git diff --staged` and flag any bugs,
missing error handling, or secrets that would be risky to commit.
Now typing /review sends exactly that prompt.
Use $ARGUMENTS and whatever you type after the command name gets
substituted in. A fix.md containing:
Find and fix the bug described here: $ARGUMENTS
lets you run /fix the login form rejects valid emails, and that text lands
where $ARGUMENTS sits.
A YAML frontmatter block at the top can set a description (shown in the
command list) and allowed-tools (which tools the command may use):
---
description: Review staged git changes
allowed-tools: Bash(git diff:*)
---
Review the staged changes and flag issues.
Frontmatter is optional. A plain body with no frontmatter works fine.
Next, write your own command and confirm the file lands in the right place.
Your lab setup
This VM comes with Claude Code preinstalled and signed in - just run claude to start.