Claude Code Commands: The Complete Developer Guide to Every Slash Command, Flag & Workflow in 2026

The Command Layer Most Developers Never Master

If you’ve used Claude Code for more than a week, you’ve probably typed a prompt, watched it write some code, and hit Enter again. That’s productive. But you’re likely using about 10% of what the tool can actually do.

Claude Code ships with over 90 slash commands — a control plane that covers everything from switching AI models mid-session to spawning parallel coding agents, reviewing your pull requests automatically, and even scheduling cloud-based agents to run on a cron job while you sleep.

Claude Code Commands

This guide covers every major Claude Code command category: the built-in slash commands, the skill-based workflow commands, the CLI flags that matter most, and the agentic orchestration features that genuinely change how fast a team can ship. Whether you’re a beginner who just installed the tool or an experienced developer trying to squeeze out more speed, you’ll leave with a command system that actually works for you.

💡 Quick fact: Claude Code scored 80.8% on SWE-bench Verified — one of the highest scores for any AI coding tool — and has been available in general release since May 2025.

What Are Claude Code Commands?

Claude Code is Anthropic’s terminal-native AI coding agent. Unlike a chat interface that generates code for you to copy and paste, it connects directly to your codebase, reads your project structure, edits files, runs tests, and creates pull requests — all through natural language instructions.

Claude Code commands are special instructions that start with a forward slash (`/`) typed at the beginning of a message. They’re not prompts — they’re control signals. They tell Claude Code to switch modes, change behavior, manage context, or trigger specific workflows without you needing to explain it in natural language every time.

There are four types of commands you’ll encounter:

  • Built-in commands — Core CLI behaviors baked into the tool (like /clear, /model, /permissions).
  • Skill commands — Bundled prompt-driven workflows like /batch, /loop, and /code-review.
  • Workflow commands — Multi-agent background orchestration for heavier tasks like /deep-research.
  • MCP prompt commands — Dynamic commands discovered from connected MCP servers (/mcp__server__prompt).

You can see every available command by typing `/` inside Claude Code, or filter by typing `/` followed by a few letters.

Essential Claude Code Commands Every Developer Should Know

Start here. These are the commands you’ll use in nearly every session, and mastering them alone will noticeably improve your workflow.

/init — Start Every Project Right

Run `/init` the first time you open Claude Code in a new repository. It generates a starter `CLAUDE.md` file — a persistent memory document that tells Claude about your project structure, conventions, and off-limits files. Think of it as the briefing document your AI assistant reads before every session.

/init

Tip: Set CLAUDE_CODE_NEW_INIT=1 for an interactive flow that also walks you through skills, hooks, and personal memory setup.

/compact — Your Context Window Lifesaver

Long coding sessions fill up the context window fast. When that happens, Claude gets less accurate and can lose track of what it’s been working on. `/compact` summarizes the conversation into a dense snapshot, freeing space without losing the important context.

/compact

/compact Focus on the authentication module and open test failures

Pass instructions to steer what gets preserved. Without `/compact`, long sessions either hit the ceiling abruptly or force a full restart — both are expensive in time.

/plan — Think Before You Build

Before making any large or risky change, use `/plan` followed by a description. Claude Code enters Plan Mode: it reasons through the problem, maps out its approach, and shows you the steps before touching a single file. You review, adjust, and then approve.

/plan refactor the payment processing module to use the new Stripe API

This one command alone prevents the frustrating loop of watching Claude make changes in the wrong direction for five minutes before you can stop it.

/permissions — Trust Boundaries You Control

Claude Code can read files, run shell commands, write to disk, and call APIs. `/permissions` gives you an explicit allow/ask/deny system for every tool category. This matters especially on codebases with sensitive files or when you’re working in an environment where destructive commands need human approval.

/permissions

/model — Switch Models for the Right Task

Not every task needs the most powerful model. Use `/model` to switch between Sonnet and Opus mid-session. Lightweight tasks — boilerplate generation, simple refactors — work great on faster, cheaper models. Deep architectural reasoning or complex bug hunting benefits from Opus.

/model claude-sonnet-4-6

/model claude-opus-4-6

/compact, /context, and /clear — Managing the Session

These three commands handle your session state. `/context` shows a visual breakdown of your context window usage. `/compact` summarizes and compresses. `/clear` starts a fresh conversation while saving the old one to `/resume`.

/context all

/clear my-feature-branch-session

/resume

Advanced Workflow Commands: Parallelism and Automation

This is where Claude Code separates itself from every other AI coding assistant. These commands let you run work in parallel, automate repetitive tasks, and keep sessions running while you do other things.

/batch — Parallel Work Across Your Entire Codebase

Give `/batch` a large instruction and it researches the codebase, breaks the work into 5 to 30 parallel units, spawns subagents for each unit in isolated worktrees, and opens pull requests when done. What would take a developer days can finish in under an hour.

/batch migrate all API calls from v1 to v2 endpoints across the codebase

This is particularly powerful for large refactors, consistent style changes, or sweeping dependency updates.

/goal — Autonomous Multi-Turn Work

Instead of guiding Claude step by step, `/goal` lets you define a condition and walk away. Claude works autonomously — running tests, fixing failures, iterating — until the goal condition is met or it hits a decision it needs you for.

/goal all unit tests pass and the build is green

Pair /goal with /loop for self-correcting agents that run checks on a schedule and fix issues as they appear.

/loop — Scheduled In-Session Checks

`/loop` repeats a prompt at a set interval for as long as your session is open. Classic use cases include polling CI, monitoring deployment status, or babysitting a set of open pull requests.

/loop 5m check if the deployment finished and report status

/loop babysit all my open PRs

/loop 30m run the test suite and fix any new failures

/background and /fork — Keep Working While Claude Works

`/background` detaches the current session as a background agent, freeing your terminal for other work. `/fork` creates a background subagent that inherits the full conversation history and works independently on a given directive.

/background run the full regression suite and report back

/fork investigate the memory leak in the worker process

Code Quality and Review Commands

Shipping clean, secure code is where these commands pay for themselves. Each one gives Claude a focused lens — bugs, security, or cleanup — without it trying to do everything at once.

/code-review — Your Pre-Merge Safety Net

Run `/code-review` before any merge. It analyzes your current diff for correctness bugs, reuse opportunities, and inefficiencies. With `–fix`, it applies the fixes automatically. With `–comment`, it posts findings as inline PR comments (requires GitHub MCP).

/code-review

/code-review –fix

/code-review –comment

/code-review ultra

Use –effort low for daily pre-commit checks. Use –effort high before major releases. /code-review ultra runs cloud-based multi-agent review for the deepest analysis.

/security-review — A Focused Security Pass

Separate from the general code review, `/security-review` does a read-only security-focused analysis of your branch diff. It looks for injection vulnerabilities, exposed credentials, insecure dependencies, and misconfigurations. It doesn’t make changes — it reports.

/security-review

/diff — See Exactly What Changed

`/diff` opens an interactive viewer showing both uncommitted changes and per-turn diffs from the current session. It’s the fastest way to audit what Claude has done before you commit anything.

/diff

/simplify — Cleanup Without the Bug Hunt

When you want Claude to clean up messy code without the risk of it trying to fix bugs it perceives along the way, `/simplify` restricts it to cleanup-only review. No correctness changes, just readability and structure improvements.

/simplify src/auth/

Session Management and Navigation Commands

These commands handle the mechanics of your Claude Code sessions — saving state, resuming work, branching experiments, and recovering from mistakes.

/resume — Pick Up Where You Left Off

Every session named with `/clear` can be resumed by name or ID. Background sessions appear in the picker marked with `bg`. This is how you maintain continuity across days without needing to re-explain context every morning.

/resume

/resume my-feature-branch-session

/rewind — Undo Without Fear

Made a mess? `/rewind` rolls back both the code changes and the conversation to a checkpoint. Aliases include `/checkpoint` and `/undo`. It’s the safety net that makes aggressive experimentation actually comfortable.

/rewind

/branch — Explore Without Committing

`/branch` forks your conversation at the current point. Try an approach, see how it goes, and return to the original with `/resume` if it doesn’t pan out. This is the equivalent of a git branch for your Claude session itself.

/branch try-the-redis-approach

/export — Save Your Session

Exports the full conversation as a plain text file. Useful for documentation, sharing context with a colleague, or archiving a session that solved a tricky problem.

/export auth-refactor-session.txt

Setup, Configuration, and MCP Commands

These commands handle the infrastructure layer — connecting external tools, configuring behavior, and diagnosing problems.

/mcp — Connect External Tools

MCP (Model Context Protocol) servers extend Claude Code with connections to real tools: Jira, Sentry, PostgreSQL, Notion, GitHub, and more. `/mcp` manages these connections, handles OAuth, and lets you enable or disable servers per session.

/mcp

/mcp reconnect github

Once a server is connected, its prompts become available as commands in the format `/mcp__servername__promptname`.

/memory — Persistent Project Context

`/memory` lets you edit your `CLAUDE.md` files, toggle auto-memory, and view what Claude has automatically remembered from your sessions. Well-maintained memory files are the difference between Claude that constantly needs re-briefing and Claude that hits the ground running.

/memory

/hooks — Automate the Policy Layer

Hooks trigger Claude Code behaviors automatically on specific events — after every file edit, before every shell command, when a session starts. `/hooks` lets you view and manage your hook configurations.

/hooks

Common use cases: auto-lint after every edit, block dangerous shell commands, automatically run tests after file changes.

/doctor — Fix Installation Issues

When something isn’t working right, `/doctor` runs a full diagnostic check on your installation and settings. Press `f` to auto-fix any issues it finds.

/doctor

The Minimum Viable Command Stack to Start With

If you’re new to Claude Code or building a habit from scratch, don’t try to learn all 90+ commands at once. Start with this core set and expand from there:

  1. /init — Every new project, always
  2. /permissions — Set your trust boundaries before your first big edit
  3. /plan [description] — Before any risky or large change
  4. /compact — When sessions run long
  5. /code-review –fix — Before every merge
  6. /goal [condition] — When you want Claude to work autonomously
  7. /resume — Every morning when you pick up where you left off

🚀 Power move: Pair /goal with /loop for a self-correcting agent loop. Set a goal condition, then run /loop every 10 minutes to check progress and fix emerging issues automatically.

FAQ: Claude Code Commands

What is the most important Claude Code command to learn first?

init is the most important starting point. It creates your CLAUDE.md file, which is how Claude Code builds persistent understanding of your project. Without it, you’re starting from scratch every session. After that, /plan and /compact are the two that save the most time day-to-day.

How do I see all available Claude Code commands?

Type `/` at the beginning of any message in Claude Code to open the command picker. Start typing any letters to filter by name. You can also run `/help` for the built-in help system, or check `/release-notes` after any update to see what’s new.

Can I create my own custom Claude Code commands?

Yes — these are called skills. A file placed at `.claude/commands/commandname.md` creates a custom `/commandname` slash command for your project. Skills can also include supporting files, frontmatter control, and auto-invocation triggers. They’re shareable across your team by committing them to the repo.

What’s the difference between /batch and /fork?

`/batch` is for large work decomposed across many parallel agents — it researches the codebase, breaks the task into units, spawns a subagent for each, and opens PRs. `/fork` creates a single background subagent that inherits your full current conversation and works on one focused directive while you continue in the main session.

Does Claude Code work with tools like Jira, GitHub, or Sentry?

Yes, through MCP (Model Context Protocol) server integrations. Once you connect a server via `/mcp`, Claude Code can read from and write to those tools natively. A connected GitHub MCP, for example, lets `/code-review –comment` post inline review comments directly on your PR without leaving the terminal.

Claude Code Commands
Claude Code Commands

Conclusion: Commands Are the Difference Between a Tool and a System

Most developers who try Claude Code and find it “just okay” are using it as a fancy autocomplete. They type a prompt, accept the suggestion, move on. That experience is genuinely fine — but it’s a fraction of what the tool does.

The Claude Code command system is what turns it from an autocomplete into an autonomous development partner. `/plan` makes it think before it acts. `/goal` lets it work while you focus elsewhere. `/batch` parallelizes work that would take days. `/code-review` catches bugs before they reach production. And `/resume` means no context is ever truly lost.

The developers getting the most out of Claude Code aren’t the ones with the cleverest prompts — they’re the ones who’ve built a command-driven workflow that makes the tool an extension of how they already think about code.

Start with the minimum viable stack. Build your `CLAUDE.md`. Add one new command to your routine each week. Within a month, you’ll have a system that genuinely accelerates how fast you ship.

Get started now: Open Claude Code in your project, run /init, then /plan on your next task. Notice what changes. That’s the beginning of a system that compounds over time.

Ai Process Automation

Leave a Comment