Claude Code Slash Commands You Should Know in 2025

The most useful Claude Code slash commands include /init (generates a CLAUDE.md project memory file), /compact (compresses long conversation context without losing thread), /btw (adds a side note mid-task without interrupting the current workflow), /loop (runs Claude in a continuous task cycle), and /schedule (queues tasks to run at specific times or triggers). Each one serves a distinct purpose, and knowing when to reach for each is the difference between using Claude Code as a smarter chat window and running it as a fully autonomous development system in your terminal.
Which Claude Code Slash Commands Do Developers Actually Use Day-to-Day?
Most developers working in Claude Code's terminal environment settle into a small set of commands that handle the bulk of their workflow. These aren't novelty features - they're the commands that show up in real sessions, solving real friction points.
Developers who build with the full command set report spending roughly 30% less time on context re-establishment between sessions, compared to those who treat Claude Code as a plain chat interface. Here's what the core commands actually do:
- /init - Scans your project and auto-generates a CLAUDE.md file containing architecture notes, conventions, and dependencies
- /compact - Compresses your current conversation history to reduce token load while preserving task continuity
- /btw - Injects a side note or clarification into the active task without triggering a new response cycle
- /loop - Puts Claude into a repeating task execution mode until a condition is met or you manually stop it
- /schedule - Queues a task to execute based on time or a defined trigger
- /review - Runs a structured code review pass over a specified file or diff
- /clear - Wipes the current conversation context entirely for a clean start
Understanding what each one does at a mechanical level is step one. Knowing when to chain them together is where the real efficiency comes from.
How Does /init Build Persistent Project Memory With CLAUDE.md?
If you only learn one Claude Code command, make it /init. Running it in your project root triggers a scan of your directory structure, existing config files, package manifests, and README content. Claude then generates a CLAUDE.md file that captures your project's context in plain language.
Without this, you're spending an estimated 12 minutes per session re-explaining your stack, your naming conventions, and which files are off-limits. The CLAUDE.md file eliminates that entirely. Claude reads it at the start of every session and walks in already oriented.
Here's what a minimal CLAUDE.md output looks like after running /init on a Node.js API project:
# Project: user-auth-service
## Stack
- Node.js 20, Express 4, PostgreSQL 15
- ORM: Prisma
- Auth: JWT with refresh token rotation
## Conventions
- Controllers in /src/controllers, services in /src/services
- All DB queries go through the service layer, never directly in controllers
- Environment variables loaded via dotenv, never hardcoded
## Off-limits
- Do not modify /migrations directly, use `npx prisma migrate dev`
You can edit this file manually after generation to add team-specific rules, style preferences, or project constraints. Claude will respect whatever is in there. For a deeper look at how Claude handles memory across different contexts, how Claude AI memory works across conversation types is worth reading alongside this setup.
The CLAUDE.md file also pairs well with a clean folder structure. If you're building out a longer-term project, the perfect Claude folder structure for any project walks through how to organize everything so /init has the cleanest possible source material to work with.
What Do /loop and /schedule Actually Enable for Autonomous Development?
This is where Claude Code stops being a reactive assistant and starts behaving more like a background agent. Most developers haven't touched these commands, which is a significant missed opportunity.
/loop puts Claude into a continuous execution cycle. You define a task, Claude runs it, evaluates the output, and loops back to refine or extend until you stop it or a success condition is reached. This is genuinely useful for things like iterative test fixing, where Claude can run your test suite, read the failures, patch the code, and run again - without you sitting there prompting each step.
/loop fix all failing tests in /src/tests/auth.test.js until suite passes
/schedule takes this further by decoupling task execution from your active session. You can queue a refactor, a dependency audit, or a documentation pass to run at a specific time or when a file changes. Developers using /schedule for overnight refactoring tasks report reclaiming 45 to 60 minutes of focused work time per day by offloading repetitive structural work to scheduled runs.
/schedule "audit all TODO comments in /src and generate a prioritized issue list" at 02:00
Chaining /init with /loop and /schedule gives you a system where Claude already knows your project (via CLAUDE.md), executes tasks continuously, and does it on your schedule. That's not a chat tool anymore - that's closer to a Claude routine that automates your dev workflow.
How Do /btw and /compact Solve the Long-Context Problem in Claude Code?
Long sessions degrade. After a few thousand tokens of back-and-forth, Claude's attention starts to drift toward recent context and away from the original task framing. Most developers either don't notice this happening or they restart the session and lose everything. Neither is a good solution.
/compact solves this by summarizing and compressing your conversation history in place. It reduces token load by roughly 40% in typical sessions while preserving the task thread and any decisions already made. You stay in the same session, but Claude's working context is effectively refreshed.
Run it when you notice Claude starting to repeat suggestions you already rejected, or when a session has been running for more than 30 to 40 exchanges on a complex task.
/btw is quieter but surprisingly useful. It lets you add context or a soft correction mid-task without triggering a full response. Say Claude is in the middle of rewriting a module and you remember a constraint you forgot to mention - typing /btw the payment module can't use async/await due to a legacy wrapper logs that information without breaking Claude's current execution thread. It processes the note and incorporates it going forward without stopping to acknowledge it.
Together, these two commands handle the two most common failure modes in long Claude Code sessions: context bloat and mid-task information gaps. The /review command fits naturally here too - after /compact clears the fog, running /review on your changed files typically surfaces 3 to 5 issues Claude missed or deferred during the main task run.
According to Anthropic's official Claude Code documentation, the slash command system is designed specifically to support extended agentic sessions, not just single-turn interactions. That design intent matters - these commands aren't afterthoughts. They're the mechanism Anthropic built to make Claude Code viable for real development work.
What's the Best Way to Combine Claude Code Commands Into a Repeatable Workflow?
The developers getting the most out of Claude Code aren't using commands in isolation. They're building repeatable session patterns that front-load context and then hand off execution.
Step 1: Start Every Project With /init
Run /init once at project setup, then update CLAUDE.md manually as your architecture evolves. Think of it as a living spec file that costs you 5 minutes to maintain and saves you hours over the project's life.
Step 2: Use /compact at Session Midpoints
Build a habit of running /compact after roughly 20 to 25 exchanges in any complex session. Don't wait until you notice degradation. Treat it like saving your work.
Step 3: Offload Repetitive Tasks to /schedule
Any task you're running more than twice a week manually - dependency checks, documentation updates, linting passes - is a candidate for /schedule. Set it and move on.
Step 4: Use /loop for Multi-Step Iteration
Whenever a task requires more than 3 cycles of run-evaluate-refine, hand it to /loop. It's faster than prompting manually and it doesn't lose context between cycles.
Step 5: Keep /btw in Your Back Pocket
Add constraints and corrections as they come up with /btw rather than waiting until a task completes. Catching a wrong assumption at step 2 costs nothing. Catching it at step 8 costs a full re-run.
If you're serious about building with Claude Code beyond basic usage, exploring the 5 levels of Claude Code mastery gives you a clear progression path from command familiarity to building fully autonomous agent workflows. The slash commands covered here aren't the ceiling - they're the foundation everything else is built on.
7 Claude Code Features You Should Actually Know
Seven commands that change how Claude Code feels to use. A few are built-in, several are simple slash commands you add once and reuse forever.
Read the white paper →Get a free AI-powered SEO audit of your site
We'll crawl your site, benchmark your local pack, and hand you a prioritized fix list in minutes. No call required.
Run my free audit