[FEATURE] Agent view: sort by most recently updated, not just creation time

Status Open
Maintainer reply None cached
Activity 8 comments · opened May 12, 2026

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

Agent view groups sessions by state but within each group, sessions are ordered by creation time. There's no way to sort by most recently updated. When running sessions over several days, the ones I actually care about (recently active) get buried under older sessions that happen to share the same state.

Proposed Solution

Add a sort toggle (maybe Ctrl+O or similar) to switch between "sort by created" and "sort by last updated" within each group. Alternatively, default to most-recently-updated since that's almost always what you want when scanning the list for something to act on.

Priority

Medium - Would be very helpful

Feature Category

Interactive mode (TUI) / Agent view

View original on GitHub ↗

7 Comments

github-actions[bot] · 3 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/51392

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

jonathanlaniado · 3 months ago

Not a duplicate. #51392 is about the VS Code extension's session picker (sort order in a dropdown for --resume). This is about the agent view TUI (claude agents) needing a sort-by-last-updated option within the session table. Different surface, different interaction model.

akovalova-cz · 2 months ago

Related ask: alongside sorting by recency, it'd help to filter the view by time — "show only sessions from the last 1/2/3 days." Once a lot of sessions accumulate, even with good sorting I'm scrolling past stuff from weeks ago that I'll never touch. Today the only filter is --cwd; there's no --since/--days option, and the TUI can't be scoped by age at all. The timestamps already exist (startedAt in claude agents --json), so the data's there — just no way to filter on it from the view itself.

ccancellieri · 2 months ago

Hitting the same thing here, specifically in the Completed group. Once a day's worth of background sessions pile up, there's no way to tell which one finished last, which is usually the one I want to jump back into.

One thing worth folding in while this is being looked at: claude agents --json only exposes startedAt. There's no completion or last-updated timestamp in the output, so even as a workaround I can't pipe it through jq and sort the done sessions by when they actually finished. Start time is the only proxy available, and for long-running background sessions that's often not the same ordering at all.

So two parts to the same gap: the in-TUI sort toggle proposed above, and a completedAt/updatedAt field in the --json output so the same ordering is reproducible from a script. The data clearly exists internally since the view tracks state transitions.

yonihorn · 2 months ago

Without sorting by recently updated in the completed section of the agents view, it's very frustrating to work with long-running sessions—it's nearly impossible to find the session you have just used.
The Agents view is great, and this change would make it much more usable!

akovalova-cz · 2 months ago

+1 — the lack of last-activity sorting makes the agent view genuinely hard to use day to day, not just suboptimal.

The concrete problem: sessions are ordered by creation time within their state group, so an active session's position is effectively random relative to what I'm actually working on. Every time I come back I have to visually scan to find where a given session landed. And because sorting isn't by last input/activity, a session I just interacted with stays buried wherever it was created — including getting stuck somewhere in the middle of the Completed group — instead of surfacing to the top.

Defaulting to most-recently-updated (with the proposed sort toggle as an option) would fix this. The "jump to the session I last touched" case is the common one and right now it requires a manual hunt every time.

builder-main · 1 month ago

I keep loosing my flow immensly due to this very wrong ordering. So yes please, implement this.

Showing cached comments. Read the full discussion on GitHub ↗