Plan mode in Claude Code: agree on the plan before the agent touches code
TL;DR
In plan mode Claude only reads, explores and writes a plan; it edits no source until you approve. Use it for multi-file changes, refactors and vague requests so the agent doesn't build the wrong thing.
The most common failure with coding agents isn't syntactically wrong code; it's correctly doing something nobody needed: the agent misreads the request, edits 15 files its own way, and you lose time reverting. Claude Code's plan mode targets exactly this: Claude can read code, run exploratory commands and write a plan, but can't modify source code until you approve. This post summarises how to use plan mode per the official docs and how to make it a team habit.
Where does plan mode sit among the permission modes?
| Mode | Runs without asking | Good for |
|---|---|---|
default (Manual) | Reads only | Sensitive work where you approve every step |
acceptEdits | Reads, file edits, common filesystem commands | Fast iteration on code under review |
plan | Reading and exploring; no source edits | Understanding a codebase, agreeing direction before acting |
auto | Everything, with background safety checks | Long tasks with a clear direction |
bypassPermissions | Everything | Only in isolated containers/VMs |
Deny rules in settings always apply in every mode. Plan mode doesn't replace deny rules; it's a "think first" layer, not a security layer.
Turning on plan mode: 3 ways
- At startup:
claude --permission-mode plan. - Mid-session: press
Shift+Tabuntil the status bar shows⏸ plan mode on. Press again to leave without approving. - For one prompt: start the prompt with
/plan.
To always start in plan mode for a repo, set in .claude/settings.json:
{
"permissions": {
"defaultMode": "plan"
}
}
For the VS Code extension, the docs note it doesn't read project-level startup modes; use the user setting "claudeCode.initialPermissionMode": "plan".
The plan approval flow
When Claude finishes the plan, you can choose:
- Yes, and use auto mode (or auto-accept edits if auto isn't available): approve and let Claude work straight through.
- Yes, manually approve edits: approve the direction but still review each change.
- No, keep planning: stay in plan mode and say what to change in the plan.
Two useful details: press Ctrl+G to open the plan in your text editor and edit it directly; plans are saved in ~/.claude/plans/ (configurable with the plansDirectory setting), so you can paste them into a ticket or PR as a design doc.
A prompt for a good plan
/plan Add rate limiting to the /login API.
Requirements:
- At most 5 wrong passwords / 15 minutes / IP + username
- Use the existing Redis, no new dependencies
The plan must cover: files to change, Redis key design, how to test,
risks for users sharing an IP (offices, NAT).
Ask if anything is unclear instead of assuming.
A good plan usually includes: the files it will touch, the order of work, how to verify (which tests, which commands), and the assumptions made. If the plan lacks verification, that's a sign to "keep planning".
When to use it, when not to
| Use plan mode | Not needed |
|---|---|
| Multi-file changes, refactors, migrations | Fixing a typo, renaming a variable in one file |
| A new codebase whose architecture you don't know yet | Work where you know exactly which line to change |
| Vague requests that need scoping | Quick read commands, Q&A about code |
| Anything touching data, auth, payments | A throwaway afternoon prototype |
Risks and caveats
- A nice plan doesn't mean correct code: you still need tests and review after execution.
- Context fills up: the exploration phase reads many files. The
showClearContextOnPlanAcceptoption lets you approve the plan and clear the planning context, keeping execution lean. - Approving with auto mode: convenient but skips reviewing each edit. For sensitive code, choose manual approval.
How to apply it
- Dev: Build the habit of
Shift+Tabinto plan mode for any task touching more than 3 files. Reading a plan for 2 minutes is cheaper than reverting for 30. - Tech Lead: Set
defaultMode: "plan"for important repos. Ask for the plan (the file in~/.claude/plans/) to be attached to large PRs so reviewers understand the intent. - PM: A plan is a free technical spec: use it to check the agent understood the acceptance criteria before time goes into coding.
Sources & references
- Permission modes — Claude Code Docs
- Common workflows — Plan before editing — Claude Code Docs