Skip to content

Determine When to Use Plan Mode vs Direct Execution

This module is about choosing the right execution posture in Claude Code.

The exam will test whether you know when Claude should:

Plan first.
Explore safely.
Delegate discovery to Explore.
Then implement.

versus when Claude should simply make a small, obvious change.

Claude Code docs define plan mode as a mode where Claude researches and proposes changes without editing source files; Claude can read files and run shell commands to explore, but it does not modify source until a plan is approved. Permission prompts still apply in plan mode. (Claude)


1. Core mental model

Use this decision rule:

High uncertainty or high blast radius → Plan mode.
Low uncertainty and narrow scope → Direct execution.
Verbose discovery → Explore subagent.

Situation Best choice
Large-scale migration Plan mode
Architecture tradeoff Plan mode
Multiple valid approaches Plan mode
Multi-file refactor Plan mode
Need to inspect many files before deciding Explore subagent, often inside planning
Clear one-line or single-file fix Direct execution
Add one validation check to known function Direct execution
Fix clear stack trace in one file Direct execution
Planning done and approved Direct execution for implementation

2. What plan mode is for

Plan mode is designed for tasks where acting immediately is risky because Claude first needs to understand the codebase, compare options, and propose an approach.

Use plan mode for:

Large-scale changes
Multi-file modifications
Architectural decisions
Library migrations
Microservice restructuring
Cross-package refactors
Infrastructure-impacting choices
Tasks with multiple valid implementation strategies
Tasks where wrong direction causes costly rework

Claude Code’s docs describe plan mode as “analyze before you edit”: Claude explores and writes a plan but does not edit source files; once the plan is ready, the user can approve it, keep planning with feedback, or choose how edits should proceed. (Claude)

Example: Plan mode is appropriate

User request:

Migrate our frontend from library A to library B. It affects 45+ files, tests, and build configuration.

Why plan mode?

Large blast radius.
Multiple valid migration strategies.
Potential build/test impact.
Needs dependency analysis.
Needs staged rollout plan.
Direct edits could cause costly rework.

Strong plan-mode prompt:

Use plan mode. Investigate the current frontend library usage, identify affected packages and files, compare migration strategies, and propose a staged implementation plan. Do not edit files yet.


3. What direct execution is for

Direct execution means Claude proceeds to make the change now, using normal tool behavior and permissions, rather than first producing a formal plan.

Claude Code’s default mode asks before file edits and shell commands, while plan mode avoids editing source files until a plan is approved. (Claude)

Use direct execution for:

Small, well-scoped fixes
Single-file changes
Clear stack traces
Known target function
Obvious validation checks
Straightforward typo/import/config fixes
Adding a missing test case near existing tests

Example: Direct execution is appropriate

User request:

In parseDateRange(), reject requests where startDate is after endDate.

Why direct execution?

Clear target function.
Clear condition.
Small blast radius.
No architecture decision.
No need to compare approaches.

Strong direct-execution prompt:

Update parseDateRange() to reject ranges where startDate is after endDate. Add or update the nearest unit test, then run the targeted test.

No plan mode needed.


4. Why plan mode prevents costly rework

Plan mode is valuable when the cost of choosing the wrong approach is high.

Example:

“Replace our internal auth mechanism with OAuth across the API gateway, backend services, and frontend session handling.”

There are several possible approaches:

Adapter layer
Incremental migration
Feature flag rollout
Big-bang replacement
Hybrid compatibility layer
New auth middleware
Service-by-service migration

Direct execution may cause Claude to pick one approach too early. Plan mode lets Claude first answer:

What exists today?
What files/packages are affected?
What constraints exist?
What are the viable approaches?
Which approach has the lowest risk?
What sequence should implementation follow?
What tests and rollback steps are needed?

The exam principle:

Plan mode is not for “thinking harder” on every task. It is for reducing risk before high-impact edits.


5. Explore subagent

The official task statement specifically calls out the Explore subagent.

Claude Code includes built-in subagents, including Explore and Plan. The Explore subagent is a fast, read-only agent optimized for file discovery, code search, and codebase exploration; Write and Edit are denied. Claude delegates to Explore when it needs to search or understand a codebase without making changes, keeping exploration results out of the main conversation context. (Claude)

Use Explore when the discovery phase is likely to be verbose:

Need to inspect many files.
Need to trace architecture.
Need to find all entry points.
Need to map a subsystem.
Need to understand wrappers and aliases.
Need to collect context but not edit yet.

Anthropic’s subagent guidance says subagents operate with their own context windows and return only relevant results to the main conversation, which helps keep the main thread clean during research-heavy work. (Claude)

Example: Explore is appropriate

User request:

Before changing billing retries, understand all retry mechanisms across the codebase.

Good approach:

Use the Explore subagent to search for retry mechanisms, backoff utilities, queue retry settings, and billing-specific retry wrappers. Return a concise summary of relevant files, flows, and risks. Do not edit files.

Why not main-session discovery?

The main conversation could be flooded with search results and file contents.
The implementation context may become noisy.
A summary is more useful than raw exploration output.


6. Plan mode vs Explore subagent

These are related but not identical.

Mechanism Purpose Edits files? Best for
Plan mode Produce a proposed implementation plan before edits No, until approved High-risk or multi-step change
Explore subagent Isolated read-only discovery No Verbose codebase exploration
Direct execution Make the change now Yes, subject to permissions Small, clear edits

Plan mode often uses research internally. Current Claude Code docs say the built-in Plan subagent is used during plan mode to gather codebase context before presenting a plan, while Explore is optimized for fast read-only code search and discovery. (Claude)

Exam shortcut:

Plan mode decides what should be done.
Explore gathers context without polluting the main session.
Direct execution does the work.

7. Combining plan mode and direct execution

The official guide explicitly calls this out.

The best workflow for many complex changes is:

1. Use plan mode to investigate and design.
2. Review or revise the plan.
3. Approve the plan.
4. Use direct execution to implement the agreed approach.
5. Run tests and summarize.

Claude Code docs say that when Claude presents a plan, the user can approve and start in auto mode, approve and accept edits, approve while reviewing each edit manually, keep planning with feedback, or refine the plan before proceeding. (Claude)

Example: Library migration

Prompt 1:

Use plan mode. Investigate how date-fns is used across the repo and propose a migration plan to Luxon. Include affected files, risk areas, testing strategy, and whether the migration should be staged.

After plan approval:

Execute phase 1 of the approved plan: migrate the shared date utility package only, update tests, and run the targeted test suite.

This is better than:

Immediately replace every date-fns import across the repo.

8. Direct execution examples

Example A: single validation check

Request:

Add a check that rejects negative quantities in validateCartItem().

Best choice:

Direct execution.

Reason:

One known function.
Clear business rule.
Small change.
Nearby tests likely exist.


Example B: clear stack trace

Request:

The stack trace points to src/api/orders.ts line 142. Fix the null pointer when order.customer is missing.

Best choice:

Direct execution.

Reason:

Clear file and likely failure point.
No architecture decision.
No need for extensive planning.

Example C: typo or import fix

Request:

Fix the broken import in CheckoutButton.test.tsx.

Best choice:

Direct execution.

Reason:

Small, local, obvious.

9. Plan mode examples

Example A: microservice restructuring

Request:

Split billing responsibilities out of the monolith into a new billing service.

Best choice:

Plan mode.

Reason:

Architecture implications.
Multiple services.
Data ownership questions.
Deployment and rollback strategy.
Likely many files.

Example B: library migration affecting many files

Request:

Replace Enzyme with React Testing Library across all frontend tests.

Best choice:

Plan mode, likely with Explore.

Reason:

Many files.
Different test patterns.
Potential helper utilities.
Need staged migration.

Example C: choosing an integration approach

Request:

Integrate payments. Decide whether we should use direct API calls, webhooks, or a queue-based worker.

Best choice:

Plan mode.

Reason:

Multiple valid approaches.
Infrastructure implications.
Reliability and failure-mode tradeoffs.
Architectural decision.

10. Explore subagent examples

Example A: subsystem map

Request:

Find all places where entitlement checks happen and summarize the flow.

Best choice:

Explore subagent.

Reason:

Discovery-heavy.
May require many Grep/Read calls.
Useful output is a summary, not raw file dumps.


Example B: before plan mode

Request:

Plan a migration from REST endpoints to GraphQL for the account service.

Best choice:

Plan mode, with Explore/Plan subagent research.

Reason:

Claude needs discovery before designing.
The main conversation should stay focused on plan review.

Example C: codebase-wide analysis before direct fix

Request:

Before fixing retry behavior, check whether we already have a shared backoff utility.

Best choice:

Explore subagent or targeted Grep/Read depending on expected size.

If this is a large codebase, use Explore. If it is a small repo, direct Grep/Read in the main conversation may be enough.

Anthropic’s subagent guidance also cautions that subagents carry overhead and are not worthwhile for small or tightly sequential tasks. (Claude)


11. Exam decision framework

When choosing plan mode, direct execution, or Explore, ask these questions:

1. Is the target file/function already known?
   Yes → likely direct execution.
   No → maybe Explore or plan mode.

2. Is the change small and unambiguous?
   Yes → direct execution.
   No → plan mode.

3. Are there multiple valid approaches?
   Yes → plan mode.

4. Does the task affect many files or packages?
   Yes → plan mode.

5. Is discovery likely to require many file reads/searches?
   Yes → Explore subagent.

6. Would raw discovery output pollute the main session?
   Yes → Explore subagent.

7. Has a plan already been approved?
   Yes → direct execution for the planned phase.

12. Common exam traps

Trap 1: Using plan mode for trivial changes

Scenario:

Add a missing null check in one function with a clear stack trace.

Wrong:

Use plan mode and produce a multi-phase design.

Right:

Direct execution.

Why:

Small, clear, low-risk.

Trap 2: Direct execution for architectural change

Scenario:

Restructure authentication across frontend, API, and gateway.

Wrong:

Start editing files immediately.

Right:

Use plan mode first.

Why:

High blast radius and multiple design choices.

Trap 3: Main conversation flooded with discovery

Scenario:

Claude reads dozens of files to understand a subsystem before planning.

Wrong:

Keep all exploration in the main session.

Right:

Use the Explore subagent for discovery and return a concise summary.

Why:

Preserves main conversation context.

Trap 4: Treating plan mode as implementation

Wrong assumption:

Plan mode will make the edits.

Correct:

Plan mode explores and proposes changes. Edits begin only after plan approval and mode transition.

Trap 5: Planning forever

Wrong:

Keep refining plans for a small bug fix.

Right:

When the plan is sufficiently clear, execute the next scoped phase.

Plan mode is a risk-reduction tool, not a replacement for implementation.


13. Prompt templates

Plan mode prompt

Use plan mode. Investigate the current implementation, identify affected files, compare viable approaches, and propose a step-by-step implementation plan. Do not edit files yet. Include risks, test strategy, and a recommended first phase.

Direct execution prompt

Make the targeted change in [file/function]. Keep the scope limited to this behavior, update the nearest test if needed, run the targeted test, and summarize the change.

Explore subagent prompt

Use the Explore subagent to investigate [subsystem/behavior]. Search for entry points, wrappers, tests, and related utilities. Do not edit files. Return a concise summary of relevant files, flows, and risks.

Combined prompt

Use plan mode and delegate verbose discovery to Explore where useful. First map the affected areas, then propose a staged implementation plan. After I approve the plan, implement only phase 1.

14. Scenario-based practice questions

Question 1

A team wants to migrate from one React testing library to another across 60 test files. Several helper utilities may need to change.

What should Claude use first?

A) Direct execution
B) Plan mode
C) Write
D) A single Edit call

Answer

B. This is a large migration with many affected files and possible strategies. Plan first, then implement in phases.


Question 2

A bug report includes a stack trace pointing to one function, and the fix is to add a missing null check.

What is the best approach?

A) Plan mode
B) Direct execution
C) Explore subagent with very thorough search
D) Dynamic multi-agent workflow

Answer

B. The change is small, clear, and well-scoped. Direct execution is appropriate.


Question 3

Claude needs to understand every place where entitlement checks happen before designing a refactor. The codebase is large.

What should Claude use for the discovery phase?

A) Explore subagent
B) Write
C) Direct execution only
D) Force an edit

Answer

A. This is verbose codebase discovery. Explore keeps search results and file-reading noise out of the main session and returns a summary.


Question 4

A task has three valid implementation options, each with different infrastructure requirements.

What is the best first step?

A) Pick the first approach and edit immediately.
B) Use plan mode to compare approaches before editing.
C) Use Write to create new files.
D) Run formatting.

Answer

B. Multiple valid approaches and infrastructure tradeoffs are strong signals for plan mode.


Question 5

A developer asks Claude to rename a local variable in one function.

What should Claude do?

A) Use plan mode.
B) Use direct execution.
C) Spawn multiple Explore subagents.
D) Produce an architecture decision record.

Answer

B. This is a trivial, local, well-scoped change.


Question 6

Claude is in plan mode and has presented a plan. The user approves phase 1.

What should happen next?

A) Claude should remain in plan mode forever.
B) Claude should start implementing the approved phase according to the selected permission mode.
C) Claude should discard the plan.
D) Claude should refuse to edit.

Answer

B. After plan approval, Claude exits plan mode and proceeds according to the user’s selected approval option. (Claude)


Question 7

A task is to restructure authentication across frontend session handling, API middleware, and gateway routing.

What is the best choice?

A) Direct execution
B) Plan mode
C) Edit the first auth file found
D) Use Glob only

Answer

B. This has architectural implications and affects multiple components. Plan mode prevents premature edits.


Question 8

Claude starts reading dozens of files in the main conversation to understand a subsystem. The session becomes noisy and later implementation decisions are influenced by irrelevant details.

What should have been used?

A) Explore subagent
B) Write
C) tool_choice: any
D) Bash only

Answer

A. Explore isolates verbose discovery and returns a concise summary, preserving main conversation context.


Question 9

A user asks:

Add a date validation conditional to validateRange().

There is no ambiguity about the desired behavior.

Best response?

A) Use plan mode to compare date libraries.
B) Directly implement the validation and nearest test.
C) Spawn a research subagent.
D) Propose a microservice redesign.

Answer

B. This is a small, well-understood change. Direct execution is appropriate.


Question 10

A team wants to replace synchronous order processing with an event-driven queue. The change affects retries, idempotency, observability, and deployment order.

What should Claude do?

A) Directly edit the order controller.
B) Use plan mode and likely Explore for codebase discovery.
C) Use a single Edit.
D) Skip tests.

Answer

B. This has architectural implications, multiple valid approaches, and a broad blast radius. Plan mode is the right first step.


15. Final D3.4 checklist

Memorize this:

1. Plan mode is for complex, risky, multi-step changes.
2. Direct execution is for simple, clear, well-scoped changes.
3. Use plan mode when there are multiple valid approaches.
4. Use plan mode for architecture decisions.
5. Use plan mode for large migrations and multi-file refactors.
6. Plan mode explores and proposes; it does not edit source files before approval.
7. Direct execution is fine for a single validation check or clear stack-trace bug.
8. Explore is a read-only subagent for code search and discovery.
9. Use Explore when discovery would flood the main conversation.
10. Explore returns summaries instead of raw exploration noise.
11. Plan mode and Explore can be combined.
12. Plan first, then execute approved phases directly.
13. Do not use plan mode for every small change.
14. Do not directly execute high-blast-radius architectural changes.
15. Use the mode that matches uncertainty, scope, and risk.

D3.4 mental model

Direct execution answers: “Can we safely make this now?”
Plan mode answers: “What should we do before changing anything?”
Explore answers: “What context do we need, without polluting the main session?”

The exam’s favorite distinction is:

Small and obvious → direct execution. Large, uncertain, architectural, or multi-file → plan mode. Verbose discovery → Explore subagent.