You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Show the current session's subagents and background tasks, with stop and transcript view #439
Rescoped after review on #443: the current session's agents only, built on the Agent SDK, with no Claude Code UI and no private job files.
Problem Statement
A session's subagents and background tasks are visible only as their tool calls in the transcript, where a detached launch shows a ↗ icon and a later result. There is no single place to see which of them are still running, what each is doing, or how much it has used. A running task cannot be stopped from claude-rs, and a subagent's own transcript cannot be read.
Proposed Solution
Add a view of the active session's subagents and background tasks, built on the Agent SDK the bridge already uses:
Source of truth: the task lifecycle state the bridge already normalizes from task_started / task_progress / task_updated / task_notification, held in Rust as sdk_inventory.tasks and on the Detached tool calls. The view projects that state and keeps no second store.
Progress data: forward the token and tool-use counts, last_tool_name and the progress summary from task_progress as fields of the existing TaskMetadata.
Stop: a stop_task command calls Query.stopTask(). The resulting stopped notification flows through the existing task path.
Subagent transcript: a get_subagent_messages command calls getSubagentMessages(), and listSubagents() shows which subagents have a transcript.
changed the title [-][Feature]: Open Claude Code's agent view with Left on an empty prompt, and show background agent status in the footer[/-][+][Feature]: Show the current session's subagents and background tasks, with stop and transcript view[/+]on Oct 10, 2026
Following up on your replacement design in #443: let's use this issue for the design discussion and keep a future PR focused on reviewing the agreed implementation.
The active-session scope and SDK-based direction make sense: include both subagents and background tasks, including background shell jobs. Use the task state we already have, with no separate CLI invocation, private job-file access, global roster, or second task store.
On your UI questions:
Give the active session's subagents and background tasks a separate tab/view, grouped by task type, while reusing the existing configuration display and navigation logic.
Use /task to open it, and support access through Left Arrow navigation. Please describe the focus and key behavior, including what happens while editing a draft, so we can settle the interaction here.
A footer counter for running subagents and background tasks, including background shell jobs, is acceptable. Derive it from the existing normalized lifecycle state and count each execution once, even when it also appears as a detached tool call. A saved transcript or completed task must not count as running.
Your proposed SDK operations are the right place to start: the task lifecycle events for live state, Query.stopTask() for requesting cancellation, and listSubagents() / getSubagentMessages() for transcript discovery and inspection. Keep cancellation acknowledgement separate from the eventual stopped state, and keep transcript reads separate from live task status.
Before implementation, please resolve the task-to-transcript association you raised: do listSubagents() agent IDs match local_agent task IDs in the pinned runtime, and what does the view show when a task has no verified transcript association? Also check which metadata is actually missing: lifecycleMetadata() in tasks.ts already retains progress summary.
Have your agent read AGENTS.md, docs/src/architecture.md, and the relevant declarations in agent-sdk/node_modules/@anthropic-ai/claude-agent-sdk/sdk.d.ts: SDKTaskStartedMessage, SDKTaskProgressMessage, SDKTaskUpdatedMessage, SDKTaskNotificationMessage, listSubagents(), getSubagentMessages(), and Query.stopTask(). Build on tasks.ts and task_links.ts, and update the Rust and bridge contracts together where needed.
Please continue the discussion here with the proposed navigation, counter semantics, and runtime ID findings before opening the replacement PR.
#456 did not follow this issue. I'll close it, and open nothing for this until the points below are agreed. @srothgan please review these
Runtime ID findings
Measured on SDK 0.3.288 / runtime 2.1.288 with one subagent and one run_in_background Bash command, in two runs that agreed.
A listSubagents() id equals the local_agenttask_id from task_started, and it differs from the Agent call's tool_use_id.
A running subagent was listed before it completed, but not at the first poll about 2 s after task_started. So a running task can briefly have no transcript.
The background shell task (task_type: local_bash) never appears in listSubagents(). background_tasks_changed listed only the shell task, never the foreground subagent.
stopTask(task_id) on the shell task produced task_updated (killed), then task_notification (stopped) about 3.8 s later, both with the same task_id.
The stopTask promise itself rejected with "Query closed before response received", because the single-prompt query ended first. I'd confirm the acknowledgement on a long-lived query before relying on it.
Not covered: nested or backgrounded subagents, resume.
Missing metadata
Nothing the view needs is missing. lifecycleMetadata() keeps every field these runs sent: task_type, subagent_type, is_backgrounded, output_file, end_time, the terminal status and summary. Only task_progress's usage (tokens, tool uses, duration) and last_tool_name are dropped; last_tool_name is only logged. I'd add them only if you want them on a row.
Navigation
Opening it: a Tasks tab in the existing fullscreen view, grouped by task type, reusing its tab and list navigation. /task opens it on that tab.
Left Arrow: opens it only when the composer is empty and no menu is open. With a draft, Left moves the cursor as today.
Keys in the view: Up/Down select, Enter opens a verified transcript, s stops a running task, r re-checks transcripts. Esc returns to the composer with any draft intact.
Counter
The footer counts running local_agent and local_bash lifecycle tasks, once per task_id, including a task that is also a detached tool call. Completed, failed and stopped tasks and saved transcripts never count. The counter is hidden at zero.
Stop and transcripts
Stop is offered only for a running lifecycle task_id. A row shows Stopped only when the lifecycle messages say so, never on the request. A row gets a transcript only when its local_agenttask_id matches a listed id. Until then it shows "no transcript", and nothing is inferred.
Open questions
Should other task types (local_workflow, MCP tasks) appear and count?
Should finished tasks stay listed for the whole session?
Should the id equality get a contract test against the pinned SDK?
I want a new full screen view. Not part of the current config/mcp/usage view but a new dedicated full screen, just matching copying some logic. I dont want to see Agents next to MCP in the tabs list
Maybe only subagents list? Since we already have a dedicated function we can call and use
Yes, one list for the current session, grouped by task type: subagents (local_agent) and background shells (local_bash). "Agent" and "subagent" are the same rows here, so that is two groups today, and more only if you want other task types. Selecting a subagent shows its transcript in the same screen.
Agreed: a dedicated full-screen Tasks view with its own title, not a tab next to MCP. /task, or Left Arrow from an empty composer, opens it, and Esc returns to the composer with the draft intact. It would reuse the list, selection and scroll helpers the config view uses, without being part of that view.
The rest of the proposal stays as written. Does this match what you have in mind? I'll wait for your go before opening a PR.
Activity
[-][Feature]: Open Claude Code's agent view with Left on an empty prompt, and show background agent status in the footer[/-][+][Feature]: Show the current session's subagents and background tasks, with stop and transcript view[/+]srothgan commentedon Oct 13, 2026
Following up on your replacement design in #443: let's use this issue for the design discussion and keep a future PR focused on reviewing the agreed implementation.
The active-session scope and SDK-based direction make sense: include both subagents and background tasks, including background shell jobs. Use the task state we already have, with no separate CLI invocation, private job-file access, global roster, or second task store.
On your UI questions:
/taskto open it, and support access through Left Arrow navigation. Please describe the focus and key behavior, including what happens while editing a draft, so we can settle the interaction here.Your proposed SDK operations are the right place to start: the task lifecycle events for live state,
Query.stopTask()for requesting cancellation, andlistSubagents()/getSubagentMessages()for transcript discovery and inspection. Keep cancellation acknowledgement separate from the eventual stopped state, and keep transcript reads separate from live task status.Before implementation, please resolve the task-to-transcript association you raised: do
listSubagents()agent IDs matchlocal_agenttask IDs in the pinned runtime, and what does the view show when a task has no verified transcript association? Also check which metadata is actually missing:lifecycleMetadata()intasks.tsalready retains progresssummary.Have your agent read
AGENTS.md,docs/src/architecture.md, and the relevant declarations inagent-sdk/node_modules/@anthropic-ai/claude-agent-sdk/sdk.d.ts:SDKTaskStartedMessage,SDKTaskProgressMessage,SDKTaskUpdatedMessage,SDKTaskNotificationMessage,listSubagents(),getSubagentMessages(), andQuery.stopTask(). Build ontasks.tsandtask_links.ts, and update the Rust and bridge contracts together where needed.Please continue the discussion here with the proposed navigation, counter semantics, and runtime ID findings before opening the replacement PR.
ayush5harma commentedon Oct 13, 2026
#456 did not follow this issue. I'll close it, and open nothing for this until the points below are agreed. @srothgan please review these
Runtime ID findings
Measured on SDK 0.3.288 / runtime 2.1.288 with one subagent and one
run_in_backgroundBash command, in two runs that agreed.listSubagents()id equals thelocal_agenttask_idfromtask_started, and it differs from the Agent call'stool_use_id.task_started. So a running task can briefly have no transcript.task_type: local_bash) never appears inlistSubagents().background_tasks_changedlisted only the shell task, never the foreground subagent.stopTask(task_id)on the shell task producedtask_updated(killed), thentask_notification(stopped) about 3.8 s later, both with the sametask_id.stopTaskpromise itself rejected with "Query closed before response received", because the single-prompt query ended first. I'd confirm the acknowledgement on a long-lived query before relying on it.Missing metadata
Nothing the view needs is missing.
lifecycleMetadata()keeps every field these runs sent:task_type,subagent_type,is_backgrounded,output_file,end_time, the terminal status andsummary. Onlytask_progress'susage(tokens, tool uses, duration) andlast_tool_nameare dropped;last_tool_nameis only logged. I'd add them only if you want them on a row.Navigation
/taskopens it on that tab.sstops a running task,rre-checks transcripts. Esc returns to the composer with any draft intact.Counter
The footer counts running
local_agentandlocal_bashlifecycle tasks, once pertask_id, including a task that is also a detached tool call. Completed, failed and stopped tasks and saved transcripts never count. The counter is hidden at zero.Stop and transcripts
Stop is offered only for a running lifecycle
task_id. A row shows Stopped only when the lifecycle messages say so, never on the request. A row gets a transcript only when itslocal_agenttask_idmatches a listed id. Until then it shows "no transcript", and nothing is inferred.Open questions
local_workflow, MCP tasks) appear and count?srothgan commentedon Oct 13, 2026
Maybe only subagents list? Since we already have a dedicated function we can call and use
ayush5harma commentedon Oct 13, 2026
local_agent) and background shells (local_bash). "Agent" and "subagent" are the same rows here, so that is two groups today, and more only if you want other task types. Selecting a subagent shows its transcript in the same screen./task, or Left Arrow from an empty composer, opens it, and Esc returns to the composer with the draft intact. It would reuse the list, selection and scroll helpers the config view uses, without being part of that view.The rest of the proposal stays as written. Does this match what you have in mind? I'll wait for your go before opening a PR.
srothgan commentedon Oct 13, 2026
Go ahead, but use /agents since we only do subagents now