What you will be able to do
- Explain what plan mode allows and blocks, and how it differs from the other permission modes
- Decide whether a task needs plan mode or direct execution, based on its scope, its architectural reach and how many valid approaches it has
- Explain why exploring and designing in plan mode, before any edit, prevents expensive rework
- Use the Explore subagent to keep verbose discovery output out of the main conversation during a multi-phase task
- Sequence a large change as a planned investigation followed by direct implementation
Key concept
Plan mode — Plan mode is a permission mode in which Claude can read and investigate the codebase freely and propose a plan, but cannot edit files until you approve that plan. It separates deciding how to make a change from making it.
1.What plan mode allows and what it holds back
Every Claude Code session runs in a permission mode, and plan mode is one of them. The mode decides which actions run without asking you. In plan mode, Claude reads files, searches and traces code paths, then writes up a proposed plan. It does not touch your source files. You can start a session in this mode with claude --permission-mode plan, or move into it partway through with Shift+Tab in the CLI. VS Code and Desktop each have a mode selector that does the same job.
claude --permission-mode planPlan mode feels smooth for that reason. Claude can open dozens of files and run read-only searches with no prompt for each one, because none of that changes anything. When auto mode is available, plan mode also lets through commands that the classifier has approved. Edits are the line it holds: nothing gets written until you approve the plan. When you approve it, you decide how implementation runs, so the session moves to an editing mode only because you switched it. It never changes mode on its own partway through.
| Mode | What runs without asking | Best for |
|---|---|---|
| default | Reads only | Reviewing every action yourself, sensitive work |
| acceptEdits | Reads, file edits, and common filesystem commands (mkdir, touch, mv, cp, etc.) | Iterating on code you’re reviewing |
| plan | Reads, plus classifier-approved commands when auto mode is available | Exploring a codebase before changing it |
| auto | Everything, with background safety checks | Long tasks, reducing prompt fatigue |
| bypassPermissions | Everything | Isolated containers and VMs only |
Reads are not exempt from every check. They pass in plan mode because the mode allows them, not because a global exemption exists. Some prompts survive in every mode. Suppose the permissions.blockReadsOutsideWorkingDirectories setting is on: a recognised file-reading Bash command that targets a path outside the working directories still prompts, even in auto and bypassPermissions. Explicit ask rules prompt in every mode too.
Checkpoint 1 of 7· Fill the gap
A library migration will touch about 45 files, and there are several valid ways to do it. You want Claude to explore the codebase and propose a design, with no source file edited until you approve that design. Which value completes the command?
claude --permission-mode ? Plan mode is the one for exploring before you change anything. Claude reads and traces code freely and writes up a plan, but Claude Code blocks edits until you approve it. acceptEdits and bypassPermissions let edits through without asking. default asks before each edit, but it gives you no plan to review first.
Source: code.claude.comCheckpoint 2 of 7· Exam question
A team lead has two tasks for Claude Code this week: migrating a payments library across 45 files to a new integration approach with several valid designs, and adding a null check to one function where a stack trace pinpoints the bug. Which mode choice best fits these tasks?
Correct answer: A — Plan mode to design the 45-file library migration first, then direct execution for the one-function null check
- A. Correct. Plan mode lets Claude read files and propose a plan without editing, which suits a migration touching dozens of files with open design choices, where exploring first prevents costly rework. The one-function null check has a clear scope and a known stack trace, so direct execution is appropriate and a planning phase would add overhead for no benefit.
- B. Incorrect. This reverses the fit. A migration across 45 files with design choices benefits from read-only exploration and a reviewed plan before any edit, while a single-function fix with a clear stack trace is well-scoped and does not need a separate planning phase.
- C. Incorrect. Plan mode is valuable for large, ambiguous or multi-file work, but applying it to a small well-scoped fix adds a planning step with little value. The exam-relevant judgment is matching the mode to the task's scope and uncertainty, not reviewing every change identically.
- D. Incorrect. Exploring and designing before editing is exactly what reduces costly rework on large, architecturally significant changes. Skipping it for a 45-file migration with several valid approaches risks committing to an approach that has to be undone later.
2.Choosing between plan mode and direct execution
Choose plan mode when the task needs a decision before it needs edits. Look for four signs. The change is large-scale. More than one approach could work. The change has architectural consequences. Or it spans many files that must end up consistent with each other. Restructuring a monolith into microservices shows all four: shared data models, service boundaries and deployment topology all move, and there are several reasonable ways to split the code. A library migration that touches 45 or more files does too. So does choosing between two integration approaches with different infrastructure requirements, even if the code that follows the choice is small.
Choose direct execution when the scope is already known. Typical cases are a single-file bug fix with a clear stack trace, or adding one date-validation conditional to one function. Planning would only repeat what the prompt already says. The work here goes into the prompt: name the file, the scenario and the expected result. For bugs, give Claude the command that reproduces the issue and produces the stack trace. A session in default or acceptEdits mode then makes the change, and you review it.
| Task | Approach | Deciding factor |
|---|---|---|
| Split a monolith into three services | plan | Several valid splits; boundaries and data models are architectural |
| Migrate a library used across 45+ files | plan | One conversion pattern must be settled before any file changes |
| Pick between two integration approaches with different infrastructure | plan | The choice itself is the hard part |
| Fix a bug in one file with a clear stack trace | direct | Location and cause are already known |
| Add a date validation check to one function | direct | Single, well-scoped change |
Getting this wrong usually costs you a second pass. Suppose a migration runs directly from the first file. Nothing settles the conversion pattern in advance, so it gets decided file by file. The early files come out one way. After Claude has seen more of the codebase, the later files come out another way, and someone has to reconcile them. Plan mode prevents this. The whole codebase is explored and one pattern is agreed while edits are still blocked, so every file is converted the same way.
Plan mode makes exploration safe, because investigation and design both happen while edits are blocked. Claude can read the affected modules, trace call paths and weigh alternatives, and the only output is a proposal. A wrong direction then costs a correction to the plan instead of a revert of a diff. That is the rework plan mode exists to prevent: a flawed approach caught in the plan takes one message to fix, while the same flaw found after a dozen files have changed means rewinding and redoing them. The exploration is also what makes the plan trustworthy, since the approach is proposed from what Claude actually found in the code rather than from assumptions about it.
Other modes cannot stand in for the design step. acceptEdits removes prompts for edits, so Claude starts changing code before any boundaries are agreed. Writing the intended layout into CLAUDE.md and approving edits one by one in default mode still makes you judge a large redesign one piece at a time. Running headless in CI with bypassPermissions is worse still: that mode is meant for isolated containers and VMs, and the design only gets reviewed after the code already exists.
Checkpoint 3 of 7· Check yourself
Your team must decide whether a new payments integration should use a webhook receiver or a polling worker. The two need different infrastructure, but either way the code change will be fewer than 30 lines. How should you run this task in Claude Code?
You pick plan mode because of the decision involved, not the size of the diff. When there are competing approaches with different infrastructure needs, Claude should explore and get a design approved while edits are still blocked. Approving edits one by one, or reviewing a PR afterwards, means judging the design only after the code is written.
“Explore before changing anything | claude --permission-mode plan | None | Claude Code blocks edits until you approve a plan”Source: code.claude.com
Checkpoint 4 of 7· Exam question
A team lead reviewing a completed library migration finds that early file conversions used one pattern, while later files in the same migration used a different, incompatible pattern, forcing a second pass to reconcile them. Which earlier decision most likely caused this outcome?
Correct answer: D — The migration was executed directly from the start instead of first exploring the codebase in plan mode to settle on one pattern
- A. Using the Explore subagent to catalog patterns beforehand is a preventive step, not a cause of the described inconsistency; it would have helped surface the pattern variation earlier.
- B. Planning first and then executing the approved steps is the recommended sequence for a migration like this and would tend to prevent the inconsistency, not cause it.
- C. Combining the migration with an unrelated framework upgrade would add scope, but the described problem is inconsistent conversion patterns, which stems from skipping upfront investigation, not from scoping choices about a second upgrade.
- D. Correct. Without first exploring the codebase and settling on one approach in plan mode, direct execution can lock in whatever pattern is discovered first, leading to inconsistent conversions once different patterns are found partway through the work.
Checkpoint 5 of 7· Exam question
A platform team is restructuring a monolith into three microservices, touching shared data models, service boundaries, and deployment topology, with several viable ways to split the code. Before any files are changed, which approach should the architect direct Claude Code to take?
Correct answer: B — Use plan mode so Claude reads through the code and drafts a proposed split for review, with file edits held back until the plan is approved
- A. Accept-edits mode applies file edits without a prompt, so Claude would start changing files before any split has been compared. Several viable splits exist and nothing may change yet, so the first extraction would fix a boundary that later services must work around.
- B. Correct. Plan mode keeps Claude read-only while it explores the code and drafts a proposed split. No files change until the plan is approved. That fits a multi-file restructuring with several viable ways to split the code, where the design must be settled before editing begins.
- C. CLAUDE.md gives Claude standing context, but it does not make Claude explore or compare alternatives. Describing a layout up front commits to one split before the options are investigated. Approving each edit in default mode still lets file changes begin before any design has been reviewed.
- D. A headless CI run with bypassPermissions skips permission prompts and starts editing files at once. The pull request is reviewed only after the work is done, so a poor split is found after it has spread across the code. No design is agreed before the first change.
3.Keeping discovery out of the main context with the Explore subagent
The planning phase of a big task is where context fills up fastest. Cataloguing every call site of a library across a large codebase means reading a great many files, and each read adds to the conversation. Recall also gets worse as the context grows, so a session that has filled its window with search output does worse when it reaches implementation. In general terms, verbose research belongs in a separate context; see Delegating verbose exploration to protect main context. What follows is how that works during plan-mode discovery.
Claude Code has a built-in Explore subagent for this kind of work. Its job is file discovery, code search and codebase exploration. It has read-only tools, with Write and Edit denied, so it cannot change anything while it looks. It runs in its own context window. The large file reads stay there, and only a summary returns to the main conversation. When a plan-mode investigation needs a wide sweep, such as finding every usage pattern before choosing a migration approach, Claude can send that sweep to Explore and plan from the summary. Claude Code also has a built-in Plan subagent, which is read-only as well and whose purpose is codebase research for planning.
Only the subagent's final message, a concise summary of what it found. The intermediate tool calls and the contents of those 80 files stay inside the subagent's own context window, so the main session keeps its room for the plan and the implementation.
Checkpoint 6 of 7· Check yourself
Midway through planning a multi-phase migration, Claude has to find every usage pattern of the old library across hundreds of files before it can propose an approach. You want the main session to keep enough context for the plan and the implementation that follows. What should happen to this discovery sweep?
Explore runs discovery in a separate context window with read-only tools. The large file reads stay there, and only a summary comes back to the main conversation, so the main session still has room for planning and implementation. Disabling Explore puts all those reads into the main context. Skipping discovery means the pattern gets decided file by file. Default mode doesn't prompt for reads, so switching to it doesn't shrink the context at all.
“a subagent handles the research in its own separate context window, so the large file reads stay out of yours.”Source: code.claude.com
4.Plan the investigation, then implement directly
Most large tasks use both approaches, one after the other. The investigation runs in plan mode: which files need to change, what the flow looks like, which approach to take. Once you approve the plan, implementation runs as direct execution against it. Take adding Google OAuth. The first prompt asks "I want to add Google OAuth. What files need to change?" and asks for a plan. After approval, the next prompt says "implement the OAuth flow from your plan", followed by writing tests, running the suite and committing.
There are good reasons to switch modes at the boundary. Plan mode is for reviewing changes before they reach disk, and once the plan is approved that review has happened. Staying in plan mode would block the edits the plan calls for. Switching to an editing mode lets the work go ahead without asking again about decisions already made. A long migration can also outlast the context window. When the session compacts, the plan written in plan mode is re-injected from disk, so the agreed pattern is still there for the later files.
Some tasks need no plan phase at all. A pre-approved fix in a CI pipeline, such as changing one timeout value to a value already specified, has no approach left to choose. It runs non-interactively with a tight allowlist, in the mode meant for locked-down CI and scripts.
Checkpoint 7 of 7· Put it in order
Put these steps for adding Google OAuth to an existing app in the order the plan-then-execute workflow runs them.
- 1.In plan mode, ask Claude which files need to change and what the session flow is, and have it create a plan
- 2.Commit with a descriptive message and open a PR
- 3.Switch to an editing mode and ask Claude to implement the OAuth flow from its plan
- 4.Have Claude write tests for the callback handler, run the test suite and fix any failures
- 5.Review and approve the plan while edits are still blocked
The investigation and design come first, in plan mode, and edits stay blocked until you approve the plan. After approval, you switch to an editing mode and the plan is carried out directly: implementation, then tests, then the commit. Staying in plan mode would block the edits the plan calls for.
“implement the OAuth flow from your plan. write tests for the callback handler, run the test suite and fix any failures.”Source: code.claude.com
Sources
(9)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://code.claude.com/docs/en/permission-modesOfficial docs
“Switch permission modes with Shift+Tab in the CLI, the mode indicator in VS Code, or the mode selector in Desktop.”
↩︎ What plan mode allows and what it holds back“Claude Code blocks edits until you approve a plan”
↩︎ What plan mode allows and what it holds back“recognized file-reading Bash commands prompt even in auto mode and bypassPermissions mode”
↩︎ What plan mode allows and what it holds back“Exploring a codebase before changing it”
↩︎ Choosing between plan mode and direct execution“Isolated containers and VMs only”
↩︎ Choosing between plan mode and direct execution“Locked-down CI and scripts”
↩︎ Plan the investigation, then implement directly“Claude Code blocks edits until you approve a plan”
↩︎ Key concept“recognized file-reading Bash commands prompt even in auto mode and bypassPermissions mode”
↩︎ Exam trap 1“Exploring a codebase before changing it”
↩︎ Exam trap 2“Isolated containers and VMs only”
↩︎ Exam trap 3“Reads only”
↩︎ Prediction“Explore before changing anything | claude --permission-mode plan | None | Claude Code blocks edits until you approve a plan”
↩︎ Checkpoint“Exploring a codebase before changing it”
↩︎ Prediction - 2.
“Plan: Claude explores and proposes a plan without editing your source files”
↩︎ What plan mode allows and what it holds back“Accept edits: Claude edits files and runs common filesystem commands like mkdir and mv without asking, still asks for other commands”
↩︎ Choosing between plan mode and direct execution - 3.https://code.claude.com/docs/en/costsOfficial docs
“Claude explores the codebase and proposes an approach for your approval, preventing expensive re-work when the initial direction is wrong.”
↩︎ Choosing between plan mode and direct execution“Claude explores the codebase and proposes an approach for your approval, preventing expensive re-work when the initial direction is wrong.”
↩︎ Exam trap 4 - 4.https://code.claude.com/docs/en/common-workflowsOfficial docs
“Tell Claude the command to reproduce the issue and get a stack trace”
↩︎ Choosing between plan mode and direct execution“Plan before editing to review changes before they touch disk”
↩︎ Plan the investigation, then implement directly - 5.https://code.claude.com/docs/en/best-practicesOfficial docs
“Scope the task. Specify which file, what scenario, and testing preferences.”
↩︎ Choosing between plan mode and direct execution“I want to add Google OAuth. What files need to change?”
↩︎ Plan the investigation, then implement directly“implement the OAuth flow from your plan.”
↩︎ Plan the investigation, then implement directly“implement the OAuth flow from your plan.”
↩︎ Exam trap 5“implement the OAuth flow from your plan. write tests for the callback handler, run the test suite and fix any failures.”
↩︎ Checkpoint - 6.https://code.claude.com/docs/en/sub-agentsOfficial docs
“Purpose: file discovery, code search, codebase exploration”
↩︎ Keeping discovery out of the main context with the Explore subagent“Tools: read-only tools; Write and Edit are denied”
↩︎ Keeping discovery out of the main context with the Explore subagent“Purpose: codebase research for planning”
↩︎ Keeping discovery out of the main context with the Explore subagent“To remove only the built-in Explore and Plan subagents, set CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS=1.”
↩︎ Keeping discovery out of the main context with the Explore subagent - 7.https://code.claude.com/docs/en/context-windowOfficial docs
“a subagent handles the research in its own separate context window, so the large file reads stay out of yours”
↩︎ Keeping discovery out of the main context with the Explore subagent“The plan Claude wrote in plan mode | Re-injected from disk”
↩︎ Plan the investigation, then implement directly“a subagent handles the research in its own separate context window, so the large file reads stay out of yours.”
↩︎ Checkpoint - 8.https://code.claude.com/docs/en/agent-sdk/subagentsOfficial docs
“only its final message returns to the parent.”
↩︎ Keeping discovery out of the main context with the Explore subagent - 9.
“as the number of tokens in the context window increases, the model’s ability to accurately recall information from that context decreases.”
↩︎ Keeping discovery out of the main context with the Explore subagent