5 Claude Code Slash Commands I Wish I Knew Sooner
Photo by Mohammad Rahmani on Unsplash
I've been using Claude Code daily for months. And honestly, for the first few weeks, I was using it like a chatbot with file access -- typing everything out, manually managing context, losing track of changes.
Then I discovered these slash commands. Some of them completely changed how I work. Here are the 5 that made the biggest difference.
/rewind
Game ChangerThis is the command I use most. Claude Code auto-creates checkpoints on every prompt. /rewind lets you roll back to any of them.
The genius part: you can choose what to rewind.
/rewind
# Or just press Esc twice to open the rewind menu
Esc Esc
The rewind menu shows you a timeline of checkpoints. You can:
- Rewind conversation only -- keep the code, redo the conversation
- Rewind code only -- keep the conversation context, undo file changes
- Rewind both -- full reset to a previous state
git reset for your entire AI coding session./rewind./batch
Multi-AgentThis command spawns multiple AI agents in parallel, each working in an isolated git worktree. It's the most powerful command in Claude Code and most people have never tried it.
/batch migrate src/ from Solid to React
# Add error handling to all API endpoints
/batch add proper error handling to all route handlers in src/api/
# Update all test files to use the new testing library
/batch migrate all tests from Jest to Vitest
Here's what happens under the hood:
- Claude researches your repo to understand the scope
- Decomposes the work into 5-30 independent units
- Shows you the plan for approval
- Spawns one agent per unit in an isolated git worktree
- Each agent implements, tests, and opens a PR
Photo by Patrick Martin on Unsplash
/fork
Want to try a risky approach without losing your current progress? /fork creates a copy of your conversation that you can experiment with freely.
/fork refactor-attempt
# Try a different architecture approach
/fork try-redux-instead
# Experiment with a breaking change
/fork drop-legacy-support
The original conversation stays untouched. If the experiment fails, just go back to the original. If it succeeds, continue in the fork.
/fork, trying something risky meant potentially wasting your entire conversation context. Now you can explore freely./resume later, you'll see all your forks listed by name./compact
Claude Code auto-compacts at 95% context capacity. But the manual /compact is way more powerful because you tell it what to keep.
/compact
# Keep specific context
/compact focus on the auth module changes
# Preserve error context
/compact keep all error messages and stack traces
# Check context usage first
/context
Use /context first to see a visual grid of how your context window is being used. Then compact strategically.
CLAUDE.md file using # prefix. CLAUDE.md persists across compactions and even new sessions./simplify
3 AgentsThis command spawns three review agents in parallel that each check your recently changed code for different issues:
- Agent 1: Code reuse -- are you duplicating logic that already exists?
- Agent 2: Code quality -- naming, structure, readability
- Agent 3: Efficiency -- performance, unnecessary complexity
/simplify
# Focus the review
/simplify focus on memory efficiency
# Review specific area
/simplify check the new API handlers
After the review, it doesn't just report issues -- it automatically applies fixes. You review the changes and accept or rewind.
utils/ that does the same thing."Photo by Xavier Foucrier on Unsplash
Bonus: Quick Reference
Here are more commands worth knowing, organized by what you're trying to do:
| Task | Command | What It Does |
|---|---|---|
| Undo changes | /rewind | Roll back code and/or conversation |
| Bulk edits | /batch | Parallel multi-agent file changes |
| Experiment safely | /fork | Branch conversation |
| Free up context | /compact | Compress with targeted retention |
| Code review | /simplify | 3-agent quality review + auto-fix |
| Security audit | /security-review | Scan for vulnerabilities |
| Set intensity | /effort max | Deep thinking for hard problems |
| Switch model | /model opus | Use Opus for complex tasks |
| PR review | /review 123 | Multi-agent PR review |
| Track progress | /cost | Show token usage and cost |
| Mode toggle | Shift+Tab | Cycle: Normal / Auto-Accept / Plan |
| Multi-line input | Ctrl+G | Open multi-line editor |
The Workflow That Works
After months of daily use, here's the workflow I've settled on:
- Start a session and describe what I'm building
- Use
/effort highfor the initial architecture discussion - Fork when I want to try different approaches
- Implement in the best fork, rewind if needed
- Run
/simplifybefore committing - Compact strategically when context gets heavy
- Use
/batchfor cross-cutting changes
The key insight: these commands compose. Fork to experiment, rewind when it fails, simplify when it works, compact to keep going. Each command makes the others more useful.
Already Using Claude Code?
Try /rewind and /fork in your next session. Once you experience the safety net of checkpoints, you'll code more boldly. That's the point.
Found this useful? Share it with a developer friend who uses Claude Code. And drop a comment if you have a favorite slash command I missed.
No comments: