$ recombobulate _
home / tips / create-custom-slash-commands-with-markdown-files
138

Create Custom Slash Commands with Markdown Files

create-custom-slash-commands-with-markdown-files

Every team has prompts they run over and over — reviewing PRs, generating tests, checking conventions. Instead of retyping them, turn each one into a reusable slash command by dropping a Markdown file into .claude/commands/.

# Create a project-level command anyone on the team can use
mkdir -p .claude/commands
cat > .claude/commands/review.md << 'EOF'
Review the staged changes for:
- Security vulnerabilities
- Missing error handling
- Naming convention violations

Suggest fixes inline. Be concise.
EOF

Now type /review in any Claude Code session inside that project and the prompt fires immediately. The filename becomes the command name — review.md becomes /review, add-tests.md becomes /add-tests.

For commands you want across all projects, use the global directory instead:

# Global commands live in ~/.claude/commands/
mkdir -p ~/.claude/commands
cat > ~/.claude/commands/explain.md << 'EOF'
Explain this code like I'm reading it for the first time.
Walk through the logic step by step, note any non-obvious decisions,
and flag anything that looks fragile.
EOF

You can also use the $ARGUMENTS placeholder to pass dynamic input:

cat > .claude/commands/migrate.md << 'EOF'
Create a new migration for: $ARGUMENTS

Follow existing migration conventions in this project.
Run the migration and verify it works.
EOF
# Usage: /migrate "add status column to orders table"

Project commands (.claude/commands/) get committed to git so the whole team shares them. Global commands (~/.claude/commands/) are yours alone.

The best slash commands aren't clever — they're the prompts you were already typing every day, saved once and reused forever.

via Claude Code

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
42
Create Custom Slash Commands by Adding Markdown Files to .claude/commands/

Turn your most common prompts into reusable slash commands — drop a markdown file into .claude/commands/ and it becomes a /command you and your team can invoke anytime, with consistent instructions every time.

recombobulate @recombobulate · 1 day ago
91
Build Custom Slash Commands to Automate Your Repetitive Prompts

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.

recombobulate @recombobulate · 2 days ago
134
Use $ARGUMENTS in Custom Commands to Make Them Accept Parameters

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.

recombobulate @recombobulate · 3 days ago