D3.2 · Domain 3 · Agent Operations · 20% of CCA-F

Plan Mode.

9 min read·10 sections·Tier A

Plan Mode forces Claude Code to draft and approve a multi-step plan before executing. Use it for non-trivial changes (3+ steps); skip for trivial edits. The exam pattern: when do you require Plan Mode vs. direct execution. Claude Code feature

Deep-dive coming soonDomain 3
Plan Mode, hero illustration featuring Loop mascot in a warm gallery scene.
Domain D3Agent Operations · 20%
On this page
01 · Summary

TLDR

Plan Mode forces Claude Code to draft and approve a multi-step plan before executing. Use it for non-trivial changes (3+ steps); skip for trivial edits. The exam pattern: when do you require Plan Mode vs. direct execution. Claude Code feature

3+ steps
Trigger threshold
D3
Exam domain
blast radius
Decision factor
B
Coverage tier
trivial edit
Skip case
02 · Definition

What it is

Plan mode is a Claude Code feature that separates exploration from execution. The workflow: enter plan mode, issue a research or design request, Claude analyzes the codebase and produces a structured plan, then you approve or refine the plan before execution. Only after approval does Claude write or modify files. This makes the reasoning visible and gated.

What distinguishes plan mode from direct execution is the approval gate. Direct execution starts modifying files immediately on a clear request. Plan mode is for ambiguous or multi-faceted requests where there are 3+ viable architectures with tradeoffs. Without upfront analysis, rework is inevitable. Plan mode prevents rework by validating the architecture before the first file edit.

The trigger threshold is 3+ steps involving architectural or design decisions. A single-file bugfix with a clear stack trace does not need plan mode. A 30-file refactor, domain model rewrite, or library migration always needs it. The test: "Can I confidently describe the change without exploring the codebase first?" If no, plan mode.

Plan mode works in locked phases. Phase 1: Claude explores files, identifies interdependencies. Phase 2: Claude proposes 2-3 architectural options with tradeoffs. Phase 3: you choose or refine. Phase 4: Claude executes. Each phase is fully visible; you can exit, iterate, or reject without partial damage. This is why plan mode prevents the over-confident bad decision class of bugs.

03 · Mechanics

How it works

The plan-mode loop has four decision points. Explore: Claude reads the codebase, writes a diagnosis. Propose: Claude offers 2-3 options with explicit tradeoffs (performance, complexity, testing burden). Decide: you approve, request changes, or reject. Execute: only after approval, Claude modifies files and runs tests.

Blast radius assessment is plan mode's critical step. Before modifying any file, Claude must answer: "Which files change? What breaks if done wrong? What tests validate?" For architectural changes, the answer spans dozens of files. Plan mode forces this estimation before the first edit, not after a broken test reveals the gap.

Plan mode is not a separate conversation. Same session, same message history, same context window. Claude explains the codebase aloud; you ask clarifying questions; Claude refines. Then you issue an approval ("Implement option A") and execution proceeds. One coherent thread, unlike fork or subagent which isolate context.

Rejection and iteration are zero-cost. Read the plan, dislike it, reply "No, fewer services". Claude re-analyzes (same session) and produces a new plan. No rework of partial code, no discarded PRs. Iteration cost is milliseconds of token budget, not hours of human rework.

Plan Mode mechanics, painterly diagram featuring Loop mascot.
04 · In production

Where you'll see it

Monolith-to-microservices refactor

50K-line e-commerce platform splitting. Direct execution risks boundary mistakes that cascade through 6 months of work. Plan mode: explore, propose 3-service boundary, you question whether payments should be separate. Claude revises. Approval before refactoring.

Major dependency upgrade (React 18 → 19)

120 components. Not a mechanical find-replace. Plan mode: scan, propose codemods for 80% + manual review for 20%, identify components at risk, recommend test-first sequence. You approve, then execute.

Multi-service CI/CD pipeline redesign

Brittle workflows. No single right redesign. Plan mode: map current pipeline, identify bottlenecks, propose 2 architectures with tradeoffs. You pick one. Prevents locking into wrong architecture mid-build.

Unfamiliar codebase from a different framework

Unfamiliar code = hidden interdependencies. Plan mode is mandatory. Claude explores, explains the architecture, proposes a feature-add strategy. Without plan mode, an unfamiliar framework is a minefield.

05 · Implementation

Code examples

Plan mode workflow (CLI + programmatic)
# Step 1: Enter plan mode for architecture exploration
claude --plan-mode

# In session: ask an architectural question
# "Refactor this monolith into 3-4 microservices.
#  Analyze dependencies first."

# Claude explores the codebase, reads key files, identifies domains,
# proposes a service boundary. NO files are edited yet.

# Step 2: Review the plan in the conversation. Ask clarifying questions:
# "Can the payment service be separate from fulfillment?"

# Claude revises the plan based on your feedback (still no file changes).

# Step 3: Approve execution
# "Looks good. Implement this plan."

# Claude now executes: creates files, modifies existing, runs tests.
# All changes logged and visible.

# Step 4 (optional): Exit plan mode for follow-up tweaks
# Quick edits after the plan can use direct execution.
CLI plan mode separates exploration (zero file changes) from execution (approval-gated modifications).
06 · Distractor patterns

Looks right, isn't

Each row pairs a plausible-looking pattern with the failure it actually creates. These are the shapes exam distractors are built from.

Looks right

Use plan mode for every request, including simple bugfixes.

Actually wrong

Plan mode has overhead. Reserve for 3+ step architectural decisions. A single-file null-check should use direct execution.

Looks right

Plan mode is for understanding code; skip it once you know the codebase.

Actually wrong

Plan mode is for decision validation, not just learning. Even in familiar codebases, complex multi-file refactors benefit from blast-radius estimation.

Looks right

Plan mode prevents all mistakes; use it for everything.

Actually wrong

Plan mode is an approval gate on architecture, not a guarantee against all bugs. Its strength is catching bad-decision types; it doesn't replace testing.

Looks right

If the plan is bad, execute it anyway and fix later.

Actually wrong

Reject and iterate (zero cost). Executing a bad plan and reworking is expensive. Plan mode's value is iteration cost (milliseconds), not execution cost (hours).

Looks right

Direct execution can switch to plan mode mid-work.

Actually wrong

Plan mode is a mode, not a patch. Switching mid-work commits to prior decisions made in direct mode. Start in plan mode for complex tasks.

07 · Compare

Side-by-side

AspectPlan ModeDirect Executionfork_sessionSubagent
Approval gateYes, explicitNone, immediateNoneNone
Visibility of reasoningFull plan shownImplicitParallel threadsHidden in subagent
Iteration costMillisecondsHours (rework)Minutes (merge)Hours (restart)
Best forMulti-step architecturalSingle-file, clear scopeComparing approachesParallel research
Context retentionSingle session, full historySingle sessionTwo branchesIsolated, discarded
File changes before approvalNoneImmediateNone until mergeOnly in subagent context
08 · When to use

Decision tree

01

Can you describe the desired change without exploring the codebase?

YesDirect execution. Save time; plan mode has overhead.
NoPlan mode. Exploration validates the approach before committing.
02

Does the change span 30+ files or involve architectural decisions?

YesPlan mode is mandatory. Blast radius too large to wing it.
NoDirect execution acceptable if scope is clear.
03

Are there 3+ valid approaches with different tradeoffs?

YesPlan mode. Proposals clarify the tradeoff space.
NoDirect execution if right approach is obvious.
04

Will failing mid-work be expensive?

YesPlan mode. Upfront approval saves rework.
NoDirect execution. Cost of failure is acceptable.
05

Are you familiar with this codebase?

YesDecide based on other factors.
NoPlan mode always. Unfamiliar code means hidden interdependencies.
09 · On the exam

Question patterns

Plan Mode exam trap, painterly cautionary scene featuring Loop mascot.

13 V2 questions wired to this concept. Tap an answer to check it instantly — you'll see whether it's right and why — then expand the full breakdown for the mental model and all four rationales.

For a single-file null-check fix, should you use plan mode?

Tap your answer to check it.

You are about to start a 30-file refactor. Direct execution or plan mode?

Tap your answer to check it.

The plan Claude produced looks bad. Should you execute and fix the result later?

Tap your answer to check it.

You are working in an unfamiliar codebase with a different framework and conventions. Is plan mode optional?

Tap your answer to check it.

Can you switch from direct execution to plan mode mid-task?

Tap your answer to check it.

Is plan mode viable inside CI/CD pipelines?

Tap your answer to check it.

7 additional questions for this concept live in the practice pillar. Take a mock exam ↗

10 · FAQ

Frequently asked

How long does plan mode take?
Plan generation: 2-5 min for a 50K-line codebase. Execution: 5-15 min. Total ~10-20 min. Direct execution often takes 20-30 min plus rework time when the approach proves suboptimal.
Can I iterate on a plan without starting over?
Yes. Plan mode keeps everything in one session. Reply with feedback, Claude revises. No cost except token budget.
What if the plan is wrong and I execute anyway?
You're responsible for approving. Reject the plan and iterate before execution, when iteration is free.
Does plan mode work for new features or only refactoring?
Any task with ambiguous architecture: features, library upgrades, data model changes. Anytime there are 3+ valid approaches.
Is plan mode the same as code review?
No. Code review happens after writing; plan mode validates before writing. Plan mode prevents architecturally-wrong code from being written.
Can I run plan mode locally or only in Claude Code?
Plan mode is a Claude Code feature. The API equivalent is a separate analyze-before-execute pattern in your own code.
What if my codebase is too large for plan mode?
Scope the request. "Refactor the customer domain into a microservice" not "refactor the whole monolith". Plan mode explores only the relevant parts.
Does plan mode work across git branches?
Plan on the current branch. For cross-branch coordination, plan on main, approve, execute on a feature branch. Plan mode doesn't manage branch strategy; git does.
Can I use plan mode in CI/CD pipelines?
No. Plan mode requires human approval. Only for interactive development. For automated CI/CD refactors, use direct execution with comprehensive testing.
Difference between plan mode and the -p (print) flag?
`-p` is non-interactive (CI/CD). Plan mode is interactive approval-gated. Different tools: plan mode for refactoring, -p for headless automation.
11 · Practice with AI

Work this with your AI

Work this concept hands-on with Claude Code, Codex, or claude.ai. Copy a prompt, paste it into your assistant, and practise in tandem. Each one keeps you active (explain it back, get drilled, or build) rather than just reading.

  • Drill it like the exam (scenario MCQs)
    Practice in the exam's scenario-MCQ format with trap awareness.
  • Explain it back (Feynman)
    Build durable, transferable understanding of a concept you can half-state.
  • Test me, adapting the difficulty
    Active recall practice on a concept you think you know.
  • Check my prerequisites first
    Before studying a concept that keeps not sticking.
  • Find the high-leverage 20%
    When a domain feels too big and you are short on time.
Self-check

Test yourself

Three diagnostic questions on this primitive. Reveal each answer when you have a guess. Want a full 60-question mock? Open the mock hub →

Q1Single-file null-check: should you use plan mode?
No. Plan mode has overhead. Reserve for 3+ step architectural decisions where there are multiple valid approaches and rework would be expensive. A clear bug-fix uses direct execution.
Q230-file refactor: direct execution or plan mode?
Plan mode is mandatory. Blast radius too large to wing it. Without upfront analysis, you commit to a suboptimal architecture mid-refactor and rework hours of work. Plan mode's iteration cost (milliseconds) replaces rework cost (hours).
Q3The plan looks bad. Should you execute and fix the result later?
Reject the plan and iterate (zero cost, same session). Tell Claude what's wrong; Claude revises. Executing a bad plan and reworking is expensive. Plan mode's value is in iteration cost being free, not in execution being safe.
Last reviewed: 2026-05-04·Refresh cadence: monthly
D3.2 · D3 · Agent Operations

Plan Mode, complete.

You've covered the full ten-section breakdown for this primitive, definition, mechanics, code, false positives, comparison, decision tree, exam patterns, and FAQ. One technical primitive down on the path to CCA-F.

More platforms →