[BUG] ExitPlanMode "Yes, clear context and use auto mode" registers as rejection — infinite plan-mode loop (regression of #33479 / #33870)
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:
- Approve
ExitPlanModecleanly (Claude sees an approvaltool_result, not a rejection). - Clear conversation context.
- Disable plan mode for the cleared session.
- 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
- Start a Claude Code session on v2.1.143.
- Enter plan mode (Shift+Tab until plan mode is active).
- 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.
- Wait for Claude to call
ExitPlanMode. The approval prompt appears with four options: - Yes, clear context (X% used) and use auto mode
- Yes, and use auto mode
- Yes, manually approve edits
- Tell Claude what to change
- Select option 1.
- Observed: context appears to clear, but plan mode is still active. The next assistant turn shows it received a rejection
tool_resultfor the priorExitPlanMode, narrates "user doesn't want to proceed", and callsExitPlanModeagain — same 4-option prompt reappears. - 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
- Running inside
tmux(TERM=tmux-256color) under Ghostty on macOS. - Platform:
Darwin 25.4.0 arm64 - Shell:
/bin/zsh - Node:
v20.19.0 - Related closed issues with identical symptom:
- https://github.com/anthropics/claude-code/issues/33479
- https://github.com/anthropics/claude-code/issues/33870
- Collaborator comment from #33870 with mechanism + proposed fix (
onReject()→onAbort()):
https://github.com/anthropics/claude-code/issues/33870#issuecomment-4053023697
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗