Create Custom Slash Commands by Adding Markdown Files to .claude/commands/
Stop typing the same multi-paragraph prompt every time you need to run a common workflow. Custom slash commands let you save prompts as markdown files and invoke them with a single /command.
# Create the commands directory in your project
mkdir -p .claude/commands
# Create a custom command
cat > .claude/commands/review.md << 'EOF'
Review the current git diff for bugs, security issues, and style violations.
Focus on logic errors and edge cases, not formatting.
Run the tests after your review to verify nothing is broken.
EOF
Now typing /project:review in Claude Code runs that exact prompt. The project: prefix means it lives in your project's .claude/commands/ directory and is shared with your team via git.
You can also create personal commands that work across all projects:
# Personal commands go in ~/.claude/commands/
mkdir -p ~/.claude/commands
cat > ~/.claude/commands/standup.md << 'EOF'
Summarize what changed in the last 24 hours:
- List commits with a one-line summary each
- Highlight any failing tests
- Note any open TODOs or FIXMEs added
EOF
Personal commands use the /user: prefix — type /user:standup from any project.
Commands can include $ARGUMENTS as a placeholder that gets replaced with whatever you type after the command name. For example, a command containing "Explain the $ARGUMENTS module in detail" lets you run /project:explain auth to explain the auth module.
One markdown file, one reusable prompt — build a library of commands and your whole team works faster.
via Claude Code
Log in to leave a comment.
Create reusable slash commands in your project so common prompts like "run tests and fix failures" or "review this file for security issues" become a single /command instead of typing the same instructions every time.
The $ARGUMENTS placeholder in custom slash command files turns a static prompt into a reusable tool — pass different values each time you invoke it, just like a function that takes arguments.
Drop a Markdown file into .claude/commands/ and it becomes a slash command — no config, no code, just a prompt in a file that your whole team can share.