3.4 Plan Mode vs Direct Execution
What You Need to Know
Section titled “What You Need to Know”Claude Code works in two main modes. In plan mode, Claude reads the codebase, analyses dependencies and proposes an approach without modifying any files. In direct execution, Claude skips the planning phase and makes changes straight away. Clear criteria decide which mode fits a task.
This lesson uses one made-up example throughout: a wedding venue whose booking system has four jobs. Two are small: a date bug with a clear stack trace and a change to the deposit rate. Two are bigger: a payment provider with two possible connections and a swap of the logging library across 30 files.
Plan Mode: When to Use It
Section titled “Plan Mode: When to Use It”Plan mode is for complex tasks where you need to explore the codebase, evaluate multiple approaches and design a strategy before making changes. For each of these tasks, you need to understand the existing code before the first edit. Use it when:
- Large-scale changes are involved. Restructuring a monolith into microservices, reorganising a module system or refactoring a core abstraction all require understanding the existing structure before changing it.
- Multiple valid approaches exist. Different integration architectures, for example, have different infrastructure requirements. You need to evaluate the approaches before you choose one.
- Architectural decisions are required. Service boundaries, module dependencies and API contracts have consequences for later work. Planning prevents costly rework.
- Multi-file modifications are needed. A library migration affecting 45+ files requires a consistent strategy. Without a plan, you risk applying the migration inconsistently across files.
- Codebase exploration is necessary. You need to understand dependencies, trace data flows or map the existing structure before changing anything.
At the venue, plan mode fits the payment job and the logging swap.
You switch into plan mode rather than ask for it. There are three ways to switch:
- start the session with
claude --permission-mode plan - press Shift+Tab during a session until the status bar shows plan mode on
- prefix a single prompt with
/plan
Claude then writes nothing to disk until you approve the plan. Writing “in plan mode” into the body of a prompt does nothing. /plan at the start of a prompt switches to plan mode.
Direct Execution: When to Use It
Section titled “Direct Execution: When to Use It”Direct execution is for well-understood changes with clear, limited scope. Use it when:
- The change is well-scoped. A single-file bug fix with a clear stack trace. Adding a date validation conditional. Updating a configuration value.
- The correct approach is already known. You know what needs to change, where and how. There is no design decision to make.
- The scope is limited. One function, one file, one clear modification.
A plan resolves design decisions. A simple, well-defined task has no design decisions, so planning adds nothing. The venue’s date bug and deposit rate are such tasks: the fix for each is known.
The Explore Subagent
Section titled “The Explore Subagent”The Explore subagent keeps verbose discovery output out of the main conversation. On multi-phase tasks, exploring produces file listings, dependency graphs, code excerpts and analysis notes. When that output stays in the main conversation, it fills the context window and degrades later responses.
The Explore subagent:
- Runs the exploration in isolation
- Produces summaries of its findings
- Returns those summaries to the main conversation
- Keeps the main context window free for the implementation work
Use the Explore subagent when discovery is verbose but implementation needs focused context. Mapping the venue files that import the old logging library is one such discovery.
The Hybrid Approach: Plan Then Execute
Section titled “The Hybrid Approach: Plan Then Execute”A common combination is plan mode to investigate, then direct execution to implement. The pattern has two phases:
- Plan phase: Use plan mode to explore the codebase, understand dependencies, evaluate approaches and design the implementation strategy.
- Execute phase: Switch to direct execution and implement the planned approach file by file. The strategy is already decided.
When you decide the pattern once, every file gets the same change. The venue’s logging migration across 30 files splits into these two phases:
- Plan: Identify all files that import the old library. Map the API differences between the old and new libraries. Design the migration pattern. Check for edge cases.
- Execute: Apply the migration pattern to each file using the planned approach.
Decision Framework Summary
Section titled “Decision Framework Summary”| Task characteristics | Mode |
|---|---|
| Architectural restructuring | Plan mode |
| Library migration (many files) | Plan mode (then direct execution) |
| Multiple valid implementation approaches | Plan mode |
| Codebase exploration needed | Plan mode (with Explore subagent) |
| Single-file bug fix with clear stack trace | Direct execution |
| Adding a validation check to one function | Direct execution |
| Configuration value update | Direct execution |
| Known fix, known location, known approach | Direct execution |
Recognising Complexity Upfront
Section titled “Recognising Complexity Upfront”Do not start in direct execution and wait for complexity to appear. When the requirements already say that the task is complex, such as “restructure the monolith into microservices”, choose plan mode straight away. That complexity will not emerge later. It is already in the task description. A venue request to split the booking system into separate services is that case.
In the exam
Section titled “In the exam”The exam tests whether you can pick the right mode for a given task. The plan-then-execute hybrid is common, and the exam expects you to spot it: plan mode first and then direct execution, not one mode or the other. A common trap is the late switch from direct execution to plan mode.
Plan mode is part of Domain 3, which carries 20% of the marks. No other Anthropic exam gives Claude Code that much weight, so this exam is the closest thing to a Claude Code certification.
Exam Traps
Section titled “Exam Traps”Sources
Section titled “Sources”- Claude Code Plan Mode Documentation — Anthropic
- Claude Code Permission Modes — Plan mode — Anthropic
- Claude Certified Architect Foundations Exam Guide — Task Statement 3.4 — Anthropic
- Claude Certified Architect Foundations Exam Guide — Sample Question 5 — Anthropic
- CCAR-F Exam Guide v1.0: Task Statement 3.4 — Anthropic
Exam Simulator
Section titled “Exam Simulator”Five exam-style multiple-choice questions on Plan Mode vs Direct Execution. Pick an answer, then open the explanation.
Question 1
Section titled “Question 1”Your team faces three tasks: (1) restructure a monolith into microservices, (2) fix a null pointer exception in a single function with a clear stack trace, (3) migrate from one logging library to another across 30 files. Which mode should be used for each?
- A. Plan mode for all three, since they all involve code changes
- B. Plan mode for (1) and (3), direct execution for (2)
- C. Plan mode for (1), direct execution for (2) and (3)
- D. Direct execution for all three with comprehensive upfront instructions
Answer & explanation
Correct: B
- A is wrong: Task 2 is a well-understood, limited-scope bug fix with a clear stack trace. Plan mode adds no value when the problem, location, and solution are all clear.
- B is correct: Task 1 involves architectural decisions with multiple valid service boundary options – plan mode is essential. Task 3 affects 30 files and needs a consistent migration strategy designed before execution. Task 2 is a single-function fix with a clear stack trace – direct execution is appropriate.
- C is wrong: Task 3 affects 30 files with API differences between the old and new library. Without planning the migration pattern first, you risk inconsistent application across files and missing edge cases.
- D is wrong: Task 1 requires codebase exploration to understand dependencies before restructuring. Comprehensive upfront instructions assume you already know the right structure without exploring.
Question 2
Section titled “Question 2”A developer is tasked with migrating a date library across 25 files. They plan to use plan mode to design the migration strategy, then switch to direct execution to apply it file by file. What is this approach called?
- A. Incremental execution with checkpoints
- B. Sequential plan mode
- C. Staged deployment behind feature flags
- D. The hybrid plan-then-execute pattern
Answer & explanation
Correct: D
- A is wrong: Incremental execution is not a defined Claude Code pattern in the exam material.
- B is wrong: Sequential plan mode is not a defined concept. Plan mode is one phase; direct execution is the other.
- C is wrong: Staged deployment refers to deployment strategies, not Claude Code execution modes.
- D is correct: The hybrid pattern uses plan mode for investigation and design, then direct execution for implementing the planned approach. This is the documented name for combining both modes.
Question 3
Section titled “Question 3”During a multi-phase codebase analysis, the Explore subagent produces a dependency map, identifies patterns, and analyses 50 files. The main conversation receives only a summary. Why is this isolation important?
- A. The Explore subagent can access files that the main session cannot
- B. The Explore subagent runs on a more powerful model better suited for analysis
- C. Verbose discovery output would fill the main conversation’s context window
- D. Isolation prevents the analysis from modifying any source files
Answer & explanation
Correct: C
- A is wrong: The Explore subagent does not have special file access. It has the same access as the main session.
- B is wrong: The Explore subagent uses the same model. Its purpose is output isolation, not model selection.
- C is correct: Context window preservation is the primary purpose. Without isolation, extensive file listings, dependency graphs, and code excerpts fill the context window. Subsequent implementation responses degrade because relevant context is pushed out by verbose exploration output.
- D is wrong: Plan mode prevents modification, not the Explore subagent specifically. The Explore subagent’s purpose is context isolation.
Question 4
Section titled “Question 4”A colleague suggests starting with direct execution for a feature that requires restructuring the authentication module across 15 files. They argue they can switch to plan mode if complexity becomes apparent. Is this approach correct?
- A. No, the scope is already known, so plan mode belongs at the start
- B. Yes, starting lean with direct execution and escalating to plan mode if needed is always best practice
- C. Yes, because 15 files is below the threshold that requires plan mode
- D. No, because you should always use plan mode for any task, regardless of scope
Answer & explanation
Correct: A
- A is correct: The requirements explicitly state restructuring across 15 files. This is a multi-file architectural change with known complexity. Plan mode should be chosen upfront to explore dependencies and design the approach before making changes.
- B is wrong: When complexity is already stated in the requirements (restructuring, 15 files, cross-module), waiting for surprises is the wrong approach. The complexity is known, not speculative.
- C is wrong: There is no fixed file-count threshold. The decision is based on ambiguity and whether multiple valid approaches exist, not a magic number of files.
- D is wrong: Plan mode for every task wastes time on well-defined, limited-scope changes.
Question 5
Section titled “Question 5”Which of the following tasks is most appropriate for direct execution without a planning phase?
- A. Extracting a shared utility module used by 12 different services
- B. Evaluating three different caching strategies for an API endpoint
- C. Fixing a typo in a configuration file that causes a deployment failure
- D. Migrating database access patterns from callbacks to async/await across the project
Answer & explanation
Correct: C
- A is wrong: A shared utility used by 12 services requires understanding all consumers before extraction. Plan mode is needed to map dependencies.
- B is wrong: Evaluating three strategies involves comparing approaches with different tradeoffs. This is architectural decision-making that requires plan mode.
- C is correct: A typo fix in a configuration file is well-scoped, well-understood, and has no ambiguity. The problem is known, the location is known, and the fix is obvious.
- D is wrong: Migrating patterns across the project is a multi-file change requiring a consistent strategy. Plan mode designs the migration; direct execution applies it.