Plan mode versus direct execution
What this covers
- Recognize which tasks warrant planning before changes
- Use the Explore subagent to keep discovery out of the main context
- Combine planning for investigation with direct execution for implementation
- Judge the need for planning by the cost of rework rather than by the size of the change
- Resolve an unchecked fact before planning when that fact removes one of the approaches
Key terms
- Subagent
- A separate agent given a limited task and its own context.
What each mode is for
Plan mode suits large-scale change: multi-file modifications, architectural decisions, and situations where several approaches are genuinely viable. It allows exploration and design before anything is committed to, which is what prevents expensive rework.
Direct execution suits well-scoped, well-understood change — a single validation check, a one-file bug fix with a clear stack trace.
Decide based on the cost of choosing the wrong approach
Ask: Could choosing the wrong approach cause significant rework?
A migration touching forty-five files may need little planning when the approach is already clear. A two-file change may need more planning when the available integration strategies have different infrastructure consequences.
"Two approaches look viable" isn't on its own a reason to plan, either. Sometimes only one is really available and nobody has checked — whether the upstream service supports batching, say. Planning cannot choose between an approach that works and one that cannot exist, so check the fact first.
Use Explore for broad investigation
A discovery phase produces a lot of output that matters only in aggregate. The Explore subagent isolates that verbose work and returns a summary, preserving main-conversation context — which is what prevents context exhaustion partway through a multi-phase task.
Use an Explore subagent when many files must be examined to reach one conclusion. Look up a single fact directly.
Combining them
The modes can be used in the same task. You can plan a library migration and then switch to direct execution to implement the approved approach.
Do not use Plan mode in unattended runs
Plan mode ends by presenting a plan and waiting for a person to approve it. A non-interactive run — a pipeline job, a scheduled task — has nobody attached, so nothing can approve the plan. The run waits until it times out and may delay other changes in the queue.
The investigation is still worth doing; what changes is how the run ends. Let it weigh the alternatives and finish by reporting its recommended approach as output, for a person to read afterward — same deliberation, no wait. Shortening the timeout only shortens the blockage, and still discards the plan unread.
plan modedirect executionExplore subagent
Field note — common misconceptions
- MythThat plan mode is about caution rather than about rework
- ActuallyThe question is whether you could be wrong about the approach, and what re-doing it costs.
- MythThat a large task always needs planning and a small one never does
- ActuallyA forty-five-file migration with one obvious approach can need less planning than two files.
- MythThat the two modes are exclusive across a whole task
- ActuallyPlan the approach, then execute it directly; switching within one task is the normal case.
Guided review
Review this lesson as a study deck
Review the lesson's main ideas in five guided slides, then test yourself with three flashcards.
Open Task 3.4 study deckCross-domain reasoning
Connect this idea
Project settings control coding work
Sessions, built-in tools, project instructions, skills, path rules, and execution mode determine what Claude knows and what it can do during a code change.
- 1.7 · Manage session state, resumption, and forking
- 2.5 · Select and apply built-in tools (Read, Write, Edit, Bash, Grep, Glob)
- 3.1 · Configure CLAUDE.md files with appropriate hierarchy, scoping, and organization
- 3.2 · Create and configure custom slash commands and skills
- 3.3 · Apply path-specific rules for conditional convention loading
Applied practice
Practice this lesson in a lab
Use a related lab to create a decision, implementation or diagram, evidence record, and review.
- Lab 6 · Claude Code configuration hierarchy
Place guidance, reusable procedures, scoped rules, and enforcement in the mechanism that fits each one.