codingBy HowDoIUseAI Team

What Does /plan Do in Claude Code? (Plan Mode Before You Build)

The /plan command puts Claude Code in read-only mode so it can analyze your codebase, ask questions, and create a detailed implementation plan before writing any code.

The biggest mistake with AI coding tools is letting them start writing code before they understand the problem. The /plan command prevents this by putting Claude Code into a read-only mode where it can only analyze, ask questions, and plan — not modify files or run commands.

How does /plan work?

When you enter plan mode, Claude Code gets access to read-only tools only:

  • Read files and view content
  • Glob for file pattern searches
  • Grep for content searches
  • LS for directory listings
  • WebFetch for reference documentation

It explicitly cannot:

  • Edit or create files
  • Run shell commands
  • Install packages
  • Make any changes to your codebase

This separation forces a "think first, build second" approach. Claude explores your codebase, identifies what needs to change, and creates a plan you can review before anything gets modified.

How do you enter plan mode?

Three ways:

/plan                    # Type the command

Or press Shift+Tab twice — you'll see "plan mode" indicator in the UI.

Or launch Claude Code in plan mode from the terminal:

claude --permission-mode plan

What does the planning workflow look like?

  1. You describe what you want — "Add user authentication with email/password"
  2. Claude asks clarifying questions — "Which auth library? Should I add rate limiting? What about password reset?"
  3. Claude explores your codebase — reads relevant files, checks dependencies, understands your patterns
  4. Claude creates a plan — a structured breakdown with tasks, dependencies, and execution order
  5. You review and edit — approve, modify, or reject parts of the plan
  6. Claude executes — once you approve, switch out of plan mode and Claude implements systematically

Why use /plan instead of just asking Claude to build?

Without plan mode, Claude makes sequential guesses. It starts coding, discovers a constraint, backtracks, tries another approach, and burns context on false starts. This is expensive in tokens and often produces messy results.

Plan mode front-loads the hard thinking:

  • Fewer wrong turns — constraints are discovered before code is written
  • Better architecture — Claude sees the full picture before committing to an approach
  • Cleaner context — implementation context doesn't pollute planning context
  • You stay in control — you approve the approach before any code changes

Think of it like Bubble's "Workflow" view versus the "Live" view — you design the logic first, then run it, rather than trying to build and test simultaneously.

When should you use /plan?

Always use /plan for:

  • New features that touch multiple files
  • Refactoring existing code
  • Tasks you haven't done before in this codebase
  • Anything that could break existing functionality

Skip /plan for:

  • Simple bug fixes where you know exactly what's wrong
  • Small text or style changes
  • Tasks where the implementation is obvious

A good rule of thumb: if the task takes more than 3 files to complete, plan it first.

Can you combine /plan with /model opusplan?

Yes, and this is a powerful combination. Use /model opusplan and then /plan to get Opus-quality architectural thinking during the planning phase, with automatic switching to Sonnet for the implementation phase. You get the deepest reasoning where it matters most (planning) without paying Opus prices for the mechanical coding work.