[BUG] "Clear context" option missing from plan mode exit dialog in --dangerously-skip-permissions mode

Status Fixed / completed
Reported on v2.1.81
Maintainer reply ✓ Yes — bcherny
Activity 9 comments · opened Mar 21, 2026 · closed Mar 26, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

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:

  1. Yes, and bypass permissions
  2. Yes, manually approve edits
  3. Type here to tell Claude what to change

The expected options (based on normal mode and previous sessions) should include a "clear context" variant:

  1. Yes, clear context and bypass permissions ← missing
  2. Yes, and bypass permissions
  3. Yes, manually approve edits
  4. 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

  1. Start Claude Code with --dangerously-skip-permissions
  2. Enter plan mode (Shift+Tab)
  3. Ask Claude to create a plan
  4. When the plan is complete and ExitPlanMode triggers, observe the options
  5. 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")_

View original on GitHub ↗

9 Comments

hoffjero · 5 months ago

<img width="1029" height="182" alt="Image" src="https://github.com/user-attachments/assets/8ca4aa4f-fb6d-482f-86d2-9dd035239236" />

codefromthecrypt · 5 months ago

this happens even without dangerously skip permissions, and it isn't intermittent for me at least within one context

hoffjero · 5 months ago

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.

litchi98 · 5 months ago

In my case, fails to trigger correctly every single time. since v2.1.81

tmokmss · 5 months ago

<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.

litchi98 · 5 months ago

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.

bcherny collaborator · 5 months ago

This was unshipped because you don't need this anymore with 1M context! To opt back into it, ask Claude to set showClearContextOnPlanAccept: true in your settings.json. See docs: https://code.claude.com/docs/en/settings.

hoffjero · 5 months ago

@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?

github-actions[bot] · 5 months ago

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.