---
title: "Claude Code Slash Commands That Actually Save You Hours"
published: true
description: "A hands-on guide to the Claude Code commands that matter for daily dev workflow — context management, planning mode, model switching, and permission handling."
tags: devops, architecture, performance, workflow
canonical_url: https://blog.mvpfactory.co/claude-code-slash-commands-that-actually-save-you-hours
---
## What You Will Learn
By the end of this guide, you will have a repeatable session workflow for Claude Code built around the commands that actually earn their keep: `/compact` and `/clear` for context hygiene, `Shift+Tab` for mode cycling, `/model` for cost control, and `/permissions` for uninterrupted flow. Let me show you a pattern I use in every project.
## Prerequisites
- Claude Code installed and configured
- A working project (any language, any stack)
- Basic familiarity with the Claude Code terminal interface
## Step 1: Understand the Context Problem
Your session arrives with a meaningful chunk of the context window already consumed. Project files, system instructions, CLAUDE.md contents — they eat into it before you type a word. That overhead compounds. By mid-session, if you are debugging a complex issue across multiple files, you may be working against a degraded context window without realizing it.
Here is the minimal setup to get this working: start every session with `/cost`. It shows your current token consumption and API spend. Knowing how much context you have consumed before your first prompt changes how you frame your requests.
## Step 2: Master Context Commands
| Command | Purpose | When to use |
|---------|---------|-------------|
| `/cost` | Check token usage and spend | Start of session, periodically |
| `/compact` | Compress history, free context | Proactively at ~50% usage |
| `/clear` | Full conversation reset | Between unrelated tasks |
`/compact` compresses your conversation history to reclaim context space. Run it proactively around 50% usage, not when you are at 95% and responses are already degrading. By that point, you have lost signal in the compression. Think of it like garbage collection — you want it running before you are out of memory.
`/clear` is a full reset. Switching from debugging an API to writing a new feature? Clear the slate. Residual context from the previous task actively hurts the next one.
## Step 3: Use Planning and Mode Control
`Shift+Tab` cycles between three modes: normal, auto-accept, and plan.
- **Plan mode**: Claude explores your codebase and proposes an approach without writing code. The docs do not mention this, but the cost of a bad implementation is 10x the cost of spending five minutes planning first.
- **Auto-accept mode**: Claude executes without prompting for permission at each step. Use it when you trust the scope.
- **Normal mode**: Standard behavior with per-action approval.
## Step 4: Match Model to Task
`/model` switches between Opus, Sonnet, and Haiku mid-session.
| Model | Best for | Trade-off |
|-------|----------|-----------|
| Opus | Complex architecture, multi-file refactors | Slower, highest cost |
| Sonnet | General development, code review | Balanced |
| Haiku | Quick questions, simple edits | Fastest, cheapest |
Start in Sonnet, switch to Opus for the architecturally complex part, then drop to Haiku for cleanup. Matching model to task complexity saves real money over a week of heavy use.
## Step 5: Set Up Workflow Efficiency
`/permissions` pre-allows safe operations so you are not approving every file read or test run manually. Configure it once at session start.
`/init` generates a CLAUDE.md file for your project. You run it once, but it is probably the most valuable command on this list. A well-written CLAUDE.md front-loads context about your architecture, conventions, and constraints into every session automatically.
`/memory` manages your CLAUDE.md and memory files. Stale memory files are worse than no memory files — they inject misleading context at the start of every session.
## Step 6: Put It All Together
Here is the session flow I keep coming back to:
bash
- Start session
- /cost → Check baseline token usage
- /permissions → Pre-allow test runs, file reads
- Shift+Tab → plan mode → Design approach before coding
- Shift+Tab → normal → Implement the plan
- /compact → Free context at ~50% usage
- /model haiku → Switch for simple fixes
- /clear → Reset before next task
This sequence keeps context clean, matches model to task, and separates planning from execution.
## Gotchas
- **Compacting too late**: If you wait until 95% context usage, the compression loses important signal. Compact at 50%. Here is the gotcha that will save you hours.
- **Skipping `/clear` between tasks**: Residual context from a debugging session will bleed into your next feature work. Always reset between unrelated tasks.
- **Memorizing everything**: Run `/help` for the full list, but resist the urge to learn every command. A smaller toolkit you actually use beats a large one you half-remember. Commands also change between releases, so verify behaviors against the current docs.
- **Rubber-stamping permissions**: The friction of constant permission prompts breaks flow state and you end up approving everything anyway. Set `/permissions` once at session start instead.
## Wrapping Up
Context discipline is the single most useful habit you can build with Claude Code. Monitor context instead of guessing at it. Plan before you build. Match model to task. The commands themselves are simple — the hard part is using them consistently. Start with the session flow above and adapt it. It will not take long before it is second nature.
Top comments (0)