---
title: "Claude Code Commands I Use on Repeat to Stay in Flow"
author: "Ecem Karaman"
source: "https://aiwithecem.com/guides/claude-code-commands"
published: 2026-09-17
tools: ["Claude"]
topics: ["Setup","Workflows","AI Agents"]
---

# Claude Code Commands I Use on Repeat to Stay in Flow

Claude Code has dozens of slash commands. A handful keep me in flow, so those come first. The rest are organized by the moment you need them, from setting up a project to shipping and automating the work.

**Last checked against [Claude Code's command reference](https://code.claude.com/docs/en/commands) on September 17, 2026.** Available commands depend on your version, plan and platform. Type `/` in a session to see yours.

> **In this guide**
>
> 1. [My go-to five](#my-go-to-five)
> 2. [Three prefixes to learn first](#three-prefixes-to-learn-first)
> 3. [Set up a project](#set-up-a-project)
> 4. [Plan and run a task](#plan-and-run-a-task)
> 5. [Keep context clean](#keep-context-clean)
> 6. [Undo, branch and resume](#undo-branch-and-resume)
> 7. [Run work in parallel](#run-work-in-parallel)
> 8. [Review before you ship](#review-before-you-ship)
> 9. [Repeat and automate](#repeat-and-automate)
> 10. [Check usage and setup](#check-usage-and-setup)
> 11. [Keyboard shortcuts](#keyboard-shortcuts)

## My go-to five

These are the built-in commands and settings that show up most in my own Claude Code history since June 2026. Each one saves me a stop: an approval, a copy-paste or a restart.

| What I use | Why it stays in my routine |
| ---------- | -------------------------- |
| `/clear` | I start fresh for each new task instead of letting unrelated work pile into one conversation |
| `!` shell mode | I run a command myself and Claude reads the output, without me pasting anything |
| `/mcp` | I connect the servers a project needs and turn off the ones it doesn't |
| `/plugin` and `/reload-skills` | I build and edit skills often, and these load changes without restarting |
| `auto` permission mode | Most of my sessions run in auto mode, so long tasks don't stop for every approval |

Most of what I build runs through custom skills, which you can make with the template in [Repeat and automate](#repeat-and-automate).

## Three prefixes to learn first

| Type | What happens | Example |
| ---- | ------------ | ------- |
| `/` | Runs a command or skill. It only works at the start of a message | `/context` |
| `!` | Runs a shell command yourself. The output goes into the conversation and Claude responds to it | `! npm test` |
| `@` | Mentions a file with path autocomplete | `explain @src/auth.ts` |

Press `?` on an empty prompt to see shortcuts. If you send a command while Claude is working, it waits until the turn ends. A few, like `/usage`, run right away.

## Set up a project

| Command | What it does | Use it when |
| ------- | ------------ | ----------- |
| `/init` | Generates a starter `CLAUDE.md` for the project | It's your first session in a repository |
| `/memory` | Edits `CLAUDE.md` files and turns auto memory on or off | Claude keeps missing a project convention |
| `/permissions` | Manages allow, ask and deny rules for tools | You approve the same safe command over and over |
| `/mcp` | Connects, signs in to, enables or disables MCP servers | You add a server or want to trim unused ones |
| `/model` | Switches the model and saves it as your default | A task needs more capability or more speed |
| `/import` | Brings settings from Codex, Gemini CLI or Cursor | You're moving over from another coding agent |

## Plan and run a task

| Command | What it does | Use it when |
| ------- | ------------ | ----------- |
| `/plan [task]` | Enters plan mode so Claude investigates and proposes before editing | The change is large or touches unfamiliar code |
| `/goal <condition>` | Keeps Claude working across turns until a separate model confirms the condition is met | The end state is verifiable, like "all tests pass" |
| `/effort <level>` | Sets reasoning effort, from `low` to `max` | The task is harder or simpler than usual |
| `/fast` | Toggles fast mode for quicker output | You're iterating on small changes |
| `Ctrl+B` | Moves a running command to the background | A build or test run is blocking the session |

**Permission modes** decide what Claude does without asking. Press `Shift+Tab` to cycle through `default`, `acceptEdits` and `plan`.

| Mode | What runs without asking | Best for |
| ---- | ------------------------ | -------- |
| `default` | Reading files | Sensitive work where you review every action |
| `acceptEdits` | File edits and common filesystem commands | Iterating on code you're watching |
| `plan` | Reading and planning | Exploring before changing anything |
| `auto` | Everything, with background safety checks | Long tasks with fewer interruptions |
| `dontAsk` | Only pre-approved tools. Everything else is denied | Scripts and CI |
| `bypassPermissions` | Everything | Isolated containers and VMs only |

## Keep context clean

| Command | What it does | Use it when |
| ------- | ------------ | ----------- |
| `/context` | Shows what's filling the context window, with suggestions | Responses slow down or quality drops |
| `/compact [focus]` | Summarizes the conversation to free space. Add what the summary should keep | A long task still has work left |
| `/clear` | Starts a fresh conversation. Project memory stays | You're switching to an unrelated task |
| `/btw <question>` | Answers a side question from what's already in context, without adding to history | You need a quick answer mid-task |

`/btw` works even while Claude is busy, but it can't read files or run commands. To add instructions mid-task, type your message and press `Enter`. Claude Code queues it for Claude. Press `Esc` to interrupt instead.

## Undo, branch and resume

| Command | What it does | Use it when |
| ------- | ------------ | ----------- |
| `/rewind` or `Esc Esc` | Rolls code, conversation or both back to an earlier checkpoint | Claude went the wrong way |
| `/branch [name]` | Branches the conversation at this point | You want to try another approach without losing this one |
| `/resume` | Opens a picker of earlier sessions | You're returning to past work |
| `/rename [name]` | Names the session so you can find it later | The session matters beyond today |
| `/export` | Saves the conversation as plain text | You want a record outside Claude Code |

**Checkpoints have limits.** They don't track files changed by shell commands or edits made outside Claude Code. Commit to git before risky work.

From your terminal, `claude -c` continues the most recent conversation in the current folder, and `claude -r "<name>"` resumes a specific one.

## Run work in parallel

| Command | What it does | Use it when |
| ------- | ------------ | ----------- |
| `/tasks` | Lists background work in this session, including finished subagents | You want to check what's still running |
| `/subtask <task>` | Starts a background subagent that inherits the full conversation | A side task needs the same context |
| `/fork [prompt]` | Copies the conversation into a new background session | You want to explore two directions at once |
| `/background` | Detaches the whole session to keep running and frees your terminal | A long task doesn't need you watching |
| `/batch <instruction>` | Splits a codebase-wide change into parts that run in separate worktrees | A migration or refactor touches many files |

Starting Claude with `claude -w` puts the session in its own git worktree, so parallel sessions don't edit the same files.

## Review before you ship

| Command | What it does | Use it when |
| ------- | ------------ | ----------- |
| `/diff` | Shows changes in your working tree, including Claude's edits | Before you commit |
| `/code-review [level] [--fix]` | Checks the diff for bugs and cleanups. `--fix` applies the findings. Pass a PR number to review a pull request | Before you open or merge a PR |
| `/security-review` | Checks your branch's changes for security vulnerabilities | The change touches auth, input handling or data |
| `/simplify` | Reviews changed code for cleanup and applies the fixes | The code works but feels heavier than it should |
| `/verify` | Builds and runs your app to confirm the change actually works | Tests pass but you want proof in the real app |

`/code-review ultra` runs a deeper multi-agent review in the cloud.

## Repeat and automate

| Command | What it does | Use it when |
| ------- | ------------ | ----------- |
| `/loop [interval] [prompt]` | Repeats a prompt while the session stays open | You're watching a deploy or a flaky test |
| `/schedule` | Creates cloud routines that run with no open session | Work should happen nightly or every morning |
| `/hooks` | Shows hooks that run scripts on events, like after every edit | A rule must hold every time, not just when Claude remembers |
| `claude -p "prompt"` | Runs one prompt without the interactive interface and exits | You're scripting Claude Code or running it in CI |

| Option | Runs on | Needs an open session | Shortest interval |
| ------ | ------- | --------------------- | ----------------- |
| `/loop` | Your machine | Yes | 1 minute |
| `/schedule` | The cloud, on a fresh clone | No | 1 hour |

**Make your own command.** Save instructions to `.claude/skills/<name>/SKILL.md` and they become `/<name>`. Older files in `.claude/commands/` still work the same way.

```markdown
---
name: pre-pr
description: Prepare this branch for a pull request.
---

1. Run the test suite and fix any failures.
2. Review the diff for bugs, missing tests and leftover debug code.
3. Draft a PR description: what changed, why, and how to test it.
Ask me before pushing or opening the PR.
```

## Check usage and setup

| Command | What it does | Use it when |
| ------- | ------------ | ----------- |
| `/usage` | Shows session cost, plan limits and activity | You're near a limit or tracking spend |
| `/insights` | Generates a report on how you've used Claude Code recently | You want to find patterns in your sessions |
| `/skill-doctor` | Shows each skill's context cost and how often it's used | Your setup feels bloated |
| `/doctor` | Checks your installation and configuration and can fix issues | Something isn't loading or behaving right |
| `/release-notes` | Shows what changed in each version | A command behaves differently than you remember |

## Keyboard shortcuts

| Shortcut | Action |
| -------- | ------ |
| `Esc` | Interrupt Claude or close a dialog |
| `Esc Esc` | Clear your draft, or rewind |
| `Shift+Tab` | Cycle permission modes |
| `Option+P` / `Alt+P` | Switch model |
| `Option+T` / `Alt+T` | Toggle extended thinking |
| `Ctrl+B` | Send a running task to the background |
| `Ctrl+O` | Open the transcript viewer |
| `Ctrl+R` | Search your prompt history |
| `Ctrl+G` | Write your prompt in your text editor |
| `Ctrl+S` | Stash your prompt and restore it later |
| `Ctrl+V` | Paste an image |
| `\` then `Enter`, or `Ctrl+J` | New line without sending |

On macOS, `Option` shortcuts require setting Option as Meta in your terminal.

**Go deeper:** [Claude Code commands reference](https://code.claude.com/docs/en/commands) · [MCP vs CLI](/guides/mcp-vs-cli) · [Claude, End to End](/guides/claude-end-to-end) · [Routine vs Schedule vs Loop](/guides/routine-vs-schedule-vs-loop)
