claude-code - 💡(How to fix) Fix Context compaction silently destroys terminal scroll history

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…

When Claude Code compacts conversation history to manage context window limits, it wipes the terminal scroll buffer. The user can no longer scroll up to review earlier output from the same session — it's gone permanently.

Root Cause

When Claude Code compacts conversation history to manage context window limits, it wipes the terminal scroll buffer. The user can no longer scroll up to review earlier output from the same session — it's gone permanently.

RAW_BUFFERClick to expand / collapse

Summary

When Claude Code compacts conversation history to manage context window limits, it wipes the terminal scroll buffer. The user can no longer scroll up to review earlier output from the same session — it's gone permanently.

Expected behaviour

Compaction is an internal context management operation. It should be transparent to the user. The terminal scroll history should be preserved regardless of what happens to Claude's internal context.

Actual behaviour

After compaction occurs, scrolling up in the terminal only reaches back as far as the compaction point. Everything before it is erased from the scroll buffer. The user has no way to review earlier responses, code output, or decisions made earlier in the session.

Impact

  • Users lose the ability to review earlier parts of a long session
  • No warning is given before or after compaction that scroll history will be lost
  • The only way to recover earlier content is to dig through raw .jsonl transcript files manually

Suggested fix

Compaction should not clear or reset the terminal scroll buffer. If the current implementation achieves compaction by clearing the screen or re-rendering the terminal, that behaviour should be changed so scroll history is left intact.

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 Context compaction silently destroys terminal scroll history