CLI: Terminal scrollback permanently wiped during long tool-use chains

Resolved 💬 5 comments Opened Apr 2, 2026 by tommygents Closed Apr 17, 2026

Description

During long tool-use chains in the CLI, terminal scrollback history is permanently wiped. Earlier conversation output becomes inaccessible — scrolling up hits a wall where prior content should be.

This is not context compaction or /clear — the messages are still in the conversation context, but the terminal scrollback buffer is destroyed.

Reproduction

  1. Start a claude CLI session in Windows Terminal (Git Bash)
  2. Have a conversation that produces some scrollable output
  3. Trigger a response that involves a long tool-use chain (multiple sequential tool calls, e.g., agent dispatches, file reads, bash commands)
  4. After the tool chain completes, attempt to scroll up past the current response
  5. Expected: Full conversation history is scrollable
  6. Actual: Scrollback is permanently gone — only the most recent output is visible

Key details

  • Happens during long tool-use chains specifically, not short single-tool responses
  • Scrollback is permanently wiped, not temporarily hidden during a spinner
  • Occurs well before terminal buffer limits are hit (< 100 lines of output)
  • This is not context compression — the conversation context is intact, only the terminal rendering is lost

Likely cause

The TUI rendering during tool execution appears to be using the alternate screen buffer (or equivalent terminal escape sequences) in a way that permanently discards the normal buffer's scrollback, rather than preserving and restoring it.

Environment

  • Claude Code version: 2.1.90
  • OS: Windows 11 Pro (10.0.26200)
  • Terminal: Windows Terminal + Git Bash
  • TERM: xterm-256color

🤖 Generated with Claude Code

View original on GitHub ↗

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