anthropics / anthropics/claude-code

[FEATURE] Persistent subagent inspector in the TUI — reopen any subagent's transcript, message it directly, edit its metadata

Aperta
#92,950 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area:agent-view area:agents area:tui enhancement
Lingua principale
Python
Stelle
145k
Fork
23.1k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

### Preflight Checklist

- [x] I have searched existing requests. Nearest matches are #90520 (resume/read a completed subagent's transcript, framed around the orchestrator reusing its context, plus a desktop side-panel fix) and #80798 (promote a subagent into a standalone session and demote it back). Neither asks for a persistent, browsable in-TUI subagent inspector, and neither covers editing a subagent's metadata. See "Relationship to existing agent-view functionality" below.
- [x] This is a single feature request — one surface (a persistent subagent inspector in the TUI) with three operations on it.

### Problem Statement

I run a hierarchical setup: the main conversation is a top-level orchestrator that delegates to a tree of subagents, sometimes several levels deep. The subagent panel below the prompt input already displays that tree well while work is in flight — nested rows, `(+N)` descendant counts, a path back to `main`.

The problem is that the panel is a **live view, not a browsable one**. A subagent is reachable only while its row happens to be present:

- When a subagent finishes successfully, its row is removed immediately. There's a 30-second window where the footer offers `/tasks to see subagents` and `Enter` on the row opens its transcript. After that window the run is gone from the UI for the rest of the session — even though its transcript is sitting on disk for `cleanupPeriodDays` (30 days by default).
- Typing into a subagent's transcript to steer it directly only works *while that subagent's row is still in the subagent panel*. Once the row is gone, the only channel to that subagent is the orchestrator.
- Nothing about a subagent — its name, its description, its model — can be changed from the UI. `/model` and `/fast` typed in a subagent's transcript view explicitly apply to the main conversation, with a notice saying so.

Reviewing what a given subagent actually did, and steering one individual subagent, are both routine needs in this workflow. Both currently fall off a 30-second cliff.

### Proposed Solution

Make the subagent panel a **persistent inspector for every subagent in the session**, not just the currently-live ones, with three operations on the selected row.

**1. Open the transcript of any subagent in the session, running or not.**

Keep every subagent of the current session addressable in the panel (or in `/tasks`) for the lifetime of the session — collapsed, or under a "Finished" group if the live list needs to stay clean — and let `Enter` open its transcript whether it ended 10 seconds or 3 hours ago. Same for a currently-running subagent at any depth in the tree.

*User story:* a three-level-deep research subagent finished 20 minutes ago and its parent summarised it in one line. I want to read what it actually looked at, so I select its row and press `Enter`.

**2. Message a subagent directly from the UI.**

Let me type into a selected subagent's transcript and have the message go to *that* subagent — including one that isn't currently active (resume it), and including one several levels down the tree — instead of routing through the top-level orchestrator and relying on it to relay my intent to the right child.

*User story:* one subagent in a fan-out of six is heading the wrong way. Today I have to describe which one to the orchestrator and ask it to pass a correction down. I want to select that subagent and tell it directly.

Directness matters most with nesting: "tell the reviewer under the implementer to stop rewriting the tests" is a lossy game of telephone, and it costs a full orchestrator turn.

**3. Edit a subagent's metadata from the UI.**

On a selected subagent, let me edit that run's metadata — rename it (the `name` that makes it addressable), edit its description / task label, change its model — and have the change apply to *that subagent's* next run rather than silently applying to the main conversation.

*User story:* a subagent I want to keep steering was spawned on a fast model and is now out of its depth. I want to select it, change its model, and send it a follow-up, without respawning it and losing its context.

Scope note: this is about the live subagent instance, not the on-disk definition. It's fine if some fields are per-run only.

### Alternative Solutions

- **Read the transcript file on disk** (`~/.claude/projects///subagents/agent-.jsonl`). It works, but it's a raw JSONL dump outside the tool: no rendering, no tool-call collapsing, and I have to figure out which agent ID is which first. A poor experience for something as routine as "what did that agent actually do?".
- **Ask the orchestrator to message the subagent so it reappears.** Messaging a completed subagent auto-resumes it, which puts its row back in the panel and makes its transcript openable again. This is the workaround I actually use, and it's bad: I burn an orchestrator turn and a subagent turn, plus tokens on both, purely to make a UI row come back so I can *read* something that already exists on disk. It also mutates the very run I wanted to inspect.
- **Ask the orchestrator to relay my steering.** Costs a turn, is lossy, and degrades the deeper the target sits.
- **Promote the subagent to a standalone session** (#80798). A heavier primitive that changes where the agent lives. I'd like to inspect and steer in place, without lifting the agent out of the orchestrator's tree.

### Priority

High - Significant impact on productivity

### Feature Category

Interactive mode (TUI)

### Relationship to existing agent-view / `/agents` functionality

- **`claude agents` / agent view** is a different surface: it lists background *sessions*, and the docs are explicit that subagents and teammates a session spawns aren't listed as separate rows. So agent view covers none of this today. (#62277 asked for subagents nested in agent view and was closed as inactive; #92189 asks for subagent activity there.)
- **The in-session subagent panel / `/tasks`** already has the renderer and the tree, so this request is mostly about *retention and addressability* plus the two write paths. The transcript view, the nested tree with `(+N)`, "type into its transcript to resume it", and per-subagent transcript files all exist. The gap is that a subagent stops being selectable ~30 seconds after it ends.
- **`/agents`** used to be an interactive wizard with a **Running** tab listing live subagents and a **Library** tab for creating, editing, and deleting them; as of v2.1.198 it prints a reminder to edit `.claude/agents/` directly instead. So capability 3 has partial precedent that was removed — and that Library tab edited *definitions on disk*, not a live run, which is what this asks for.
- **#90520** asks for a completed subagent to stay resumable and for its transcript to be exposed, motivated by the orchestrator reusing the context. It overlaps capability 1's *data availability*, but not the browsable UI, the direct user-to-subagent channel, or metadata editing.
- **#80798** asks to promote a subagent into a standalone session and demote it back, which would incidentally deliver transcript viewing and direct steering. This request is the lighter, in-place version of that, and adds metadata editing.
- Adjacent monitoring requests: **#76963** (DAG view of orchestrator/subagent workflows), **#88177** (tools to oversee many background agents), **#76055** (show subagent model/config in the detail view — closed as inactive, and read-only).

### Use Case Example

1. The orchestrator fans out six subagents; two of them spawn children of their own.
2. Four finish. Their rows vanish immediately and the `/tasks` window lapses, so all I have left is each parent's one-line summary.
3. I want to check the work of one that finished 20 minutes ago: I select its row in the inspector and press `Enter` to read its transcript.
4. A different subagent, two levels down, is drifting. I select it and type a correction straight into its transcript — it resumes and acts on it, without an orchestrator round-trip.
5. That same subagent needs more capability than the model it was spawned on. I change its model from the inspector and send the follow-up, keeping its context.

### Additional Context

The data already exists: per-subagent transcripts persist for the session (and 30 days on disk), the panel already renders a subagent transcript, and a completed subagent can already be resumed by message. The missing piece is a UI that keeps every subagent of the session reachable and lets me act on the selected one.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start with the in-session subagent panel and `/tasks` entry point, then trace the existing transcript view, nested tree renderer, resume-by-message flow, and per-subagent transcript files described here. Done means finished subagents remain selectable, Enter opens their transcripts, direct messages target the selected subagent, and metadata changes apply to that run.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Ambito
cli
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.