Claude Code Slash Commands That Save Time
Agents at work · EN · 2026-10-24 · 141 reads
Claude Code slash commands help you control a coding session without repeatedly explaining what you need. They can initialize project guidance, reduce accumulated context, restore earlier work, and turn recurring instructions into reusable shortcuts. This tutorial walks through a practical workflow you can apply to your next development task.
1. Discover the commands your installation supports
Start Claude Code inside your project directory, then enter /help in its interactive prompt. Slash commands belong inside Claude Code; they are not terminal shell commands.
Command availability can change between releases. Type / to browse the commands available in your installation, including any custom commands or skills. Use that list as your reference if a command in this tutorial behaves differently.
2. Initialize project guidance with /init
Run /init when you first use Claude Code in an unfamiliar repository. It examines the project and generates a CLAUDE.md file with guidance for future sessions.
Review the generated file before relying on it. Correct guessed commands and add details that would otherwise require repeated explanations:
- The package manager and commands for development, testing, and linting.
- The directories that contain application code and tests.
- Project conventions, such as how database migrations are created.
- Constraints, such as avoiding edits to generated files.
Keep this guidance concise. A few accurate instructions save more time than a long document filled with assumptions.
3. Inspect context before a session becomes unwieldy
Use /context to inspect how the available context window is being used. This is useful after extensive file exploration, large tool outputs, or several rounds of debugging.
If you are continuing the same task, run /compact to summarize the conversation. You can provide a focus, such as /compact Preserve the authentication decisions, failing tests, and files still needing changes.
Compaction can lose detail. Keep essential requirements in project files or durable notes, and check that the assistant still understands the next action before requesting a substantial change.
4. Start unrelated work with /clear
Once you finish a task, use /clear before switching to unrelated work. This clears the current conversation context and helps prevent earlier assumptions from influencing the next request.
For example, after completing a checkout bug fix, clear the conversation before starting a reporting feature. Begin the new request with its goal, relevant files, and acceptance criteria. Your working files remain available; clearing conversation context does not undo code changes.
5. Recover continuity with /resume and /rewind
Use /resume to select an earlier conversation when you return to unfinished work. Resuming the relevant session often saves you from reconstructing the investigation and repeating failed approaches.
If the current attempt takes a wrong turn, /rewind opens checkpoint recovery options. Depending on the checkpoint, you can restore conversation state, supported file changes, or both.
Read the recovery options carefully. Rewind is not a replacement for Git, and it does not reverse every external effect, such as database updates or commands that changed files outside Claude Code's tracked edits.
6. Turn a repeated review into a custom command
Create .claude/commands/review.md in your repository. Claude Code supports Markdown files in this directory as custom slash commands; skills provide a newer, more flexible mechanism when you need additional capabilities.
Put this instruction in the file: Review $ARGUMENTS for correctness, missing tests, and compatibility risks. Report findings with file references. Do not modify files.
Then invoke /review src/auth. Claude Code substitutes the argument into your saved prompt. Commit the file so teammates can reuse the same review criteria. After creating it, check the slash command menu to confirm it is available.
7. Check permissions and usage deliberately
Open /permissions to review tool access before a session involving unfamiliar scripts. Use /cost, where available, to inspect session usage; provider billing remains the authority for actual charges.
If you use ApiCabin with Claude Code, follow its setup instructions for your API key and the API address https://api.apicabin.ai. ApiCabin provides one key with pay-as-you-go access across multiple model providers, which can simplify billing for indie developers and small teams. Sign up at https://apicabin.ai to get started, then practice these commands on one small task before building a larger workflow.
Want to follow along? Signing up comes with $0.30 of credit. Sign up