[BUG] "Clear context" option appears but doesn't actually clear context when exiting plan mode

Resolved 💬 2 comments Opened Apr 16, 2026 by DawnFire42 Closed May 25, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

When exiting plan mode, the "Yes, clear context and accept edits" option is displayed (with showClearContextOnPlanAccept: true enabled). However, selecting this option does NOT actually clear the context - the conversation history and context usage remain unchanged.

This occurs even in a fresh Claude Code session after a full system reboot.

What Should Happen?

Selecting "Yes, clear context and accept edits" should clear the conversation context, similar to running /clear.

Steps to Reproduce

  1. Enable "showClearContextOnPlanAccept": true in ~/.claude/settings.json
  2. Start a new Claude Code session (fresh terminal, even after reboot)
  3. Enter plan mode
  4. Create a plan with substantial context usage
  5. When Claude calls ExitPlanMode, select "Yes, clear context and accept edits"
  6. Bug: Context is NOT cleared - run /context to verify usage is unchanged

Claude Model

Opus

Is this a regression?

Unknown

Claude Code Version

2.1.110

Platform

Anthropic API

Operating System

Linux (6.17.0-20-generic)

Terminal/Shell

bash

Additional Information

Related issues (different bugs):

  • #46353 - option doesn't appear for new projects (in this case the option DOES appear)
  • #33225 - plan mode remains active after clear (different symptom)

Settings:

{
  "permissions": { "defaultMode": "plan" },
  "showClearContextOnPlanAccept": true,
  "model": "claude-opus-4-5"
}

Workaround: Manually run /clear after exiting plan mode.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗