claude-code - 💡(How to fix) Fix ExitPlanMode should restore the permission mode that was active before EnterPlanMode [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48013Fetched 2026-04-15 06:35:51
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When entering plan mode, the previous permission mode (e.g., auto, bypassPermissions) is replaced. After exiting plan mode, the mode doesn't revert — the user has to manually reset it.

What Should Happen?

ExitPlanMode should restore whatever mode was active before EnterPlanMode was called.

Error Messages/Logs

Steps to Reproduce

  1. Go into plan mode
  2. Exit plan mode
  3. Permission goes to Edit Automatically vs original mode.

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.107

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

extent analysis

TL;DR

The issue can be fixed by modifying the ExitPlanMode function to restore the previous permission mode that was active before EnterPlanMode was called.

Guidance

  • Review the implementation of EnterPlanMode and ExitPlanMode to identify how the permission mode is being stored and restored.
  • Consider adding a variable to store the previous permission mode when EnterPlanMode is called, and then use this variable to restore the mode when ExitPlanMode is called.
  • Verify that the ExitPlanMode function is correctly resetting the permission mode by testing different scenarios and checking the resulting mode.
  • Check if there are any existing functions or APIs in the Claude Code that can be used to get and set the permission mode, and use them to simplify the implementation.

Example

// Pseudocode example, actual implementation may vary
let previousMode = null;

function EnterPlanMode() {
  previousMode = getPermissionMode();
  // ... rest of the implementation
}

function ExitPlanMode() {
  setPermissionMode(previousMode);
  // ... rest of the implementation
}

Notes

The exact implementation details may vary depending on the specific requirements and constraints of the Claude Code project. This guidance provides a general direction for fixing the issue, but may need to be adapted to fit the specific use case.

Recommendation

Apply workaround: Modify the ExitPlanMode function to restore the previous permission mode, as this is a specific and targeted fix that addresses the reported issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING