πŸ”₯ 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? πŸ‘‡
1
0 comments
Frank van Bokhorst
4
πŸ”₯ The Complete Guide to Slash Commands in Claude Code: 5 Built-In + 5 You Should Build Yourself
Legal Launchpad for AIpreneurs
skool.com/legal-launchpad
Legal protection system for AI entrepreneurs. Access free workshops, Q&A, and audits.
Leaderboard (30-day)
Powered by