Curriculum › Claude Code Configuration & Workflows · 20% of the exam

Plan mode vs direct execution

What you’ll be able to do

  • Select plan mode for tasks with architectural implications, multiple valid approaches, or wide multi-file impact
  • Select direct execution for well-understood changes with clear scope
  • Use the Explore subagent to keep verbose discovery output out of the main conversation
  • Combine plan mode for investigation with direct execution for implementation

What you need to know

What plan mode is for

Plan mode lets Claude explore the codebase and design an approach before committing to any changes. It reads, traces dependencies, weighs options, and proposes a plan for you to review. It doesn't edit files while it does this. The value is in avoiding rework: finding out in the third hour that the service boundary you picked splits a shared transaction is much more expensive than finding it out while planning.

Plan mode is designed for tasks with these characteristics:

  • Large-scale changes — a library migration that touches 45 or more files, for example.
  • Multiple valid approaches — when the right answer depends on tradeoffs you haven't evaluated yet.
  • Architectural decisions — service boundaries, module dependencies, data ownership.
  • Multi-file modifications whose interactions need to be understood before the first edit.

Typical cases: restructuring a monolith into microservices; migrating from one library to another across dozens of files; choosing between two integration approaches with different infrastructure requirements, such as webhooks that need a public endpoint versus polling a queue that needs a worker.

What direct execution is for

Direct execution is the right default for simple, well-scoped changes, where you already know what to change and where:

  • A single-file bug fix where the stack trace points at the failing line.
  • Adding one validation check to one function, such as a date-range conditional.
  • A rename or small refactor confined to one module.

Planning these adds a step without reducing risk, because there's nothing to explore and only one reasonable approach. The judgment goes both ways: plan mode on a trivial fix is overhead, and direct execution on an architectural change is a gamble.

Read the complexity from the task, not from surprises

Two instincts the exam treats as wrong:

  • "Start directly and let the implementation reveal the design." On a restructuring task, the design is the hard part. Discovering service boundaries by editing code means unwinding edits when a dependency shows up late.
  • "Start directly and switch to plan mode if it gets complicated." When the task description already says dozens of files and boundary decisions, the complexity is known. There's no reason to wait for it to surprise you.

A third instinct is also wrong: writing very detailed upfront instructions for direct execution. That assumes you already know the right structure without having explored the code. Plan mode exists to do that exploration.

The Explore subagent: keep discovery out of the main context

Discovery is verbose. Tracing every caller of a deprecated API, reading dozens of files to map a subsystem, searching for every configuration that sets a flag: each step produces large amounts of output that matter only until you have the answer. In a multi-phase task (discover, then plan, then implement) that output can fill the main conversation's context window before implementation begins.

The Explore subagent handles this. It runs the discovery in its own context and returns a summary to the main conversation: the list of call sites, the dependency map, the three places the flag is set. The bulky intermediate reads stay in the subagent's context. The main session keeps the conclusions and still has room for the later phases.

before — discovery runs inline in the main session
Main session: grep 300 matches → read 40 files → trace callers → context nearly full before planning starts → early findings crowded out during implementation
after — Explore subagent does discovery, returns a summary
Explore subagent: grep, read, trace (in its own context) Main session receives: "47 call sites in 31 files; 3 use the deprecated callback form (file:line list); 2 wrap it in retries"

Combine them: plan, then execute

Plan mode and direct execution aren't exclusive choices for the whole task. Usually the best workflow uses both in sequence: plan mode for investigation and design, then direct execution for implementation. For a library migration, use plan mode (with the Explore subagent for the call-site discovery) to find every usage, decide how to handle the awkward cases, and agree on an order. Then switch to direct execution and carry out the approved plan. Staying in plan mode once the approach is settled just delays the work. Skipping the plan on a 45-file migration risks a half-finished change that has to be backed out.

Key concept

Plan when the task has architectural implications, multiple valid approaches, or wide multi-file impact. Execute directly when scope is clear. Use the Explore subagent so verbose discovery returns as a summary, and for big changes plan first, then execute the plan.

The task description usually tells you which mode fits. "Dozens of files," "decide service boundaries," or "choose between approaches" points to plan mode. "The stack trace points to line 42" points to direct execution.

Practice scenario

ScenarioYou need to migrate the codebase from a deprecated HTTP client library to its replacement. A quick search suggests it's used in about 50 files across six services, some through a shared wrapper and some directly, with a few using an older callback-based form. In an earlier attempt, a teammate's session ran out of context partway through just cataloguing the usages.
Work it through, then open this

This is a plan-mode task: about 50 files, several usage patterns, and a decision about how to handle each one. Start in plan mode and use the Explore subagent for the cataloguing, so the hundreds of search hits and file reads stay in its context and the main session gets a summary: usages grouped by pattern, with file:line references. That directly addresses the context exhaustion your teammate hit. Use the plan to decide whether to migrate the shared wrapper first, how to convert the callback form, and in what order to update the services. Once the plan is approved, switch to direct execution and implement it, service by service.

Build exercise — Match the mode to three tasks

Intermediate · 35 min

What you’ll learn

  • Recognizing the task characteristics that call for plan mode
  • Seeing what the Explore subagent keeps out of the main context
  • Running a plan-then-execute workflow end to end
  1. Write down three real or realistic tasks: a single-file bug fix with a clear stack trace, a multi-file library migration, and a new feature with two valid implementation approaches. Label each plan mode or direct execution before you start.

    • Why: The choice should come from the task’s stated characteristics, not from how the work happens to go.
    • You should see: Direct execution for the bug fix, and plan mode for the migration and the feature.
  2. For the migration, run the usage discovery once inline in the main session and once through the Explore subagent, and compare what’s left in the main context.

    • Why: This makes the context cost of verbose discovery visible.
    • You should see: A long trail of search and read output inline, compared with a short summary of findings from the Explore subagent.
  3. Finish the migration with plan mode for the design, then switch to direct execution to implement the approved plan.

    • Why: This is the plan-then-execute combination the exam expects for large changes.
    • You should see: A reviewed plan listing files and ordering, followed by implementation that follows it without re-exploring.

Exam traps

Starting a large restructuring in direct execution and letting the code “reveal” the design

Dependencies found late force costly rework. Plan mode explores and designs before any changes are committed.

Planning a one-line, well-understood fix that has a clear stack trace

Direct execution suits simple, well-scoped changes. Planning adds overhead without reducing risk.

Writing exhaustive upfront instructions instead of exploring the codebase first

Detailed instructions assume you already know the right structure. Plan mode is how you find it out.

Waiting to switch to plan mode until complexity appears, when the task already states it

If the task already says dozens of files and architectural decisions, the complexity is known. Plan from the start.

Running long discovery inline until the main context is exhausted, instead of using the Explore subagent

The Explore subagent isolates verbose discovery output and returns a summary, which preserves the main conversation’s context for later phases.

Staying in plan mode through implementation after the approach has already been decided

Plan to investigate and design, then switch to direct execution to implement what was planned.

Sources

  • Claude Code Docs
  • Anthropic, Claude Certified Architect – Foundations Exam Guide v1.0 (July 2026)

Quick check

A developer with no caching experience asks Claude to put a cache in front of a slow pricing service. They're unsure how stale prices are allowed to be, or what should happen if the cache goes down. What is the best way to begin?