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:
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:
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:
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:
8. Direct execution examples
Example A: single validation check
Request:
Best choice:
Reason:
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:
Reason:
Example C: typo or import fix
Request:
Best choice:
Reason:
9. Plan mode examples
Example A: microservice restructuring
Request:
Best choice:
Reason:
Architecture implications.
Multiple services.
Data ownership questions.
Deployment and rollback strategy.
Likely many files.
Example B: library migration affecting many files
Request:
Best choice:
Reason:
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:
Reason:
Multiple valid approaches.
Infrastructure implications.
Reliability and failure-mode tradeoffs.
Architectural decision.
10. Explore subagent examples
Example A: subsystem map
Request:
Best choice:
Reason:
Example B: before plan mode
Request:
Best choice:
Reason:
Example C: codebase-wide analysis before direct fix
Request:
Best choice:
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:
Wrong:
Right:
Why:
Trap 2: Direct execution for architectural change
Scenario:
Wrong:
Right:
Why:
Trap 3: Main conversation flooded with discovery
Scenario:
Wrong:
Right:
Why:
Trap 4: Treating plan mode as implementation
Wrong assumption:
Correct:
Trap 5: Planning forever
Wrong:
Right:
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:
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.