🔥 The Complete Guide to Slash Commands in Claude Code: 5 Built-In + 5 You Should Build Yourself
Slash commands are Claude Code's secret weapon.
But here's what most developers miss: you can create your own.
Let me show you both sides of this productivity powerhouse.
⚡ 5 BUILT-IN COMMANDS YOU NEED TO KNOW
/compact — Summarize your conversation to free up context tokens without losing progress.
/init — Generate a CLAUDE.md file that teaches Claude your entire project structure.
/memory — Edit persistent project knowledge that Claude remembers across sessions.
/review — Get instant professional code review on your staged changes.
/model — Switch between Sonnet (speed) and Opus (power) mid-conversation.
🛠️ 5 CUSTOM COMMANDS YOU SHOULD BUILD
Create these in .claude/commands/ as markdown files:
1️⃣ /project:deploy
markdown<!-- deploy.md -->
Run our deployment checklist:
1. Run all tests
2. Check for console.logs
3. Verify environment variables
4. Build production bundle
5. Generate deployment summary
Why: One command, zero forgotten steps.
2️⃣ /project:component
markdown<!-- component.md -->
Create a new React component with:
- TypeScript interface
- Styled-components file
- Unit test file
- Storybook story
Follow our naming conventions in CLAUDE.md
Why: Consistent scaffolding every single time.
3️⃣ /project:security
markdown<!-- security.md -->
Audit this code for:
- SQL injection vulnerabilities
- XSS risks
- Exposed secrets
- Insecure dependencies
- Authentication gaps
Provide severity ratings and fixes.
Why: Your personal security consultant on demand.
4️⃣ /project:document
markdown<!-- document.md -->
Generate documentation for $ARGUMENTS:
- JSDoc comments
- README section
- API endpoint description
- Usage examples
Match our documentation style guide.
Why: Documentation that actually gets written.
5️⃣ /project:hotfix
markdown<!-- hotfix.md -->
Emergency fix protocol:
1. Identify root cause
2. Implement minimal fix
3. Add regression test
4. Create detailed commit message
5. List potential side effects
Keep changes surgical and reversible.
```
*Why:* Stay calm under pressure with a structured approach.
---
### **🎯 HOW TO CREATE YOUR OWN**
```
your-project/
└── .claude/
└── commands/
├── deploy.md
├── component.md
├── security.md
├── document.md
└── hotfix.md
Each .md file becomes a /project:filename command.
Use $ARGUMENTS to pass dynamic input.
The bottom line:
Built-in commands make you faster.
Custom commands make you unstoppable.
Your workflow. Your rules. Your commands.
What custom slash command would transform YOUR daily coding? 👇
6
2 comments
Frank van Bokhorst
5
🔥 The Complete Guide to Slash Commands in Claude Code: 5 Built-In + 5 You Should Build Yourself
AI Bits and Pieces
skool.com/ai-bits-and-pieces
Build real-world AI fluency to confidently learn & apply Artificial Intelligence while navigating the common quirks and growing pains of people + AI.
Leaderboard (30-day)
Powered by