
Claude Code: how to use custom slash commands for your project
Claude Code: how to use custom slash commands for your project Claude Code ships with built-in slash commands like /compact , /clear , and /review . But the real power is in custom project commands — your own shortcuts baked into the codebase. Here's how to build them and why they're worth setting up. What are custom slash commands? A custom slash command is a markdown file in .claude/commands/ that Claude reads as a reusable prompt template. When you type /project:migrate-db , Claude reads the file, substitutes any arguments, and runs the full instruction. Think of them as shell aliases, but for AI prompts. The file structure your-project/ ├── .claude/ │ └── commands/ │ ├── migrate-db.md │ ├── review-pr.md │ └── add-test.md └── src/ Each .md file becomes /project:filename . Example 1: database migration helper Create .claude/commands/migrate-db.md : Create a database migration for the following change: $ARGUMENTS Requirements: - Use the existing migration format in /db/migrations/ - I
Continue reading on Dev.to
Opens in a new tab

.png&w=1200&q=75)