statusLine always reports the main session, even when a subagent or teammate transcript is focused
What happens
The bottom-bar statusLine always renders the main session's state, even when the focused transcript in the TUI is a Task subagent or an agent-team teammate. Switching panes changes the transcript above the bar but nothing in the bar.
So in a subagent pane you see:
model.display_name— the main loop model, not the subagent's resolved model. A Haiku subagent pane still readsOpus 5.context_window.*— the main thread's context, so the usage bar is the main session's, not the focused agent's.context_window.current_usage— the main thread's last assistant-turn usage. Anything derived from it (e.g. a cache-hit-rate segment:cache_read_input_tokens / (input + cache_creation + cache_read)) is frozen at the last main-loop turn while the subagent does all the work.effort,cost,exceeds_200k_tokens— likewise main-thread values.
rate_limits.five_hour / seven_day are account-scoped, so those are the one part that is legitimately the same in every pane.
Version: Claude Code 2.1.220, Windows 11 (win32).
Repro
- Any
statusLinecommand that echoesmodel.display_nameandcontext_window.used_percentage. - Dispatch a subagent on a different model (e.g.
Agentwithmodel: "haiku"), or run withCLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1and open a teammate. - Focus the subagent/teammate transcript.
- Bar still shows the main session's model and context.
What the shipped bundle shows
Reading the 2.1.220 bundle, this looks structural rather than a rendering bug:
statusLineTextis a single scalar on the one global app store — it sits in the same initializer astasks,transcripts,taskDecorations,runningSubagents,agentNameRegistry,replTab,viewSelectionMode. There is one status-line string for the whole app, not one per pane.- It has a single producer: the status-line hook takes
{ messagesRef, lastAssistantMessageId, tokenUsage, vimMode }, builds the stdin payload withmessages: <main REPL message list>,mainLoopModel,cwd, then writes the command's stdout intostatusLineText. context_windowis derived from that main-thread message list (last assistant message'susage), andmodelfrommainLoopModel.- Focusing a pane only moves a selector over
transcripts/replTab/viewSelectionMode. It does not remount or re-parameterize the status-line hook, and the payload has no notion of which pane is focused. - The payload does carry
agent.name, but that is the main thread's agent type (as set by--agent), not the focused subagent — so a script cannot even detect that a different pane is in view, let alone render for it.
Net effect: there is no field in the statusLine stdin schema that identifies the focused agent, so this is not fixable from the status-line script side.
What I'd like
Make the bottom bar pane-aware. Either of these would solve it:
- Re-invoke
statusLinewith the focused agent's context when the focused pane is a subagent/teammate — i.e.model,context_window,effort,costresolved for that agent, plus a field identifying it (agent name/type/session id), with the main session's values still reachable (e.g. under amain_sessionkey) so a script can render both. - Or, minimally, add a
focused_agentblock to the existing payload ({ name, type, model: { id, display_name }, context_window, effort }, absent when the main transcript is focused) and let the script decide what to display.
Option 1 is what I'd expect as a user; option 2 is backward-compatible and enough to unblock.
Related
- #80560 —
subagentStatusLineonly covers Task subagents, not teammate or workflow rows. That issue is about the agent-panel rows; its "Related" section notes this bottom-bar gap in passing, but there is no standalone issue for it.subagentStatusLinedoes not address the bottom bar at all. - #83131 —
subagentStatusLinedocs listnameunconditionally.
Docs
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗