[FEATURE] Tell the statusLine which subagent is focused when viewing its transcript

Open 💬 0 comments Opened Jul 12, 2026 by UtsavBalar1231

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

When I open a subagent's transcript (arrow down to the task list, then into the agent), the statusline at the bottom keeps rendering the parent session. My main session runs on Opus and delegates implementation to Sonnet executors, so while I'm inside an executor transcript the statusline still says Opus plus the orchestrator agent name. At a glance it looks like the executor is burning Opus tokens, which it isn't.

I instrumented my statusline command to dump raw stdin and switched views while four subagents were running (v2.1.207):

  • The main statusLine command keeps getting invoked while the subagent view is open, but the payload is byte-for-byte the main session's. model, agent, agent_type, session_id, transcript_path never change across the focus switch; only cost, context_window, and rate_limits tick.
  • The subagentStatusLine tasks payload carries per-task id, status, model, tokenCount, and so on, but no focused/selected field on any task.

So a custom statusline has no way to know which subagent is on screen, or that one is on screen at all.

Proposed Solution

Either of these closes the gap, first one preferred:

  1. When a subagent view is focused, add the focused task to the statusLine payload:
"focused_task": {
  "id": "a79bf9f5dc80d57e8",
  "type": "local_agent",
  "model": "claude-sonnet-5"
}

Absent in the normal main-session view, so existing statusline scripts keep working unchanged. My script would swap in the subagent's name and model while the field is present and fall back to the session line when it disappears.

  1. Add focused: true to the corresponding entry in the subagentStatusLine tasks array.

Option 1 covers the fullscreen transcript view, where the tasks panel and its per-row statuslines aren't visible at all. Option 2 only helps the panel rows, but it would at least let the row renderer mark the selection.

Alternative Solutions

None that work today. #73654 got per-task model into the subagentStatusLine payload (v2.1.205), which fixes the tasks panel rows, but that panel isn't visible from inside a transcript. I diffed both payloads across repeated focus switches looking for anything to key off, documented or not. There's nothing.

Priority

Medium - Would be very helpful

Feature Category

Interactive mode (TUI)

Use Case Example

  1. Main session on Opus orchestrates a plan and spawns four executors pinned to Sonnet.
  2. I drop into one executor's transcript to watch it work through a task.
  3. The statusline keeps showing the Opus session identity for the whole time I'm in there.
  4. With focused_task, the statusline would read "executor / Sonnet 5" in that view, so I can tell at a glance which agent and model I'm actually watching.

Additional Context

This is the second half of the problem described in #73654 (the issue body there already notes the main statusLine payload "does not change when a sub-agent is focused"). The model-in-tasks-payload half shipped in v2.1.205; focus state is what's left. I also left a comment there with the capture details: https://github.com/anthropics/claude-code/issues/73654#issuecomment-4950554931

Happy to share the raw payload dumps if useful.

View original on GitHub ↗