[BUG] /agents Library list does not auto-scroll viewport — selection past first page is invisible

Resolved 💬 4 comments Opened May 7, 2026 by charles-byborg Closed May 7, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

When opening /agents and navigating into the Library tab, the list renders all available agents top-to-bottom. As soon as the active selection moves below the visible terminal viewport, the highlight is no longer visible — the cursor keeps moving on / PgDn, but the rendered list does not scroll to follow it.

For users with many installed agents (I have ~170 in ~/.claude/agents/, primarily from a plugin/marketplace bundle), this makes the picker unusable past the first page. You can press Enter on a selection you can't see.

What Should Happen?

The Library list should keep the active selection within the visible viewport — either by virtualizing the rendered list with a scroll offset that follows the cursor, or by using the same paginated picker primitive used by the slash-command autocomplete (which already supports Type to filter + visible-window scrolling).

Steps to Reproduce

  1. Install Claude Code 2.1.119 on macOS.
  2. Populate ~/.claude/agents/ with 50+ agent definitions (any plugin marketplace with a large agent bundle reproduces this; mine is ~170 files).
  3. Run /agents inside a Claude Code session.
  4. Press Tab to focus the Library tab.
  5. Press repeatedly past the bottom of the visible list.

Observed: the highlighted row scrolls offscreen below; the rendered list never advances. PgDn behaves the same way. Selection state continues internally, so pressing Enter selects an unseen agent.

Expected: the list scrolls so the highlighted row stays visible.

Error Messages/Logs

No errors — purely a rendering/viewport bug.

Claude Code Version

2.1.119 (Claude Code) — Homebrew Cask install (/opt/homebrew/Caskroom/claude-code/2.1.119/claude).

Regression

Unknown — this is the first time I've had a library this large, so I can't say whether earlier versions handled it correctly. The bug itself is reliably reproducible on every attempt with the steps above on 2.1.119.

OS / Terminal

  • OS: macOS (Darwin 25.4.0, arm64)
  • Terminal: iTerm2

Additional Information — Root cause from the binary

Inspecting strings inside the shipped binary, the /agents Library list component (referred to as s6K in the minified bundle) renders the full filtered agent list eagerly:

P.map((C) => Jq.createElement(uD_, {
  key: `${C.agentType}-${C.source}`,
  agent: C,
  activeSelection: X,
  runningByType: O
}))

There is no slice(start, end), no visibleCount prop, no scroll-offset state, and no useEffect that adjusts the rendered window when the active selection (Y) changes. Compare to the autocomplete picker (VD_ in the same bundle), which does take a visibleCount and renders a windowed slice — that one works correctly.

The status line of the Library picker hints only at the supported keys:

<TAB>/<Shift+TAB> switch tabs · <↑>/<↓> navigate · Enter select · Esc close

…confirming there's no filter/search input and no documented PgDn behavior to mitigate the missing scroll.

The parent component also caps the rendered height at:

let U = O ?? Math.min(Math.floor(C * 0.8), 30)

i.e. ≤30 rows regardless of terminal size, so even maximizing the terminal window cannot expose more of the list. With ~170 agents, ~140 are unreachable in any usable way.

View original on GitHub ↗

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