[FEATURE] Scroll-aware sticky prompt header: pin the prompt that owns the currently visible output

Open 💬 0 comments Opened Jul 8, 2026 by MoldyAxis395

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When a response is long (100+ lines), scrolling back through the output loses the connection between what I'm reading and the prompt that produced it. The prompt echo (> ...) scrolls far away, and if several prompts/responses are interleaved in the scrollback, it's easy to misattribute output to the wrong request.

Note this is not the same as the previously requested "show the last prompt near the input box" (#36787, closed not-planned) — a static last-prompt bar doesn't help while scrolling back through older responses.

Proposed Solution

A scroll-aware sticky prompt header, like VS Code's Sticky Scroll (and grok CLI's prompt pinning): while scrolling through the transcript, pin at the top of the viewport the user prompt whose response is currently visible. Scrolling up past a response boundary swaps the header to the previous prompt, so the header always answers "what did I ask to get these lines?".

This seems most feasible in /tui fullscreen mode, where Claude Code already owns the viewport and scroll state, so it knows exactly which transcript lines are visible. Transcript mode (Ctrl+O) could get the same header.

Alternative Solutions

Tried building this externally and hit a hard wall: no terminal (Windows Terminal, at least) exposes the scrollback viewport position to other processes, so an external pane/statusline can only ever show the last prompt, never the one matching the visible output. A UserPromptSubmit hook + companion pane works for "last prompt", but scroll-following is only possible from inside the TUI that owns the scrolling. That's why this needs to be a native feature.

Priority

Medium - Would be very helpful

Feature Category

Interactive mode (TUI)

Additional Context

Related (both closed): #44390 (same idea, auto-closed as duplicate of #36787), #36787 (weaker "last prompt bar" variant, closed not-planned and locked — its lock message suggests filing a new issue referencing it). Filing this as the scroll-aware variant, which is the part a static bar can't cover.

View original on GitHub ↗