[BUG] ExitPlanMode "Yes, clear context and use auto mode" registers as rejection — infinite plan-mode loop (regression of #33479 / #33870)

Resolved 💬 1 comment Opened May 17, 2026 by matanmerling Closed Jun 16, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet (the closest matches, #33479 and #33870, are closed-stale; the closing bot explicitly invited a re-file)
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

When ExitPlanMode is called and I select option 1 ("Yes, clear context (X% used) and use auto mode"), the harness sends a rejection tool_result to Claude instead of an approval. Claude then narrates that "the user doesn't want to proceed", calls ExitPlanMode again, and the same 4-option prompt reappears. Selecting option 1 again repeats indefinitely.

This is identical in symptom to closed issues #33479 (v2.1.72) and #33870 (v2.1.72), both closed as inactive without a confirmed fix. An Anthropic collaborator (@dicksontsai) commented on #33870 explaining the mechanism — the "clear context" path used onReject() internally to unblock the query loop, and a fix changing it to onAbort() had landed pending release. The bug is still present 70+ releases later on v2.1.143, so either the fix never covered option 1 specifically or it regressed.

What Should Happen?

Selecting "Yes, clear context (X% used) and use auto mode" should:

  1. Approve ExitPlanMode cleanly (Claude sees an approval tool_result, not a rejection).
  2. Clear conversation context.
  3. Disable plan mode for the cleared session.
  4. Enable auto-accept for the new session.

Currently only step 2 happens — context clears, plan mode persists across /clear, Claude receives a rejection tool_result, and the prompt loops.

Error Messages/Logs

The tool result Claude receives even after the user clicks option 1:

The user doesn't want to proceed with this tool use. The tool use was rejected (eg. if it was a file edit, the new_string was NOT written to the file). STOP what you are doing and wait for the user to tell you how to proceed.

Steps to Reproduce

  1. Start a Claude Code session on v2.1.143.
  2. Enter plan mode (Shift+Tab until plan mode is active).
  3. Give Claude a task that requires planning (e.g. "add a GitHub Actions workflow that builds and pushes a Docker image"). Let it write a plan file.
  4. Wait for Claude to call ExitPlanMode. The approval prompt appears with four options:
  5. Yes, clear context (X% used) and use auto mode
  6. Yes, and use auto mode
  7. Yes, manually approve edits
  8. Tell Claude what to change
  9. Select option 1.
  10. Observed: context appears to clear, but plan mode is still active. The next assistant turn shows it received a rejection tool_result for the prior ExitPlanMode, narrates "user doesn't want to proceed", and calls ExitPlanMode again — same 4-option prompt reappears.
  11. Repeating option 1 loops indefinitely.

(Options 2, 3 and Shift+Tab were not tested in this session, so no claims about workarounds.)

Claude Model

Opus

Is this a regression?

Yes

Last Working Version

Unknown — the original reports in #33479 / #33870 are from v2.1.72; no known-good version on hand.

Claude Code Version

2.1.143 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other — Ghostty (running tmux inside Ghostty)

Additional Information

https://github.com/anthropics/claude-code/issues/33870#issuecomment-4053023697

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗