[FEATURE] Expand collapsed tool results at scroll position without losing place (tmux copy-mode workflow)
Problem
When running Claude Code inside tmux — which is a very common setup — the only way to scroll back through conversation history is tmux copy-mode (Ctrl+b [), because Claude Code's TUI runs on the alternate screen and has no internal scroll buffer.
Tool results are collapsed by default, which is the desired behavior for skim-reading past turns. The problem is the read→expand→stay-in-place workflow:
- User enters tmux copy-mode, scrolls up through summarized turns
- User reaches a specific collapsed tool result they want to inspect in detail
- There is no way to expand just that tool result at the current scroll position.
Today the only option is:
- Press
qto exit copy-mode — snaps view to the live cursor at the bottom - Press
Ctrl+O— toggles transcript/verbose mode globally - Scroll all the way back up through the reorganized view to find the same spot
This breaks flow hard for anyone who reviews their session before continuing.
Why current workarounds are inadequate
- Transcript mode +
:— dumps the entire conversation expanded into native scrollback. Defeats the value of the summarized default view and floods the terminal. - Transcript mode +
v— opens full conversation in$EDITOR. Overkill for inspecting one tool call; breaks the in-terminal flow. - Always-verbose via
/config— turns off the summarization that makes skim-reading tractable in the first place.
None of these let the user say "show me the detail of this tool call, right here."
Root cause
Claude Code's live TUI has no internal cursor/scroll state. tmux copy-mode is a frozen snapshot that cannot forward keystrokes to the underlying pane, so any key pressed while scrolled-up goes to tmux, not Claude Code. Exiting copy-mode always resets to the live cursor because that's the only position Claude Code is aware of.
Proposed behavior (in order of preference)
1. Native in-TUI scrolling + selective expand-at-cursor
Give Claude Code its own scroll buffer so users can scroll inside the TUI itself with PgUp/PgDn/k/j/mouse wheel, and press a key (o, Enter, or Space) to expand/collapse the tool result at the cursor. Because Claude Code owns scroll state, it can preserve the user's position across expand/collapse re-renders.
This is effectively what #21316 (closed) asked for, but with the selective-expand capability layered on top.
2. "Pinned" tool results
Allow the user to mark specific tool calls as always-expanded. Less elegant than #1, but lower implementation cost and addresses a chunk of the use case — user can pin the one they're interested in, then scroll freely to read it in context.
3. Transcript mode that remembers position
When entering transcript mode, write expanded output to scrollback and also emit a cursor-positioning sequence that lands on the last-visible pre-transcript line. Doesn't solve selective expand, but at least stops punishing the user with a scroll-back-to-find-my-place tax.
Related issues
- #21316 — Feature request: vim-style keyboard scrolling for chat history (closed)
- #38810 — Claude Code captures mouse events in tmux, breaking native scrollback
- #46777 — Persistent user tmux overrides from
/config/.tmux.conf - #50118 — Fullscreen docs omit keyboard selection and edge-scrolling behavior
- #35865 — Terminal auto-scrolls to top on every tool result
Collectively these paint a picture: Claude Code delegates all scroll UX to the terminal/tmux, which works fine for copy-paste but leaves users unable to interact meaningfully with their own scroll position. Native scroll + cursor-aware actions would unblock a whole class of workflows without forcing all-or-nothing transcript dumps.
Environment
- Claude Code running inside tmux (reproduces across Linux and macOS per community reports)
- Any terminal emulator — the issue is inherent to the alternate-screen + external-scroll design, not terminal-specific
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗