Domain 3: Claude Code Configuration & Workflows (20%)Lesson 16 of 30

3.4 Plan Mode vs Direct Execution

3.4.1 Look Before You Leap — Sometimes

When you give Claude Code a task, it can take one of two stances. It can dive straight in and start changing files — direct execution. Or it can first explore the codebase, think through approaches, and propose a plan WITHOUT touching anything — plan mode. Task Statement 3.4 is about choosing correctly between them, and the key insight is that the choice hinges on something specific that's easy to get wrong.

Here's the analogy. If your kitchen tap is dripping and you know exactly which washer to replace, you just do it — direct execution. But if you're renovating the whole kitchen — moving plumbing, choosing a layout, deciding where appliances go — you'd be reckless to start swinging a hammer before you have a plan. You'd measure, sketch options, and decide on an approach first. Plan mode is that measure-and-sketch phase: Claude reads and analyzes the codebase and proposes an approach, but makes no changes until you approve.

The trap — and the single most important idea in this lesson — is what actually triggers plan mode. People assume it's about DIFFICULTY: hard task → plan mode, easy task → just do it. That's wrong. The real trigger is AMBIGUITY and scope: how many valid approaches are there, how many files will change, are there architectural decisions to make? A genuinely HARD bug with one clear fix is direct execution; an EASY-sounding change that touches the architecture in several possible ways needs plan mode. Difficulty and ambiguity are different axes.

The trigger is ambiguity/scope, not difficultyDirect executionclear scope, one approachsingle-file, known fixeven a HARD but clear bugPlan modemultiple valid approachesmulti-file / architecturalexplore & propose, no edits yet

Choose by ambiguity and scope, not difficulty: a clear single-approach change (even a hard one) is direct execution; multiple valid approaches or multi-file/architectural work wants plan mode.

ℹ️

The one idea to hold onto

Plan mode explores and proposes an approach WITHOUT modifying files; direct execution makes the change directly. The choice is about AMBIGUITY and scope (how many valid approaches, how many files, architectural decisions), NOT about difficulty.

3.4.2 When to Use Each

Let's make the decision concrete. PLAN MODE is for tasks with large scope or open design questions: large-scale or architectural changes, situations with multiple valid approaches, multi-file work that needs a consistent strategy, or anything requiring real codebase exploration before you commit. In plan mode Claude reads and analyzes safely, then proposes — so you catch a bad approach BEFORE it's written into dozens of files, avoiding costly rework.

DIRECT EXECUTION is for well-scoped, well-understood changes: a single-file bug fix with a clear stack trace, adding one validation check, a change where the approach is obvious and the blast radius is small. Reaching for plan mode here would just add ceremony to something you could simply do.

TaskModeWhy
Restructure a monolith into microservicesPlan modeArchitectural, dozens of files, many valid approaches
Library migration affecting 45+ filesPlan mode (then execute)Needs a consistent strategy across many files
Fix a null-pointer bug with a clear stack traceDirect executionSingle file, clear scope, known fix
Add a date-validation conditional to one functionDirect executionWell-defined, small blast radius

Plan mode for architectural/multi-approach/multi-file work; direct execution for well-scoped, known changes. Note a hard-but-clear bug is still direct execution.

There's also a HYBRID worth knowing: plan THEN execute. A library migration is the classic case — you use plan mode to design the migration approach (which is genuinely ambiguous and spans many files), then switch to direct execution to apply the agreed plan file-by-file. Plan for the thinking, execute for the doing.

3.4.2 — Key Concept

Plan mode: large-scale/architectural changes, multiple valid approaches, multi-file consistency, or needed exploration. Direct execution: single-file, clear-scope, known-approach changes (even hard ones). Hybrid: plan the approach, then execute it file-by-file (e.g. a library migration).

3.4.3 Plan Mode and the Explore Subagent

Plan mode connects to something from Domain 1: subagents and context preservation. When Claude plans a non-trivial change, it often needs to UNDERSTAND the codebase first — and that exploration can be verbose, pulling in lots of file contents. If all that discovery output landed in the main conversation, it would bloat the context before the real work even started.

That's where the Explore subagent comes in (you met the built-in subagents in Domain 1.3). During plan mode, Claude can delegate the verbose discovery phase to the Explore subagent, which reads and searches in its OWN isolated context and returns only a concise summary. The main conversation gets the understanding without the clutter — the same context-isolation benefit from Lesson 1.3, now serving the planning phase. This is why plan mode plus Explore is a powerful pairing for multi-phase tasks: you preserve main-context budget for the actual implementation.

ℹ️

3.4.3 — Key Concept

During plan mode, Claude can use the Explore subagent to isolate verbose discovery output — Explore reads and searches in its own context and returns a summary, preserving the main conversation's context for the real work (the context-isolation benefit from Domain 1.3).

3.4.4 The Exam Traps

The 3.4 traps almost all stem from one confusion: mistaking difficulty for the trigger, or hesitating to commit to plan mode when complexity is already stated. Anchor on 'ambiguity and scope decide, not difficulty.'

The signature trap: a task is described as clearly large and architectural (restructure a monolith, a 45-file migration), and one tempting answer says 'start with direct execution and switch to plan mode only if you hit unexpected complexity.' That's wrong — the complexity is ALREADY STATED in the requirements, so you choose plan mode UP FRONT. Waiting to discover complexity you've already been told about risks exactly the costly rework plan mode exists to prevent. Conversely, don't over-apply plan mode: a single-file fix with a clear stack trace is direct execution, even if the underlying bug is hard to understand.

Tempting (✗)Correct (✓)
Start direct, switch to plan if complexity emergesIf complexity is stated, choose plan mode up front
Hard bug → plan mode (because it's hard)A clear single-fix bug → direct execution, despite difficulty
Plan mode for a one-line validation changeDirect execution — well-scoped, known
Direct execution for a 45-file migrationPlan mode (then execute) — multi-file strategy

The recurring error is treating difficulty as the trigger or deferring plan mode when scope is already known. Decide on ambiguity and scope, up front.

⚠️

3.4.4 — Exam Trap

When complexity/scope is already stated (architectural change, many files, multiple approaches), choose plan mode UP FRONT — reject 'start direct, switch later.' And don't use difficulty as the trigger: a hard-but-clear single-file fix is direct execution.

3.4.5 Put It Together: Choose the Right Mode

You now know the plan-vs-direct decision, the ambiguity-not-difficulty trigger, the hybrid pattern, and how the Explore subagent supports planning. The exercise has you classify tasks and feel the difference between the two stances.

3.4.5 — Build Exercise (30 min)

(1) Take three tasks and classify each: a single-file null-pointer fix (direct), a 45-file library migration (plan, then execute), and a feature with multiple valid implementation approaches (plan). (2) Run the migration as a hybrid: use plan mode to design the approach, then direct execution to apply it. (3) During the planning of a larger task, observe Claude using the Explore subagent to gather context and note how it keeps verbose discovery out of the main conversation. (4) Deliberately pick the wrong mode (direct execution on the architectural task) and observe the rework risk.

Plan mode is about HOW to approach a task. The next lesson, 3.5, is about how to ITERATE when Claude's first attempt isn't right — the refinement techniques that turn a rough result into a correct one.

ℹ️

Where this shows up on the exam

3.4 questions describe a task and ask plan vs direct. Decide on ambiguity and scope (multiple approaches / many files / architectural → plan; single-file, known → direct), choose up front when complexity is stated, and never use difficulty as the trigger.

Key Takeaways

  • Plan mode explores the codebase and proposes an approach WITHOUT modifying files; direct execution makes the change directly.
  • The trigger is AMBIGUITY and scope (how many valid approaches, how many files, architectural decisions), NOT difficulty — a hard but clearly-scoped fix is still direct execution.
  • Plan mode fits large-scale/architectural changes, multiple valid approaches, multi-file consistency, and tasks needing exploration; direct execution fits single-file, clear-scope, known changes.
  • Hybrid pattern: plan the approach, then execute it file-by-file — the classic case is a library migration affecting many files.
  • During plan mode, Claude can delegate verbose discovery to the Explore subagent, which works in its own context and returns a summary — preserving the main conversation's context.
  • Signature trap: choosing 'start direct, switch to plan if complexity emerges' when the complexity is already stated — choose plan mode UP FRONT instead.
  • Don't over-apply plan mode either: a one-line, well-scoped change is direct execution.

Check Your Understanding

Test what you learned in this lesson.

Q1.You're assigned to restructure a monolithic application into microservices — changes across dozens of files and decisions about service boundaries and dependencies. Which approach should you take?

Q2.What actually determines whether to use plan mode versus direct execution?

Q3.You have a single-file bug with a clear stack trace and an obvious fix, though the bug is conceptually tricky. Which mode?

Q4.During plan mode for a large task, how does Claude gather codebase context without bloating the main conversation?

Practice This Lesson