Context compaction silently destroys terminal scroll history

Resolved 💬 4 comments Opened May 25, 2026 by vdevanathan-olo Closed Jun 26, 2026

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.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗