Claude Code Plan Mode: Think First, Code Second (Complete Guide)

Plan mode forces Claude to reason about your codebase before writing a single line. It reads files, maps dependencies, and proposes a strategy you can approve or reject. Here's how to use it, when to skip it, and the keyboard shortcut.

March 5, 2026 · 3 min read

The most common complaint about AI coding tools: they start editing before they understand the problem. Claude Code plan mode fixes this by forcing a think-first, code-second workflow.

Press Shift+Tab before your prompt. Claude reads your codebase, maps dependencies, and proposes a strategy you approve or reject. Only then does it write code.

What Plan Mode Does

Plan mode splits Claude Code into two phases. In the first phase, Claude reads files and reasons about your request. It cannot edit files, run commands, or use any tools. In the second phase, after you approve its plan, it executes with full tool access.

Phase 1
Read + Reason (no tools)
Phase 2
Execute (full tool access)

The output of phase 1 is a structured plan: which files to edit, what changes to make, in what order, and why. You review it and choose one of three responses:

Approve

'Looks good, execute it.' Claude exits plan mode and implements the changes.

Reject

'No, the bug is in auth not the router.' Claude replans with your correction.

Refine

'Add tests for the edge case too.' Claude incorporates the feedback.

How to Activate Plan Mode

Three ways to enter plan mode, depending on whether you want it for one turn, one session, or every session.

MethodScopeHow
Shift+TabSingle turnPress before sending your prompt
/planCurrent sessionType /plan to toggle on/off
--plan flagEvery sessionStart with: claude --plan

Starting Claude Code in plan mode

# Plan mode for this session
claude --plan

# Plan mode + autoaccept (power-user workflow)
claude --plan --auto-accept

# Plan mode for a specific task
claude --plan "Refactor the auth module to use JWT tokens"

The Think-Then-Execute Workflow

Plan mode is not a separate feature. It is a phase. The workflow looks like this:

Typical plan mode workflow

You: "Refactor the payment module to support multiple currencies"

[Plan Mode - Phase 1]
Claude reads: src/lib/payments.ts, src/types/order.ts,
              src/api/checkout.ts, tests/payments.test.ts

Claude proposes:
1. Add Currency type to src/types/order.ts
2. Update PaymentService in src/lib/payments.ts
   - Add currency parameter to processPayment()
   - Add exchange rate lookup via existing ExchangeAPI
3. Update checkout API to accept currency from frontend
4. Add 12 test cases covering USD, EUR, GBP conversions

You: "Looks good, but use a separate exchange-rates.ts file"

[Phase 2 - Execution]
Claude creates src/lib/exchange-rates.ts
Claude updates src/lib/payments.ts
Claude updates src/api/checkout.ts
Claude adds tests

Why the constraint matters

When Claude cannot edit files in phase 1, it is forced to read before writing. This is the behavior developers want but rarely get from AI tools. Without plan mode, Claude might read one file, start editing, realize it needs a different approach, undo its changes, and try again. Each iteration costs tokens and time.

When to Use Plan Mode

Plan mode adds value when the cost of a wrong first step is high. Three scenarios where it consistently outperforms direct execution:

Large Refactors

When Claude might pick the wrong starting point, a plan reveals the dependency chain and execution order before anything moves. Refactors touching 5+ files benefit most.

Unfamiliar Codebases

When you want Claude to demonstrate understanding before making changes. A plan that correctly identifies the relevant files proves Claude has navigated the codebase. A plan that misses key files tells you to provide more context.

Irreversible Changes

Database migrations, API contract changes, infrastructure modifications. When undoing a mistake costs more than spending one extra turn planning.

When to Skip Plan Mode

Plan mode adds one turn of overhead. For small, obvious tasks, this overhead is not worth it. Skip plan mode when:

  • You could describe the exact edit in one sentence
  • The change touches a single file
  • You are fixing a typo, adding a log statement, or updating a constant
  • You have already told Claude exactly what to do and where

The rule of thumb: if Claude does not need to discover anything before acting, plan mode wastes tokens.

Plan Mode + Autoaccept

The power-user workflow combines strategic oversight with execution speed. Plan mode for strategy, autoaccept for execution.

The power-user workflow

# Start with both flags
claude --plan --auto-accept

# Claude will:
# 1. Read files and propose a plan (you review)
# 2. After you approve, execute WITHOUT asking
#    permission for each file edit or bash command
# 3. Return to plan mode for the next prompt

This workflow gives you one decision point (approve/reject the plan) instead of dozens (approve each tool use). For experienced developers who trust Claude's execution but want oversight on strategy, this is the optimal balance.

Safety net

Even with autoaccept, hooks still fire. A PreToolUse hook can block dangerous commands regardless of autoaccept settings. This means you can run plan mode + autoaccept with hook-based guardrails for maximum speed with minimum risk.

Plan Mode with Agent Teams

For agent teams, plan mode becomes a coordination tool. The team lead agent uses plan mode to create a strategy, then delegates specific parts of the plan to subagents.

Plan mode in team workflow

Team Lead (plan mode):
  "Add OAuth2 support to the API"

  Plan:
  1. Agent A: Add OAuth2 middleware to src/middleware/
  2. Agent B: Update user model with OAuth fields
  3. Agent C: Write integration tests
  4. After A+B complete: Agent D updates API docs

Each subagent gets only its part of the plan.
Total context: 4 × 30K = 120K tokens
Without teams: 1 × 300K+ tokens

Each subagent reads only the files its part of the plan requires. This reduces total token usage compared to a single session that accumulates the entire codebase context. See Claude Code cost optimization for the full cost breakdown.

FAQ

Does plan mode work in VS Code?

Yes. Plan mode works in both the CLI and the VS Code extension. The Shift+Tab shortcut and /plan command work identically in both environments.

Can I force Claude to always use plan mode?

Yes. Start Claude Code with claude --plan or add "planMode": true to your project's .claude/settings.json. You can also add a CLAUDE.md instruction like "Always plan before making changes to files in src/core/".

How does plan mode affect token costs?

Plan mode adds one planning turn (typically 10K-30K input tokens for file reads + 2K-5K output for the plan). But it often saves tokens overall by preventing wasted edits that require correction turns. For complex tasks, the net effect is usually a 20-30% reduction in total tokens.

Make Claude Code edits 10x faster

Plan mode improves strategy. Morph Fast Apply improves execution. At 10,500 tok/s, edits that took seconds now take milliseconds.