claude-code - 💡(How to fix) Fix [BUG] Canceling ExitPlanMode leaves terminal output broken

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

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

If I press ESC to cancel while Claude is prompting me to review/approve a plan in Plan Mode, I am left with broken terminal output.

Claude Code returns to the normal conversation view, but dumps the plan that it had prompted the user to approve into the conversation history wrapped in a blue box. However, on all recent versions of Claude Code, if the plan exceeds the terminal window height, which occurs often, only the part of the plan that fits on the screen is printed correctly. If the user attempts to scroll up and read the entire plan, they encounter a garbled mix of the original "exit plan" dialog, the previous conversation transcript, and the new transcript containing the "User rejected Claude's plan" box.

This renders the history borderline unusable.

<img width="874" height="737" alt="Image" src="https://github.com/user-attachments/assets/f58f5baf-8ef9-402e-bc4d-9546eae7fa43" />

What Should Happen?

Claude Code should print the full last turn's message, including the full "User rejected Claude's plan" box with the plan in its entirety into the terminal window and its scrollback.

Ideally, Claude Code should offer a configurable option to restore the previous behavior (prior to 2.1.97) of clearing and redrawing the entire scrollback, so users always have a cohesive conversation history in their terminal scrollback.

For users that don't want the scrollback clearing behavior, when Claude Code clears a dialog or other temporary display state that extends into the scrollback buffer, it should either first push the text in the display region into the scrollback, or push a highly visible "dividing line" or other visual element into the scrollback, so users can tell where one cohesive display ends and another begins.

Error Messages/Logs

Steps to Reproduce

  1. Launch Claude Code and start a plan mode session. The plan must be longer than the terminal window height for the issue to be visible.
  2. When Claude prompts you review the plan and exit plan mode, press ESC
  3. Scroll up and attempt to read the scrollback buffer

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.97

Claude Code Version

2.1.165

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

Screenshot displays the issue in Ghostty, but it reproduces in iTerm2 as well.

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