TUI scroll buffer limited to ~10 lines when viewing running session

Status Fixed / completed
Maintainer reply None cached
Activity 6 comments · opened May 14, 2026 · closed May 22, 2026

Description

When using the Claude Agents feature and entering a running agent session, scrolling up in the conversation view is limited to approximately 10 lines. You cannot scroll back further to see earlier conversation history within the TUI.

This issue is specific to the agents workflow — starting a new interactive session does not reproduce it. It only occurs when hopping into an already-running agent session from the session list.

Steps to Reproduce

  1. Start a Claude Code agent session (background task)
  2. From the session list, enter the running agent session
  3. Attempt to scroll up through the conversation

Expected Behavior

Should be able to scroll back through the full (or a reasonably large) conversation history within the TUI, similar to how other terminal-based chat tools behave.

Actual Behavior

Scroll is capped at ~10 lines. Earlier conversation content is inaccessible from within the TUI.

Environment

  • Terminal: iTerm2 (version 3.6.10)
  • Platform: macOS
  • iTerm2 settings checked: "Save lines to scrollback in alternate screen mode" and "Save lines to scrollback when an app status bar is present" — both enabled, no effect
  • Session logging enabled — also no effect on in-session scroll

Additional Context

This appears to be a Claude Code TUI render buffer limitation rather than a terminal emulator issue — the TUI owns the scroll region and limits how far up you can go. The full conversation is accessible via claude.ai/code in the browser, but not from within the CLI session view.

View original on GitHub ↗

6 Comments

github-actions[bot] · 3 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/28077
  2. https://github.com/anthropics/claude-code/issues/42002
  3. https://github.com/anthropics/claude-code/issues/53193

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

michaelsc44 · 3 months ago

This has only occured when using claude agents and going into a running session, or stopped session and scrolling up. Regular claude code sessions TUI work fine when scrolling back.

conchoecia · 3 months ago

This isn't a duplicate of #28077 or of #42002. I can't determine if it is a duplicate of #53193. In any case, I am having the same problem as @michaelsc44 . The problem is that I cannot scroll back through past output in agent mode when running inside GNU screen over SSH. Description is below, report generated from discussion with a Claude session.

Environment

  • Claude Code version: 2.1.142
  • OS: Ubuntu 20.04, kernel 5.15.0-139-generic (x86_64)
  • Terminal multiplexer: GNU screen 4.08.00 (05-Feb-20)
  • $TERM inside screen: xterm-256color
  • Transport: SSH session

Summary
When Claude Code is running an agent task ("agent mode"), there is no working way to scroll back through earlier output of the current turn. The relevant content is on-screen but past the visible region,
and none of the usual scrollback mechanisms work:

  • Mouse wheel: no effect.
  • Shift+PgUp / Shift+PgDn: no effect.
  • screen copy mode (Ctrl-A [, then arrow keys / PgUp): enters copy mode but the buffer shows only what is currently visible — earlier lines are not in screen's scrollback. This same key sequence does work

correctly when Claude is in regular (non-agent) mode in the same screen session, so the difference is between the two Claude modes, not a screen configuration issue.

Net effect: once output scrolls past the top of the pane during an agent turn, it is unrecoverable.

Steps to reproduce

  1. SSH into a Linux host.
  2. Start screen (or attach an existing session).
  3. Launch claude.
  4. Trigger any agent-mode response long enough that output exceeds one screen height (e.g. ask for a long diagnostic checklist).
  5. Try to scroll up via:
  • mouse wheel
  • Shift+PgUp
  • screen copy mode: Ctrl-A [ then Up arrow / PgUp

Expected behavior
Either:

  • Native terminal / screen scrollback captures the agent output the same way it captures regular-mode output, or
  • The TUI provides an in-app keybinding to scroll the conversation pane back through prior output of the current turn.

Actual behavior
Agent-mode output is unreachable once it scrolls off-screen. The same screen copy-mode sequence that works for regular Claude output produces an empty/limited buffer for agent-mode output, suggesting the
agent UI uses the alternate screen buffer (or otherwise bypasses the host terminal's line history) in a way the non-agent mode does not.

Workarounds tried

  • screen copy mode (Ctrl-A [): does not show pre-scrolled lines in agent mode.
  • Mouse wheel and Shift+PgUp: no effect.
  • Running Claude under script -f session.log captures the raw stream, but is not a usable interactive workaround.

Impact
On a remote SSH workflow this is a blocker for any longer agent response — multi-step instructions, diagnostic checklists, or code review output frequently exceed one pane, and the user has no way to
re-read what was produced earlier in the same turn without re-prompting.

michaelsc44 · 3 months ago

Okay I got this working after poking around some more in iTerm2. It's actually the mouse reporting that was causing this issue. Claude's TUI runs in the alternate screen buffer and manages its own internal scrollback. Without mouse reporting enabled, iTerm2 intercepted scrollwheel events and tried to scroll its own scrollback buffer, which doesn't contain alt-screen content, so it appeared cut off. PageUp/PageDown buttons on my keyboard worked because those keys were passed through to claude. Enabling mouse reporting in iTerm2's settings forwards scroll events to claude, which can then scroll through its full session history.

<img width="988" height="646" alt="Image" src="https://github.com/user-attachments/assets/514c5a8e-0b4e-4878-be37-3318b853eed2" />

conchoecia · 3 months ago

Thanks for the update, @michaelsc44. That fixed it for me, too! I disabled this feature due to all the alerts, so glad that we happened to be using the same terminal.

github-actions[bot] · 1 month ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.