[BUG] "Clear context" option missing from plan mode exit dialog in --dangerously-skip-permissions mode
Preflight Checklist
- [x] I have searched existing issues and confirmed this is not a duplicate
- [x] I can reproduce this bug
Bug Description
When running Claude Code with --dangerously-skip-permissions, the plan mode exit dialog (ExitPlanMode) sometimes does not include the "clear context" option. The options shown are:
- Yes, and bypass permissions
- Yes, manually approve edits
- Type here to tell Claude what to change
The expected options (based on normal mode and previous sessions) should include a "clear context" variant:
- Yes, clear context and bypass permissions ← missing
- Yes, and bypass permissions
- Yes, manually approve edits
- Type here to tell Claude what to change
Key detail: this is inconsistent
The "clear context" option did appear in earlier sessions (same day, same flags, same version). In later sessions on the same day, it stopped appearing. No configuration was changed between sessions.
Steps to Reproduce
- Start Claude Code with
--dangerously-skip-permissions - Enter plan mode (Shift+Tab)
- Ask Claude to create a plan
- When the plan is complete and ExitPlanMode triggers, observe the options
- Note that "clear context and bypass permissions" is sometimes missing
Expected Behavior
The "clear context" option should always appear in the exit dialog, regardless of permission mode. It's a valuable workflow option that allows users to start implementation with a fresh context window while retaining the saved plan file.
Relation to #18599
Issue #18599 discusses making the default option configurable. This issue is different: the "clear context" option is not shown at all in --dangerously-skip-permissions mode (or appears inconsistently).
Environment
- Claude Code version: 2.1.81
- OS: macOS (Darwin 25.3.0)
- Permission mode:
--dangerously-skip-permissions - Shell: zsh
Screenshot
The following screenshot shows the plan mode exit dialog without the "clear context" option:
!Plan mode exit options showing only 3 options, missing "clear context"
_(Options shown: "Yes, and bypass permissions" / "Yes, manually approve edits" / "Type here to tell Claude what to change")_
9 Comments
<img width="1029" height="182" alt="Image" src="https://github.com/user-attachments/assets/8ca4aa4f-fb6d-482f-86d2-9dd035239236" />
this happens even without dangerously skip permissions, and it isn't intermittent for me at least within one context
I just want a way to have "clear context and bypass permissions" as one of the ExitPlanMode triggers, since this helps my workflow to manage context between sessions.
In my case, fails to trigger correctly every single time. since v2.1.81
<img width="637" height="158" alt="Image" src="https://github.com/user-attachments/assets/54b56c57-5957-46a5-b1d1-56e1a069f20f" />
A workaround I found so far is to copy the plan file path and send
implement this plan: <path>in a new session.Additionally, I have also found that if the context is cleared, Claude Code will not use the Task tool; if it is not cleared, it will tend to use the Task tool.
This was unshipped because you don't need this anymore with 1M context! To opt back into it, ask Claude to set
showClearContextOnPlanAccept: truein your settings.json. See docs: https://code.claude.com/docs/en/settings.@bcherny Maybe I am abusing this ticket, but with a 200K context window, I always tried to keep it under 100K to avoid context rot. Now that the context window is 1M I still keep it under 15%, because as I understood the quality of the LLM lowers with the amount of context. What limit do you use?
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.