[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")_
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗