Plan Mode
Claude CodeDefinition
A Claude Code execution mode for exploration and analysis before making changes. Claude reads and analyzes but does not write files or execute commands. Use when requirements are ambiguous, multiple valid approaches exist, or decisions have significant architectural implications.
Example Usage
Enter plan mode before a monolith-to-microservices migration to explore service boundaries and surface risks before committing to any changes.
In Depth
Plan mode is a read-only execution mode in Claude Code that separates the exploratory, analytical phase of a task from the implementation phase. In plan mode, the model can read files, search the codebase, run read-only commands, and reason about what changes would be needed — but it cannot write files, edit code, or execute commands with side effects. The session remains in this constrained state until you explicitly exit plan mode and approve the proposed approach.
The value of this separation is architectural clarity under uncertainty. Complex refactoring tasks, system migrations, and multi-file changes involve a set of interdependent decisions: which files need to change, in what order, what the ripple effects are, and where the risks lie. Attempting all of this in a single pass — reading, deciding, and writing simultaneously — means committing to implementation details before the full picture is understood. Plan mode forces a deliberate pause: explore first, decide second, implement third.
From a team workflow perspective, plan mode creates a natural review checkpoint. The model produces a written plan — a list of proposed changes, the reasoning behind each, and the risks it identified — which a human can review and refine before any files are touched. This is particularly valuable in codebases where a wrong assumption early in a refactor can cascade into hours of untangling.
Plan mode also interacts with skills and subagents. A skill can be authored to enter plan mode automatically for tasks that match certain patterns (e.g., any task that involves schema changes or public API modifications), giving teams a repeatable workflow that enforces review for high-stakes operations. Pairing plan mode with iterative-refinement — where each planning cycle tightens the proposal before committing — is a common advanced pattern for large-scale changes.
The context: fork option and plan mode address different problems and are often combined. context: fork handles context pollution; plan mode handles premature commitment to implementation. A skill that uses both runs its entire analysis in an isolated context and returns a clean plan without modifying anything — the ideal starting point for a careful change.
| Mode | Reads files | Writes files | Runs commands | Use when |
|---|---|---|---|---|
| Direct execution | Yes | Yes | Yes | Requirements are clear and scope is small |
| Plan mode | Yes | No | Read-only | Requirements are ambiguous or stakes are high |
| context: fork | Yes | Configurable | Configurable | Context pollution is the concern |
For the CCA-F exam, the key distinction is between plan mode (enforces read-only behavior at the session level) and context: fork (isolates context at the skill level). They can coexist but serve different purposes. The Plan Mode vs Direct Execution concept page covers the tradeoffs that exam questions draw on when presenting scenarios where the wrong mode choice leads to avoidable rollbacks or missed edge cases.
How It Compares
| Characteristic | Plan Mode | Direct Execution | context: fork |
|---|---|---|---|
| Can read files | Yes | Yes | Yes |
| Can write files | No | Yes | Configurable via allowed-tools |
| Scope | Entire session | Entire session | Single skill invocation |
| Purpose | Prevent premature writes | Normal operation | Prevent context pollution |
| Requires human approval to proceed | Yes (exit plan mode) | No | No |
| Discards working context | No | No | Yes |
How It's Tested & Common Confusions
Exam questions typically present a scenario — a large refactor, an ambiguous requirement, a high-stakes migration — and ask which Claude Code feature should be used before implementation begins. Plan mode is the answer when the concern is "making changes before the full picture is understood." Distractor answers often include context: fork (wrong layer) or structured output flags (unrelated to execution mode).
Frequently Asked Questions
How do you exit plan mode in Claude Code?
Plan mode is exited explicitly — either by the user approving the plan and instructing Claude Code to proceed, or via a skill that transitions from planning to execution as a defined workflow step. The exact UI gesture (a slash command, a keyboard shortcut, or a natural language instruction) depends on your Claude Code version and configuration.
Does plan mode prevent all shell commands or just writes?
Plan mode prevents commands with side effects — writes, deletes, network mutations. Read-only shell commands (listing files, grepping content, running test discovery without executing tests) are permitted because they don't change state. The model can still build a complete picture of the codebase; it just can't act on it until you approve.