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

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

Fix Action

Fix / Workaround

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

Code Example

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.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • 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)
  • This is a single bug report
  • 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:
    1. Yes, clear context (X% used) and use auto mode
    2. Yes, and use auto mode
    3. Yes, manually approve edits
    4. Tell Claude what to change
  5. Select option 1.
  6. 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.
  7. 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

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