Claude Code Plan Mode vs Direct Execution and Iterative Refinement
👋 In plain words: For a small fix you just want Claude to make the change. For a big change, letting it edit 40 files before you agree on the approach is risky. This lesson shows when to plan first, when to act directly, and how to steer Claude when its first attempt isn't what you meant.
Choosing the right working mode saves hours of rework. The exam tests when to plan first, when to just make the change, and how to steer Claude when its output isn’t what you meant (Task Statements 3.4 and 3.5).
🔑 Key terms
- Plan mode: Claude explores and proposes a plan without changing any files until you approve.
- Direct execution: Claude makes the change straight away.
- Explore subagent: A helper that does noisy searching separately and returns only a summary.
- Iterative refinement: Improving the result step by step, using examples, tests or questions.
- Interview pattern: Asking Claude to question you first, so hidden requirements come out early.
📖 The story in this lesson
Ravi has two jobs: fix a typo in an error message, and move ShopNest's whole test suite from Selenium to Playwright, which touches about 60 files.
💡 Think of it like this
Plan mode is an architect's drawing before builders start: cheap to change on paper, expensive once walls are up. Direct execution is fixing a squeaky hinge: you just do it.
🗺️ Plan mode or direct execution?
| Plan mode | Direct execution |
|---|---|
| Large-scale or multi-file changes (e.g. a library migration touching 45+ files) | Clear, well-scoped changes |
| Architectural decisions (monolith → microservices) | Single-file bug fix with a stack trace |
| Several valid approaches to compare | Adding one validation check |
Combine them: plan the migration, agree the approach, then execute the plan directly.
🌍 Real-world example: Typo now, migration after a plan
The typo is one line in one file, so Ravi uses direct execution and it's done in seconds. For the Playwright migration he uses plan mode. Claude proposes the order (shared fixtures first, then page objects, then tests), and Ravi corrects it before a single file changes.
🤖 The Explore subagent
Explore isolates verbose discovery (file listings, grep output) and returns a summary, preserving the main conversation’s context during multi-phase tasks.
🌍 Real-world example: Mapping 60 files without flooding the chat
Before planning the migration, Claude needs to know where Selenium is used. The Explore subagent runs the searches separately and returns a one-page summary, so the main conversation stays focused on the plan.
🔄 Iterative refinement techniques
- Concrete input/output examples — when prose descriptions are interpreted inconsistently, give 2–3 examples of input and expected output.
- Test-driven iteration — write tests first (including edge cases and performance), then iterate by sharing failures.
- The interview pattern — ask Claude to question you first in unfamiliar domains, surfacing issues like cache invalidation and failure modes.
- Interacting vs independent issues — put interacting problems in one detailed message; fix independent ones one at a time.
🌍 Real-world example: Showing beats telling
Ravi's prose description of the test-naming style keeps being misunderstood. He gives two examples of input and expected output, and Claude gets it right first time. For the date-parsing helper, he writes failing tests first and shares each failure with Claude until all of them pass.
login_with_bad_password -> test_login_rejects_bad_password
cart_empty_checkout -> test_checkout_blocked_when_cart_empty🛠️ Try it yourself (about 10 minutes)
- In Claude Code, ask for a one-line change directly, such as fixing a comment.
- Then switch to plan mode and ask for a plan to rename a function used in several files.
- Read the plan and correct one step before approving.
✅ You are done when: the small fix is done directly, and the rename happens only after you approved a plan.
🧪 Exam-Style Practice Questions
Try these before opening the answers. They use the same scenario style as the real exam.
Question 1. Which tasks suit plan mode? (Choose two)
- A. Restructuring a monolith into services
- B. Renaming a local variable
- C. Choosing between two message-queue integrations with different infrastructure needs
- D. Adding a single
ifvalidation - E. Fixing a typo in a log message
Show answer
Answer: A, C. Architectural, multi-approach work. B, D and E are clear, scoped changes suited to direct execution.
Question 2. You're building a caching layer in a domain you don't know well. Which technique surfaces the considerations you haven't thought of?
- A. The interview pattern: have Claude ask you questions before implementing
- B. Direct execution
- C. Few-shot examples
- D.
/compact
Show answer
Answer: A. Claude's questions surface invalidation, consistency and failure modes. B jumps straight to code. C needs known examples. D is irrelevant.
Question 3. Three bugs interact: fixing the parser changes the validator's input, which changes the formatter. How should you raise them?
- A. One at a time, in separate messages
- B. Only the first; the rest will resolve themselves
- C. Through three parallel sessions
- D. All in one detailed message, explaining the interactions
Show answer
Answer: D. Interacting issues need a joint fix. A and C suit independent issues. B is wishful thinking.
📝 Assignment
Do these tasks in order. Each one has a Done when check, so you know when it is complete. The stretch task is optional but close to what the exam expects from an architect. Keep your answers in one notes file or Git repository, and revisit them in your final week of revision together with the cheat sheet in the last lesson of this course.
- Task 1: Do a one-line fix in direct execution and a ten-file rename in plan mode, and compare the experience.
✅ Done when: You wrote two sentences comparing time spent and rework for the two modes. - Task 2: Give Claude two input and output examples for a data transformation and compare the result with a prose-only request.
✅ Done when: The example-driven request gives the expected output on the first or second try, and you noted how many tries prose needed. - Stretch: start an unfamiliar feature with the interview pattern and list the questions Claude asked you.
✅ Done when: You listed at least three questions Claude asked and one design change they led to.
❓ Frequently Asked Questions
🤔 When should I use plan mode in Claude Code?
For large, multi-file or architectural changes and when there are several valid approaches to compare.
🤔 When is direct execution better?
For clear, scoped changes such as a single-file bug fix with a stack trace.
🤔 What is the Explore subagent for?
It runs noisy discovery in isolation and returns a summary, keeping the main context clean.
🤔 What is the interview pattern?
Asking Claude to question you before building, so it surfaces design issues you had not considered.
🏁 Summary
- Plan for architecture and multi-file work; act directly on clear, scoped fixes.
- Explore keeps discovery noise out of the main context.
- Examples and tests beat longer prose instructions.
Next, continue with Claude Code in CI/CD: -p Flag, JSON Output and Automated PR Review.
Independent study material by SQA Tools. Not affiliated with, endorsed by or sponsored by Anthropic. Claude is a trademark of Anthropic. Mock questions are original practice items, not real exam content. Exam facts checked against Anthropic's official exam guides and certification FAQ on 11 November 2026.