3.4 Plan mode vs direct execution
| Plan mode | Direct execution | |
|---|---|---|
| Designed for | Large-scale changes, multiple valid approaches, architectural decisions, multi-file modifications | Simple, well-scoped changes |
| Value | Safe exploration and design before committing to changes; prevents costly rework | Speed |
| Examples | Monolith → microservices, library migration touching 45+ files, choosing between integration approaches with different infrastructure requirements | Single-file bug fix with a clear stack trace, adding one date-validation conditional |
- "Start direct and switch to plan mode if unexpected complexity appears" — the complexity is already stated in the requirements; it is not something that might emerge.
- "Direct execution with comprehensive upfront instructions" — assumes you already know the right structure without exploring the code.
- "Let the implementation reveal the natural boundaries" — risks costly rework when dependencies surface late.
Combine the two: plan mode for investigation, then direct execution for the planned implementation.
The Explore subagent
Use Explore for verbose discovery phases: it isolates the discovery output and returns a summary, preserving the main conversation's context. This is the defence against context exhaustion during multi-phase tasks.
Quiz
- Question 1
You have been assigned to restructure a monolithic application into microservices. This involves changes across dozens of files and requires decisions about service boundaries and module dependencies. Which approach should you take?
- Question 2
Two tasks land in the same sprint. Task A is a NullPointerException with a stack trace pointing at one line in one file, reproducible from an existing unit test. Task B replaces the HTTP client library across 45 files, where the two candidate libraries differ in connection pooling and retry semantics. How should each be approached?
- Question 3
You are about to plan a migration in a repository you do not know. Discovery will mean reading a great many files, and you want the planning discussion itself to happen with a clean context. Which combination is right?
- Question 4
A ticket asks for a date-range validation: reject requests where the end date precedes the start date, in one named handler, with an error message the ticket specifies and an existing test fixture to extend. Which mode fits, and why?