Guide · Coding agents
Claude Code plan mode: plan first, then edit
Plan mode is a Claude Code permission mode for research before changes. Claude reads files, runs commands to explore and writes a plan, but doesn’t edit your source until you approve it. Press Shift+Tab until the status bar shows ⏸ plan mode on, type /plan followed by a task, or start with claude --permission-mode plan.
By Tahir NazirUpdated 10 min read
On this page
- What is plan mode in Claude Code?
- How do I turn on plan mode? Shift+Tab, /plan and --permission-mode
- What can Claude do in plan mode, and what is blocked?
- How do you approve, edit or reject a plan?
- When should you use plan mode?
- Plan mode vs the other permission modes
- Does plan mode save tokens? opusplan and the Plan subagent
- Questions people ask
What is plan mode in Claude Code?
Plan mode is one of Claude Code’s permission modes, the settings that decide what Claude may do without asking. In the docs’ words, it “tells Claude to research and propose changes without making them”: Claude reads files, runs shell commands to explore and writes a plan, but doesn’t edit your source. When the plan is ready, Claude presents it and asks how to proceed.
Shift+Tab cycle
defaultAsks before edits and commandsacceptEditsEdits without askingplanResearches, proposes, no editsbypassPermissionsOnly if enabled at launchautoOnly if available
From auto, the first press goes to default. On some Windows terminals the shortcut is Alt+M.
Inside plan mode
1 · Research
- Reads and searches files
- Runs read-only commands
- Other commands need approval (or the auto mode check)
2 · Plan
- Writes the plan to a file
- Ctrl+G opens it in your editor
3 · You choose
- Yes: switch to auto mode or auto-accept edits
- Yes, approve each edit manually
- No, keep planning
Source files stay untouched until you approve. The exception: if you launched with bypass permissions available, Claude Code doesn’t enforce the block.
The point is a checkpoint. You see the approach (which files, in what order, what tests) while changing it costs a sentence, not a rewrite. It suits work you don’t yet understand: an unfamiliar codebase, a change across many files, or a bug whose cause isn’t obvious.
How do I turn on plan mode? Shift+Tab, /plan and --permission-mode
- Shift+Tab cycles the modes:
default→acceptEdits→plan, thenbypassPermissionsandautoif they’re available. Fromauto, the first press goes todefault. The status bar shows⏸ plan mode on. Press Shift+Tab again to leave without approving a plan. - Alt+M does the same on Windows when the terminal’s runtime doesn’t enable VT input mode, which is when Shift+Tab doesn’t register.
- `/plan` enters plan mode from the prompt. Add a description to start straight away:
/plan fix the auth bug. - `claude --permission-mode plan` starts a session in plan mode. The flag overrides
defaultModefrom settings files. - `defaultMode` in settings makes plan mode the default for every session in a project (shown below). In the VS Code extension, set
claudeCode.initialPermissionModetoplaninstead, because the extension doesn’t read project settings for this. In the desktop app, picking Plan applies to the current session only.
# Start a session in plan mode
claude --permission-mode plan
# Or, inside any session, plan one task
/plan add rate limiting to the login endpoint{
"permissions": {
"defaultMode": "plan"
},
"plansDirectory": "./plans"
}plansDirectory is optional: it puts plan files in your project (a path relative to the project root) instead of the default ~/.claude/plans, which is handy if you want to review or commit them. The Claude Code settings builder writes and checks this file for you.
What can Claude do in plan mode, and what is blocked?
Reading is allowed and editing is blocked. Shell commands depend on your setup, and the docs give the rules in order (the first that applies wins):
| Your session | What happens to a command |
|---|---|
| Bypass permissions available (launched with it allowed) | No check and no prompt: Claude Code doesn’t enforce plan mode’s blocks |
Auto mode available, useAutoModeDuringPlan on (the default) | The auto mode classifier reviews commands; approved ones run, rejected ones are blocked. Critical-path removals are left out of this |
| Anything else | Commands outside the built-in read-only set ask for your approval |
From Claude Code’s permission modes docs, 2026-10-16.
Without an interactive terminal the blocks always hold: in -p runs, Agent SDK sessions and the VS Code extension’s chat panel. On Enterprise, API and cloud-provider accounts, the classifier calls made during planning count toward your token usage. Inside the session, Claude often hands the research to the built-in Plan subagent: read-only tools, your session’s model, and a separate context window, so the exploration doesn’t fill yours. Our subagents guide covers it and the other built-ins.
How do you approve, edit or reject a plan?
When Claude finishes, it shows the plan and offers these choices. Approving exits plan mode and switches the session to the mode the option names:
| Option | What it does |
|---|---|
| “Yes, and use auto mode” | Approve and continue in auto mode. Reads “Yes, auto-accept edits” where auto mode isn’t available, or offers bypass permissions if that was enabled at launch |
| “Yes, manually approve edits” | Approve, then review and approve each edit yourself |
| “No, keep planning” | Stay in plan mode and tell Claude what to change |
| “Yes, clear context and …” (optional) | Approve, clear the conversation and implement from the plan alone. Off unless you set showClearContextOnPlanAccept |
From the permission modes and settings reference docs, 2026-10-16. Accepting a plan also gives an unnamed session a title based on the plan.
To change the plan yourself, press Ctrl+G: it opens the proposed plan in your default text editor, and Claude proceeds from your edited version. The clear-context option is worth turning on for long research: the docs warn that planning can use a lot of context, and the option shows how much of yours the planning used. If a session fills up anyway, see Prompt is too long.
When should you use plan mode?
Use it when getting the direction wrong would be expensive. Anthropic’s cost docs put it plainly: plan mode suits complex tasks because it prevents “expensive re-work when the initial direction is wrong”. Skip it for small, obvious edits, where the plan would be longer than the change.
| Plan first | Just ask |
|---|---|
| A change across many files, or a new feature | Renaming a variable, fixing a typo |
| Code you or Claude haven’t seen before | A file you’ve just been working on together |
| A bug with an unclear cause | A failing test with an obvious fix |
| Migrations, auth, billing: anything risky to redo | Throwaway scripts |
A worked example: explore, plan, then code
- Run
/plan add rate limiting to the login endpoint. Claude reads the routes, middleware and tests, and may delegate the search to the Plan subagent. - Read the plan. Ask questions (“why a new middleware instead of the existing limiter?”) and choose No, keep planning until it matches what you want, or press Ctrl+G and edit it.
- Choose Yes, manually approve edits for risky code, so you review each change, or the auto option for routine work.
- Ask Claude to run the tests. For a big plan, the clear-context option, or saving the plan and running
/clear, starts the implementation with the plan and none of the exploration.
Put the rule in your project instructions if you always want it for some code, for example “Use plan mode before changing anything under src/billing/.” Our guide on how to write CLAUDE.md explains where such rules go.
Plan mode vs the other permission modes
Plan mode is the only mode built for proposing rather than doing. The others differ in how much Claude may do without asking:
| Mode | Runs without asking | Best for |
|---|---|---|
default (Manual) | Reads only | Reviewing every step |
acceptEdits | Reads, file edits and common file commands (mkdir, mv, cp …) | Iterating on code you’re watching |
plan | Reads, plus classifier-approved commands when auto mode is available | Exploring before changing |
auto | Everything, with background safety checks | Long tasks with fewer prompts |
dontAsk | Reads in your working folders and pre-approved tools; anything else is denied | Locked-down and CI runs |
bypassPermissions | Everything | Isolated containers and VMs only |
From Claude Code’s permission modes docs, 2026-10-16. `dontAsk` never appears in the Shift+Tab cycle.
Plan mode doesn’t replace permission rules: your allow and deny rules still apply in every mode. The settings builder explains each mode and writes defaultMode and the rules into one file.
Does plan mode save tokens? opusplan and the Plan subagent
Plan mode uses tokens like any other turn: Claude still reads files and writes a plan. It saves them when it stops a wrong approach before Claude rewrites files, and the Plan subagent keeps the exploration’s file reads out of your main context. It doesn’t make a session cheaper by itself.
The opusplan model setting pairs well with it: it “uses opus during plan mode, then switches to sonnet for execution”. On the Anthropic API those aliases are currently Opus 5.5 and Sonnet 5.5; on Bedrock, Google Cloud and Microsoft Foundry they map to older models. Choose it with /model opusplan. Each switch is a model change with its own prompt cache, which how to reduce Claude Code token usage explains, along with what plans and subscriptions cost in Claude Code pricing.
One cost to know: Anthropic’s costs docs say agent teams use about seven times the tokens of a standard session when teammates run in plan mode, because each teammate plans in its own context window.
Free toolClaude Code subagent builderBuild a read-only research subagent with its own model, or set `permissionMode: plan` on a subagent so it plans instead of editing.FAQ
Questions people ask
What is the shortcut for plan mode in Claude Code?
Shift+Tab. Press it until the status bar shows ⏸ plan mode on; from the default mode that’s two presses (default, accept edits, plan). On Windows terminals where Shift+Tab doesn’t register, use Alt+M. You can also type /plan, with or without a task after it, or start Claude Code with --permission-mode plan.
How do I exit plan mode in Claude Code?
Approve the plan, which switches the session to the mode the option names, or press Shift+Tab to move to the next mode without approving anything. Choosing “No, keep planning” keeps you in plan mode so you can ask for changes. Plan mode is also restored when you resume a session that was in it.
Can Claude edit files in plan mode?
No, not your source files: edits stay blocked until you approve the plan. Claude does write the plan itself to a plan file, by default in ~/.claude/plans. The exception is an interactive session launched with bypass permissions available, where Claude Code doesn’t enforce plan mode’s blocks and only the instruction to plan remains.
How do I make plan mode the default in Claude Code?
Set "defaultMode": "plan" inside permissions in .claude/settings.json for a project, or in ~/.claude/settings.json for all projects. The --permission-mode flag overrides it for one session. In VS Code, set claudeCode.initialPermissionMode to plan, because the extension doesn’t read this from project settings.
What is opusplan in Claude Code?
A model setting that uses Opus while you’re in plan mode and Sonnet once you approve and Claude starts executing, so the reasoning-heavy planning gets the stronger model and the many editing turns get the cheaper one. Select it with /model opusplan. Which exact models it uses depends on whether you’re on the Anthropic API or a cloud provider.
What happened to ultraplan?
Anthropic removed it. Ultraplan was a research preview that sent a planning task to a Claude Code session on the web; the /ultraplan command, the ultraplan keyword and the matching option in the plan approval menu are gone. The docs now point to plan mode instead.
Does plan mode work in headless mode with -p?
Yes. claude -p accepts --permission-mode plan, and the docs say plan mode keeps its blocks wherever Claude Code runs without an interactive terminal, including -p runs and Agent SDK sessions. That makes it a reasonable way to ask for a written plan in a script without letting it change files, though dontAsk with deny rules is stricter.
Try it
Tools from this guide
- Claude Code Settings BuilderBuild and check a settings.json with permission rules.
- Claude Code Subagent BuilderBuild and check subagent files for .claude/agents.
- CLAUDE.md GeneratorGenerate a CLAUDE.md and AGENTS.md for your project.
- Context Window CheckerSee whether your text fits each model’s context window.
Keep reading
Related guides
- Coding agentsClaude Code subagents: how to create and use them14 min read
- Coding agentsHow to reduce Claude Code token usage, and what each fix costs you13 min read
- Coding agentsHow to write a good CLAUDE.md, with a complete example13 min read
- Coding agentsClaude Code pricing: plans vs API, and which costs less14 min read