DEV Community

brian austin
brian austin

Posted on

Claude Code slash commands: the complete 2026 reference with custom commands

Claude Code slash commands: the complete 2026 reference with custom commands

Slash commands are the fastest way to control Claude Code without typing full sentences. Here's every built-in command plus how to create your own.

Built-in slash commands

Command What it does
/help Show all available commands
/clear Clear conversation history (fresh context)
/compact Compress context to save tokens
/exit or /quit Exit Claude Code
/memory View and edit CLAUDE.md memory file
/model Switch between Claude models
/permissions View current file/tool permissions
/review Request code review of current changes
/diff Show pending git changes
/commit Stage and commit with AI-generated message
/status Show current session status

The context commands you'll use daily

# You're 2 hours into a session and context is getting full
/compact
# Claude summarizes everything and continues with compressed history

# Starting fresh on a different task
/clear
# Wipes conversation but Claude still has CLAUDE.md

# Check what's changed in your codebase
/diff
# Shows git diff of all modified files
Enter fullscreen mode Exit fullscreen mode

Custom slash commands with $ARGUMENTS

This is where Claude Code gets powerful. Create .claude/commands/ in your project:

mkdir -p .claude/commands
Enter fullscreen mode Exit fullscreen mode

Then create command files:

.claude/commands/deploy.md

Deploy the application to $ARGUMENTS environment.

1. Run tests: `npm test`
2. If tests pass, build: `npm run build`
3. Deploy to $ARGUMENTS: `npm run deploy:$ARGUMENTS`
4. Verify deployment by checking health endpoint
5. Report success or rollback if health check fails
Enter fullscreen mode Exit fullscreen mode

Now you can run:

/project:deploy staging
/project:deploy production
Enter fullscreen mode Exit fullscreen mode

.claude/commands/review.md

Review the changes in $ARGUMENTS for:
1. Security vulnerabilities
2. Performance issues  
3. Missing error handling
4. Test coverage gaps
5. Documentation completeness

Provide a structured report with severity ratings.
Enter fullscreen mode Exit fullscreen mode

Usage:

/project:review src/auth/
/project:review api/payments.js
Enter fullscreen mode Exit fullscreen mode

Global custom commands (available in every project)

Global commands live in ~/.claude/commands/:

mkdir -p ~/.claude/commands
Enter fullscreen mode Exit fullscreen mode

~/.claude/commands/standup.md

Generate my standup update for $ARGUMENTS.

Look at:
- Recent git commits (last 24 hours)
- Modified files
- Any TODO comments added

Format as:
- Yesterday: [what was done]
- Today: [what's planned]
- Blockers: [any issues]

Keep it under 100 words.
Enter fullscreen mode Exit fullscreen mode
/standup today
/standup "sprint 14 week 2"
Enter fullscreen mode Exit fullscreen mode

Encoding team workflows as commands

The real power is encoding your team's specific processes:

.claude/commands/hotfix.md

Create a hotfix for $ARGUMENTS.

1. Create branch: `git checkout -b hotfix/$ARGUMENTS`
2. Identify the bug in the codebase related to $ARGUMENTS
3. Write a minimal fix (no refactoring, surgical change only)
4. Add a regression test that would have caught this bug
5. Commit with message: `hotfix: $ARGUMENTS`
6. Show diff for review before pushing
Enter fullscreen mode Exit fullscreen mode

.claude/commands/onboard.md

Onboard a new developer to $ARGUMENTS module.

1. Read all files in the $ARGUMENTS directory
2. Read related tests
3. Generate a markdown doc explaining:
   - What this module does
   - Key files and their purposes
   - How data flows through it
   - Common gotchas
   - How to run it locally

Save to docs/onboarding/$ARGUMENTS.md
Enter fullscreen mode Exit fullscreen mode

The rate limit problem

Here's the thing about custom commands: the more you use them, the more Claude Code does. And the more it does, the faster you hit rate limits.

If you're using /project:deploy, /project:review, and /standup multiple times per session, you'll see:

Claude Code: Rate limit reached. Please wait...
Enter fullscreen mode Exit fullscreen mode

The fix is ANTHROPIC_BASE_URL. Point Claude Code at a proxy that removes rate limits:

export ANTHROPIC_BASE_URL=https://simplylouie.com
export ANTHROPIC_API_KEY=your_key
Enter fullscreen mode Exit fullscreen mode

One variable. No config changes. Your custom commands keep working, rate limits disappear.

SimplyLouie runs Claude Sonnet with no rate caps for ✌️$2/month → simplylouie.com

Practical command collection

Here's a starter pack you can copy into your project:

# Create all at once
mkdir -p .claude/commands

cat > .claude/commands/test.md << 'EOF'
Run tests for $ARGUMENTS and fix any failures.
1. Run: `npm test $ARGUMENTS`
2. For each failure, read the test and the code it tests
3. Fix the implementation (not the test unless test is wrong)
4. Re-run until all pass
EOF

cat > .claude/commands/explain.md << 'EOF'
Explain how $ARGUMENTS works to a new developer.
Read all related files and write a clear explanation with:
- High-level overview
- Key functions and what they do
- Data structures used
- External dependencies
EOF

cat > .claude/commands/cleanup.md << 'EOF'
Clean up $ARGUMENTS:
1. Remove dead code
2. Fix inconsistent naming
3. Add missing error handling
4. Improve comments where unclear
5. Show diff before committing
EOF
Enter fullscreen mode Exit fullscreen mode

Now your team has:

/project:test auth
/project:explain payments/
/project:cleanup src/legacy/
Enter fullscreen mode Exit fullscreen mode

Summary

Slash commands are Claude Code's most underused feature. Built-ins handle daily operations. Custom commands encode your team's specific workflows. Once you have 5-10 project commands, onboarding new developers takes minutes instead of hours.

The only limit is rate limits — which ANTHROPIC_BASE_URL removes.


Got a useful custom command? Drop it in the comments.

Top comments (0)