Feature request: configurable agent view — project scoping, group sessions by repo (fold .claude/worktrees), settings surface like statusLine
Environment
- Claude Code v2.1.201 (
claude agentsTUI and desktop app Code tab) - macOS, multi-project + git-worktree workflow (worktrees under
<repo>/.claude/worktrees/, created by Claude Code)
Feature request
Make the agent view configurable, the way the status line already is (statusLine in settings.json runs a user command and renders its output). Today the agent view has exactly one lever — the --cwd <path> launch flag — and no settings surface at all.
Concretely, in priority order:
- Scope to the current project from inside the view.
claude agents --cwdworks, but there is no in-UI toggle or settings key (e.g.agents.scope: "project" | "all"). When you live in one repo, sessions from every other project on the machine are noise. - Group sessions by project, folding worktrees under their parent repo. Sessions running in
<repo>/.claude/worktrees/<name>belong to<repo>— show them under one project header with the worktree name as a tag. Currently rows from all projects are interleaved within the state sections, and you cannot tell which project a row belongs to without opening it (#69449 is the open per-row-repo ask; #61134 asked for directory grouping and was closed). - A settings surface for the view (settings.json
agents.*keys), so preferences like the above persist instead of requiring launch flags — the same philosophy asstatusLine: the harness owns the chrome, the user owns the layout/scope.
Why
The agent view is the control plane for the parallel-session workflow Claude Code promotes. The cwd for every session is already in the data model (claude agents --json exposes it), so filtering and grouping are presentation-layer changes. Users who want a project-scoped, grouped view currently have to build their own UI on top of claude agents --json — which most won't do, and shouldn't need to.
Related: #69449 (open), #61134, #61546, #60975 (closed), and #74138 (worktree recognition bug in the @ dispatch picker, filed separately).
3 Comments
This is exactly the gap I keep running into when running 5-10 parallel sessions. The interleaved-rows problem is the worst part: you open agent view and immediately have to play "which cwd is this session in" before you can do anything useful. The lack of worktree grouping especially hurts because you can have 3 sessions all working on the same repo's worktrees and they look completely unrelated in the list.
The
agents.scope: "project" | "all"config key would cover most of my daily annoyance. Right now I have a wrapper alias that doesclaude agents --cwd $(git rev-parse --show-toplevel)from whatever directory I'm in, but that breaks the moment I want to pull in a related session from a linked repo.One more thing that would help alongside grouping: a short truncated
cwdpath shown as a subtitle on each row (just the last two path segments is enough). Even without full grouping, that single change would let you scan the list without opening each session.Upvoted. Hope this gets some traction.
The session-scoping gap becomes a real friction point once you're running more than two or three projects at once. Right now the agents view is essentially a global process list -- useful, but the signal-to-noise ratio degrades fast when unrelated projects mix in.
The worktree grouping request (folding
.claude/worktrees/<name>under the parent repo) is the one I'd prioritize. Git worktrees are already a first-class Claude Code pattern for parallel-branch work, and the session rows for worktrees look identical to main-branch sessions unless you manually inspect the cwd. Grouping would make the agent hierarchy readable at a glance.The
agents.*settings key proposal aligns well with howstatusLinealready works -- that pattern (user-owned JSON config that persists across launches) is the right model to follow. Aagents.scopeoragents.group_bykey would handle most of the use cases here without requiring a more complex UI.One addition worth considering: a per-session label or tag (set at dispatch time) that's shown in the view. Even a short prefix would let users impose their own grouping without waiting for native project scoping.
The
--cwdflag works but it's a workaround for a missing feature rather than a real solution. The data model already has everything needed - cwd per session is inclaude agents --jsonright now. The missing piece is just the presentation layer filtering and grouping it.The worktree grouping point is the one that gets me the most. When you run parallel work across .claude/worktrees/<branch-name>/, each worktree session appears as a peer row with no visual connection to the parent repo. You end up reading session names to figure out what belongs together, which defeats the purpose of a session list.
A few things that would actually solve this in priority order:
The
claude agents --jsonoutput already has everything needed for (1) and (3). This feels like a display change rather than a data change.