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? π