Domain 3 · Lesson 3 · Claude Code Config (20%)
Plan Mode vs Direct Execution
Task Statement 3.4 — matching mode to task complexity, and the Explore subagent.
Course progress: Domain 3 ▸ lesson 3 of ~4
Plan mode is for when getting it wrong is expensive. Direct execution is for when the scope is obvious. The exam gives you a scenario and asks you to pick.
The decision
| Use PLAN mode when… | Use DIRECT execution when… |
| Large-scale changes | Simple, well-scoped change |
| Multiple valid approaches | One obvious approach |
| Architectural decisions | No architectural impact |
| Multi-file modifications | Single-file, clear scope |
| e.g. monolith→microservices, a migration touching 45+ files, choosing between integration approaches | e.g. a single-file bug fix with a clear stack trace, adding one date-validation conditional |
Why plan mode
It enables safe exploration and design before committing to changes, preventing costly rework when dependencies surface late. If the complexity is already stated in the requirements (e.g., "restructure into microservices"), you go to plan mode now — not "start direct and switch if it gets hard."
Combine the two
Real workflows mix them: plan mode to investigate and design a library migration, then direct execution to implement the agreed approach. Planning and doing are different phases, not competing choices.
The Explore subagent
Context protection
Verbose discovery (reading many files to understand a system) can exhaust the main context window. The Explore subagent isolates that verbose discovery and returns a summary, preserving the main conversation's context for coordination. Reach for it during multi-phase tasks with heavy exploration.
Check yourself
You're told to restructure a monolith into microservices — dozens of files, decisions about service boundaries and dependencies. The right approach is to:
- Enter plan mode to explore, map dependencies, and design first
- Start direct execution and let boundaries emerge as you change code
- Use direct execution with detailed upfront instructions per service
- Begin direct and switch to plan mode only if complexity appears
Correct: option 1. Large-scale, multi-approach, architectural work is exactly plan mode's purpose. Option 2 risks late-discovered rework; option 3 assumes the structure is already known; option 4 ignores that the complexity is stated up front, not emergent.
A multi-phase task keeps exhausting context because understanding the system requires reading many files. The tool designed to mitigate this is:
- Plan mode, which prevents any files from being read at all
- The
/compact command run automatically after every file read
- The Explore subagent, isolating discovery and returning a summary
- A larger max_tokens setting to hold all file contents in context
Correct: option 3. The Explore subagent isolates verbose discovery and returns a summary, protecting main context. Plan mode still reads files; /compact is a manual compression, not discovery isolation; bigger token limits don't isolate exploration.
Decision rules
Complex/architectural/multi-file/multi-approach → plan mode. Simple, clear-scope, single-file → direct. Investigate then build → plan then direct. Verbose discovery threatening context → Explore subagent.
Ask your teacher. Want the exact boundary — e.g., is a 3-file change "plan" or "direct"? Ask; it depends on approach-ambiguity, not just file count.