Repository navigation
feat: list Claude subagents as rows nested under their session - #374
Merged
Merged
Conversation
brtkwr
enabled auto-merge
November 20, 2026 14:00
Codex subagents and codex exec runs already appear as their own rows nested under the session that ran them; Claude Code subagents and teammates only showed as the pink ◆N count. Now each live Claude session's subagents get rows of their own, nested └ under it, with a pink ◆ glyph and "subagent" on the grey row. A row is listed while the subagent is alive (not finished, started by the session's current claude process) and for closedCooldown (30m) after it finishes, marked closed, then dropped. Only live sessions' subagents are looked at. The rows are read in the live tick, off the UI goroutine, through the shared SubagentsOf cache: each transcript is read whole once, then only appended lines, and nothing is read while drawing. Rows are read-only: they preview, have no message box, Enter opens the parent session, and fork, delete, rename, prune, pin and snooze are refused with a grey note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brtkwr
force-pushed
the
feat/claude-subagent-rows
branch
from
November 20, 2026 14:01
d65f197 to
6454f2d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opus 5.5 ✨
What changes
Codex subagents and
codex execruns already show as rows nested└under the session that ran them. Claude Code subagents and teammates (Agent tool) only showed as the pink◆Ncount and the preview's Subagents lines. Now a live Claude session's subagents get rows of their own, nested under it, with a pink◆glyph andsubagenton the grey row. The◆Ncount stays.subagents/agent-<id>.jsonl). The header says◆ subagent.Which subagents are listed, and why
A row shows while the subagent is alive: not finished, and started by the session's current claude process (
SubagentAlive, the same rule as the count). It stays forclosedCooldown(30 minutes) after it finishes, markedclosed, then it leaves the list. Only running sessions' subagents are looked at.I went with this rule rather than hiding finished ones behind
--allthe way headless runs are hidden. One of Bharat's sessions has 42 subagents, and across every transcript there are thousands. Listing finished ones would mean reading all of them, and they would bury the list. With this rule, rows match what the◆Ncount and the Subagents lines describe, and a subagent that just finished gets the same 30 minutes as a nested session that just closed. The preview's Subagents lines still count every finished one.Cost (after #367)
sessions.LiveReadsguard (subagentRowsKey), so a read stuck on a hung mount isn't started twice.transcript.SubagentsOf, so it shares the 2ssubagentsTTLcache the◆count already uses. No extra globbing.transcript.SubagentConv, cached inParseCacheby size and time), then only the lines appended since (ParseAppended). Finished subagents past the cooldown are never opened.TestSubagentRowsAreNotReadPerFramechecks this: 50View()calls and five unchanged ticks cause no reads, and a transcript that grew is read incrementally, not whole.How it fits nearby work
SpawnedwithParentIDset to their session, sonestFamiliesnests them throughspawnParentlike Codex subagents. The family keeps its parent's place, and the children sit under it by start time. A row counts as running while its subagent isn't finished (subagentAliveRow), so it never waits behind a "▸ N closed" line.spawnParent, so walking up from a subagent row should land on its session with no extra code.applyRefreshkeeps the live tick's rows and the selection.Tests
internal/tui/subagents_test.gouses made-upsubagents/fixtures (meta.json and transcripts): running, an idle teammate, finished a minute ago, finished long ago, and one from an earlier process. It checks nesting, the read-only behaviour, Enter going to the parent, the read counting, the refresh carry-over, and a realliveCmdtick that lists the rows. I haven't run the full suite locally; CI runs it.🤖 Generated with Claude Code