5 Claude Code Slash Commands I Wish I Knew Sooner

Developer terminal with dark theme displaying code

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.

1

/rewind

Game Changer
Undo Everything -- Code, Conversation, or Both

This 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 both conversation and code changes
/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
Why it matters: Before this, if Claude went down the wrong path, your only option was starting over. Now you can branch, experiment, and safely undo. It's like git reset for your entire AI coding session.
Pro tip: Use Esc Esc (double-tap Escape) -- it's faster than typing /rewind.
2

/batch

Multi-Agent
Parallel Bulk Edits Across Your Entire Codebase

This 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.

# Migrate an entire directory from one framework to another
/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:

  1. Claude researches your repo to understand the scope
  2. Decomposes the work into 5-30 independent units
  3. Shows you the plan for approval
  4. Spawns one agent per unit in an isolated git worktree
  5. Each agent implements, tests, and opens a PR
Why it matters: Tasks that would take you a full day -- like migrating a framework across 50 files -- can be done in minutes with parallel agents. Each works independently so they don't conflict.
Close-up of code displayed on a terminal screen

Photo by Patrick Martin on Unsplash

3

/fork

Branch Your Conversation Like a Git Branch

Want to try a risky approach without losing your current progress? /fork creates a copy of your conversation that you can experiment with freely.

# Create a named fork
/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.

Why it matters: It removes the fear of experimenting. Before /fork, trying something risky meant potentially wasting your entire conversation context. Now you can explore freely.
Pro tip: Name your forks descriptively. When you /resume later, you'll see all your forks listed by name.
4

/compact

Compress Context Without Losing What Matters

Claude Code auto-compacts at 95% context capacity. But the manual /compact is way more powerful because you tell it what to keep.

# Basic compact
/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.

Why it matters: Long sessions degrade in quality as context fills up. Strategic compaction keeps Claude sharp on what matters. The difference between a generic compact and a targeted one is like the difference between "clear my desk" and "clear my desk but keep the architecture diagrams."
Pro tip: Before compacting, write critical decisions to your CLAUDE.md file using # prefix. CLAUDE.md persists across compactions and even new sessions.
5

/simplify

3 Agents
Automated Code Review with Three Parallel Agents

This command spawns three review agents in parallel that each check your recently changed code for different issues:

  1. Agent 1: Code reuse -- are you duplicating logic that already exists?
  2. Agent 2: Code quality -- naming, structure, readability
  3. Agent 3: Efficiency -- performance, unnecessary complexity
# Review all recent changes
/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.

Why it matters: It's like having three senior engineers review your PR simultaneously. And unlike a human review, it catches things like "you wrote this helper, but there's already a utility function in utils/ that does the same thing."
Clean developer desk setup with dual monitors

Photo by Xavier Foucrier on Unsplash

Bonus: Quick Reference

Here are more commands worth knowing, organized by what you're trying to do:

TaskCommandWhat It Does
Undo changes/rewindRoll back code and/or conversation
Bulk edits/batchParallel multi-agent file changes
Experiment safely/forkBranch conversation
Free up context/compactCompress with targeted retention
Code review/simplify3-agent quality review + auto-fix
Security audit/security-reviewScan for vulnerabilities
Set intensity/effort maxDeep thinking for hard problems
Switch model/model opusUse Opus for complex tasks
PR review/review 123Multi-agent PR review
Track progress/costShow token usage and cost
Mode toggleShift+TabCycle: Normal / Auto-Accept / Plan
Multi-line inputCtrl+GOpen multi-line editor

The Workflow That Works

After months of daily use, here's the workflow I've settled on:

  1. Start a session and describe what I'm building
  2. Use /effort high for the initial architecture discussion
  3. Fork when I want to try different approaches
  4. Implement in the best fork, rewind if needed
  5. Run /simplify before committing
  6. Compact strategically when context gets heavy
  7. Use /batch for 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: