Terminal scrollback not working in long sessions (alternate screen buffer)
Description
Unable to scroll back through conversation history in long CLI sessions. The terminal viewport only retains a limited portion of the session output, making it impossible to review earlier parts of the conversation by scrolling up.
Environment
- OS: macOS (Darwin 25.3.0, Apple Silicon M3)
- Terminal: Terminal.app
- Claude Code versions tested: 2.1.87, 2.1.88, 2.1.89 (same behavior on all three)
- Shell: bash
What I've tried (none of these helped)
- Terminal.app scrollback set to "Limit to available memory" (effectively unlimited)
- Freed up system memory (plenty available)
- Set
CLAUDE_CODE_NO_FLICKER=1environment variable - Tested on versions 2.1.87, 2.1.88, and 2.1.89 (identical behavior)
- Rolled back versions via symlink
Reproduction
- Start a long CLI session with significant output (e.g., multiple browser automation tool calls, reading large files, filling web forms)
- After ~30-60 minutes of active use, try scrolling up to the beginning of the session
- Scrollback stops well short of the beginning; earlier conversation turns are inaccessible
Expected behavior
Full session output should be scrollable in the terminal, as it was in earlier versions of Claude Code.
Likely cause
Claude Code uses the alternate screen buffer, which bypasses the terminal emulator's normal scrollback buffer. The alternate screen's internal viewport appears to have a limited size that doesn't scale with session length.
Impact
This makes it impossible to review earlier parts of a session, which is important when resuming work after a break or verifying what actions were taken. The conversation context is preserved internally (Claude can still reference earlier turns), but the user cannot visually review them.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗