Claude Code Ignores Plan Mode and Edits Files Anyway? What’s Going On

Claude Code Ignores Plan Mode and Edits Files Anyway? What’s Going On

If Claude Code ignores plan mode and edits your files anyway, the most likely reason is that the session was no longer in plan mode when the edit happened. Approving a plan ends plan mode right away, and so does pressing Shift+Tab at the approval prompt, because that key approves the plan there. Look at the status bar under the prompt: if it doesn’t say plan mode on, plan mode isn’t protecting you.

The second big cause is bypass permissions. Anthropic’s docs say that in an interactive terminal session started with bypass permissions available (for example with --dangerously-skip-permissions or --allow-dangerously-skip-permissions), plan mode’s blocks don’t hold, and edits or commands can run without a prompt. Restart without that flag and the blocks come back.

Shell commands are the third cause. When auto mode is available, a classifier reviews shell commands during planning instead of asking you, so a command it approves can still change something.

Set "useAutoModeDuringPlan": false to get a prompt for every command outside the read-only set. We tested each case below in a real session.

Browse all our Claude Code tutorials for more fixes and how-tos.

Tested with Claude Code v2.1.332 on macOS on December 1, 2026. We used a throwaway folder called trip-notes with two small text files, and we started Claude Code with project and local settings only, so nothing in our real setup changed. The bypass permissions case comes from Anthropic’s official docs, because we did not run a bypass session for this test.

Quick Summary

What you seeLikely causeFixTested by us?
Edits happen and the status bar doesn’t say plan modeYou weren’t in plan mode, or /plan only covered one promptPress Shift+Tab until plan mode on showsYes
Edits start right after the plan appearsThe plan was approved, often with Shift+TabPress Esc at the approval prompt to keep planningYes
Edits or commands run with no prompt at allBypass permissions is available in the sessionRestart without the skip-permissions flagsFrom the docs
A shell command changed a fileThe auto mode classifier approved itSet useAutoModeDuringPlan to falseYes
A new .md file appearedClaude’s own plan fileExpected; move it with plansDirectoryYes
VS Code edits even with a plan defaultThe extension ignores the project defaultModeSet claudeCode.initialPermissionMode to planFrom the docs

What Plan Mode in Claude Code Actually Blocks

Plan mode tells Claude to research and propose changes without making them. According to the permission modes documentation, Claude reads files, runs shell commands to explore, and writes a plan, but it doesn’t edit your source until you approve the plan.

Plan mode is not a read-only lock on your whole computer. It blocks file edits by Claude’s editing tools, and it treats shell commands differently depending on your session. If you want a refresher on the basics first, our guide on using plan mode walks through a full planning session.

Stack diagram of what Claude Code plan mode allows and blocks: reads and read-only commands run, the plan file is written, other shell commands go to the classifier or a prompt, file edits and hook approvals are blocked
What plan mode allows and blocks in a normal terminal session

Here is how each kind of action behaves while you plan:

  • Reading files and read-only commands such as ls, cat, grep and git status run without asking.
  • Claude writes its own plan file to ~/.claude/plans/, or to the folder you set with plansDirectory.
  • Other shell commands go to the auto mode classifier when auto mode is available, or to a permission prompt when it isn’t.
  • Edits to your files stay blocked until you approve the plan.

Plan mode blocks edits, not every change. Shell commands and approvals are where most surprises come from.

Cause 1: You Weren’t Really in Plan Mode

This is the most common mix-up. In the terminal, Shift+Tab cycles through permission modes, and it’s easy to stop one press too early. In our test, a plain claude started in auto mode, and it took three presses to reach plan: auto, then Manual, then accept edits, then plan.

The only reliable check is the status bar under the prompt. It shows a cyan plan mode on when you’re planning. Anything else, like accept edits on or auto mode on, means Claude can edit files.

Claude Code started with --permission-mode plan, with the status bar showing plan mode on highlighted in red
Starting with claude --permission-mode plan shows “plan mode on” in the status bar

The /plan prefix covers one prompt only

You can also enter plan mode by starting a single prompt with /plan. The docs describe this as prefixing a single prompt, so don’t expect the next prompt to stay in plan mode. If you want a whole session of planning, start it with claude --permission-mode plan or switch with Shift+Tab.

The fix

  1. Press Shift+Tab until the status bar reads plan mode on.
  2. Or start fresh with claude --permission-mode plan.
  3. To make plan the default for a project, add "defaultMode": "plan" under permissions in .claude/settings.json.
{
  "permissions": {
    "defaultMode": "plan"
  }
}

Cause 2: The Plan Was Approved, Sometimes by Accident

When Claude finishes a plan, it shows an approval prompt. In our session on v2.1.332, the options read “Yes, and use auto mode”, “Yes, manually approve edits” and “Tell Claude what to change”. Under the third option was a small hint: shift+tab to approve with this feedback.

Claude Code plan approval prompt with three options and the hint shift+tab to approve with this feedback highlighted
The approval prompt; pressing Shift+Tab here approves the plan

This is the trap. Many people press Shift+Tab to leave plan mode, but at this prompt the same key approves the plan. The docs confirm it: at the approval prompt, press Esc first, since Shift+Tab there approves the plan.

We tried it. We asked Claude to change the hotel line in notes.txt, waited for the plan, and pressed Shift+Tab. The session switched to auto mode and Claude edited the file within seconds.

Claude Code Update of notes.txt right after the plan was approved, with the status bar now showing auto mode on
After approval, Claude edits the file and the status bar shows auto mode

From Claude Code’s point of view, nothing was ignored. Approving a plan exits plan mode and switches the session to the mode that option describes, so edits are expected from then on.

The fix

  • At the approval prompt, press Esc if you aren’t ready. In our test, Claude confirmed nothing was edited and stayed in plan mode.
  • Pick “Tell Claude what to change” to keep planning with feedback.
  • Pick “Yes, manually approve edits” if you want to review each edit after approving.
  • Press Ctrl+G to open the plan in your editor and change it before you approve.

Cause 3: Bypass Permissions Is Available in the Session

This one surprises people, and it’s the closest to plan mode truly being ignored. The docs warn that in interactive terminal sessions with bypass permissions available, you shouldn’t rely on plan mode’s blocks. A file edit or shell command Claude attempts during planning can run without prompting.

Bypass permissions becomes available when you start with any of these:

  • --dangerously-skip-permissions
  • --permission-mode bypassPermissions
  • --allow-dangerously-skip-permissions, which adds bypass to the Shift+Tab cycle without turning it on
  • "defaultMode": "bypassPermissions" in your user settings, a --settings file or managed settings

The --allow- variant is the sneaky one. You might start in plan mode and never see the word bypass in the status bar, yet the plan blocks are relaxed because bypass is available. Explicit ask rules and recognized dangerous rm removals still prompt, according to the docs.

The fix

Restart Claude Code without any skip-permissions flag and check your user settings for a bypassPermissions default. If you use a shell alias for claude, look there too. Our guide on bypass permissions mode covers every way it gets turned on.

The docs also note that plan mode keeps its blocks where there’s no interactive terminal, such as claude -p runs, the Agent SDK and the VS Code extension’s chat panel.

Cause 4: A Shell Command Changed the File

Plan mode blocks Claude’s edit tools, but shell commands follow their own rules. The docs list three cases, and the first one that matches applies:

SessionWhat happens to a shell command during planning
Bypass permissions availableCan run with no classifier and no prompt
Auto mode available and useAutoModeDuringPlan on (the default)The classifier reviews it; approved commands run
Auto mode not available, or useAutoModeDuringPlan offCommands outside the read-only set prompt you

So with default settings, a command like sed -i or echo ... >> file isn’t sent to you for approval. It goes to the classifier, and if the classifier approves it, it runs.

In our test, Claude itself declined. We asked it to run echo 'Flight: TP 1351' >> notes.txt while planning, and it replied that it couldn’t run that while plan mode was on, because the command appends to a file. That’s good behavior, but it’s Claude’s judgment, not a hard block, so don’t count on it for every command.

Claude Code in plan mode declining to run an echo command that appends to notes.txt, saying plan mode only allows read-only actions
Claude declined a file-writing shell command while plan mode was on

The fix: turn off the classifier during planning

The settings reference describes useAutoModeDuringPlan. Set it to false and you get a permission prompt for every command outside the built-in read-only set. It works in user, local or managed settings, not the shared project file.

We put it in .claude/settings.local.json in our demo folder. We also set plansDirectory in .claude/settings.json so plan files stayed inside the project.

Terminal showing .claude/settings.json with plansDirectory set to ./plans and .claude/settings.local.json with useAutoModeDuringPlan set to false
Our two settings files: plans stay in the project, and the classifier is off during planning

Inside Claude Code, /config showed the change. Searching for “plan” listed “Use auto mode during plan” as off.

Claude Code /config screen filtered by plan, showing Use auto mode during plan set to off
The /config screen shows “Use auto mode during plan” switched off

Read-only checks still run without a prompt. With the setting off, we asked Claude to run python3 --version in plan mode, and it ran straight away. Claude Code treats simple checks like this as safe, so you only see prompts for commands that could change things.

Claude Code in plan mode running python3 --version without a permission prompt
A harmless version check still runs in plan mode without a prompt

Cause 5: The Only New File Is the Plan Itself

Sometimes the “edit” is a new Markdown file you didn’t ask for. That’s Claude’s own plan file. The permission docs list the current session’s plan files in ~/.claude/plans/, or in your plansDirectory, among the files Claude Code may write.

In our first session, the approval prompt showed the plan’s path under ~/.claude/plans/. After we set "plansDirectory": "./plans", the next plan landed in the project’s plans folder instead. Your source files were untouched in both cases.

Other Reasons Claude Code Seems to Ignore Plan Mode

Hooks can’t approve edits while you plan

If you wrote a PreToolUse hook that returns "allow", you might worry it lets edits through, but it doesn’t. The permissions documentation says that in plan mode, apart from ExitPlanMode, a hook’s "allow" has no effect on a file edit or another call that isn’t read-only.

A hook can still block calls. Our hooks guide explains how they work.

VS Code doesn’t read the project default

The docs say conversations the VS Code extension starts don’t read project settings for the starting permission mode. If you set "defaultMode": "plan" in .claude/settings.json and expect it in VS Code, set claudeCode.initialPermissionMode to plan in your VS Code user settings instead.

Your own edits or another tool

Plan mode only governs what Claude does, so a formatter on save, a file watcher or a command you typed with the ! prefix can all change files while Claude plans. Check what else touches the folder before blaming Claude.

Decision ladder: why did Claude change files in plan mode, checking status bar, plan approval, bypass permissions, shell commands and plan files
Work down the ladder; the first yes is usually your cause

Try It Yourself

Make a throwaway folder with one text file, start claude --permission-mode plan, and paste this prompt:

Change the first line of notes.txt to say "Draft 2". Plan it first; don't edit yet.

When the approval prompt appears, press Esc and check the file with !cat notes.txt. It should be unchanged. Then run the prompt again and pick “Yes, manually approve edits”, and watch the status bar change as the edit happens.

Common Mistakes

  • Pressing Shift+Tab at the approval prompt to “get out”, which approves the plan instead.
  • Using /plan once and assuming every later prompt is also in plan mode.
  • Starting with --allow-dangerously-skip-permissions out of habit, which relaxes plan mode’s blocks.
  • Putting useAutoModeDuringPlan in the shared .claude/settings.json, where it doesn’t apply; use a user or local file.
  • Treating plan mode as a sandbox. It’s a workflow guard, not a security boundary.

Pro Tips

  • Glance at the status bar before every risky prompt. It’s the single source of truth for your mode.
  • Use “Yes, manually approve edits” for unfamiliar code, so you still review each change after approving.
  • Keep plans in your repo with plansDirectory so you can review them later.
  • Add deny rules for anything that must never run, since deny rules block in every mode. Our guide to permission modes shows how modes and rules fit together.
  • If a command was refused by the classifier instead, see our post on auto mode denials.

Cheat Sheet

Plan mode cheat sheet with commands to check and switch into plan mode and settings that keep it strict
Keep this handy: the keys and settings that keep plan mode strict

Frequently Asked Questions

Why does Claude Code edit files in plan mode?

Usually the session left plan mode, because the plan was approved or the mode was never on. Otherwise, bypass permissions is available, or an approved shell command made the change.

How do I leave plan mode without approving the plan?

Press Esc at the approval prompt first, then press Shift+Tab to switch modes. Pressing Shift+Tab while the prompt is open approves the plan.

Can Claude run shell commands in plan mode?

Yes. Read-only commands always run. Other commands go to the auto mode classifier by default, or prompt you if auto mode isn’t available or useAutoModeDuringPlan is false.

Is plan mode safe with –dangerously-skip-permissions?

No. The docs say not to rely on plan mode’s blocks in terminal sessions with bypass permissions available. Edits and commands can run without a prompt.

Why is there a new .md file after planning?

That’s Claude’s plan file. It goes to ~/.claude/plans/ unless you set plansDirectory to another folder.

Conclusion

When Claude Code ignores plan mode and edits files anyway, the mode is almost always doing what it was designed to do. In our tests, plan mode blocked the edit and Claude declined a file-writing command, but a single Shift+Tab at the approval prompt approved the plan, switched to auto mode and changed the file. Check the status bar, press Esc instead of Shift+Tab when you aren’t ready, start without skip-permissions flags, and set useAutoModeDuringPlan to false if you want every non-read-only command to ask first. For other problems, our list of Claude Code errors and our Claude AI overview are good next stops.

Newsletter

New AI tools in your inbox

The best new tools and the AI news that matters, in one short email. Unsubscribe any time.

Free · No spam · Unsubscribe any time

✓ Looks like you’re subscribed

Loading Google’s sign-up form…

Looks like you’re already subscribed

Thanks for reading! New AI tools and the AI news that matters will land in your inbox.

Not subscribed yet? Refresh the page to load the sign-up form.

The sign-up form couldn’t load. If you use an ad or content blocker, allow news.google.com and reload the page.

Free instant check before you pay. Takes a few seconds.

Scroll to Top