`subagentStatusLine` docs list `name` unconditionally, but only some spawn paths deliver it
Environment
- Claude Code 2.1.220 (
2.1.220.5b4), macOS (Darwin 25.6.0) subagentStatusLineconfigured in user-level~/.claude/settings.json
Summary
The statusline documentation (https://code.claude.com/docs/en/statusline#subagent-status-lines) lists name among the fields of each entry in the tasks array, with no condition attached. On 2.1.220 I could not get any task to arrive with a name, and the two spawn paths explain why:
- A subagent spawned without a name has no name to send, and its task object omits the key.
- A subagent spawned with a
name:becomes a teammate, and teammate rows never reach the command at all (#80560).
So a command that reads task["name"] because the docs promise it crashes with a KeyError, and the panel then keeps every default row, because a crashed command produces no overrides for that refresh tick.
The built-in default renderer shows a name for the same row (for example Explore), so the TUI has a name for the task. The name only fails to reach the command's payload.
What the docs say
Each task hasid,name,type,status,description,label,startTime,model,effort,contextWindowSize,tokenCount,tokenSamples, andcwd.
What arrives
One task from a real captured payload on 2.1.220:
{
"id": "ac801c3086e555320",
"type": "local_agent",
"status": "completed",
"description": "List repo files",
"label": "List repo files",
"startTime": 1785598818477,
"model": "claude-opus-5[1m]",
"contextWindowSize": 1000000,
"tokenCount": 28261,
"tokenSamples": [0, 11623, 18508, 25272, 25278, 28259, 28259, 28259, 28259, 28259, 28261],
"cwd": "/usr/local/hal-9000"
}
Across 30 captured invocations in several sessions, no task included name. Every other field behaves as documented, including the conditional ones: effort was absent because each observed subagent inherited the session effort, and model and contextWindowSize were present from the first tick.
For contrast, the docs mark model, contextWindowSize, and effort as conditional. name sits in the unconditional list, next to fields such as id and status that always arrive.
Steps to reproduce
- Add this entry to
~/.claude/settings.json:
``json``
"subagentStatusLine": { "type": "command", "command": "tee /tmp/subagent-payload.json" }
- Restart Claude Code.
- Ask Claude to spawn a subagent, for example: "use an Explore agent to list the repo files".
- While the agent panel shows the task row, read
/tmp/subagent-payload.jsonand check the task objects for anamekey.
Expected
One of:
- Tasks carry
nameon some reachable spawn path, and the documentation states when the field is present, in the same way it does formodelandeffort. - The documentation moves
nameto the conditional fields or drops it from the list.
Related
- #80937 asks to expose
agentTypeper task, and its discussion treatsnameas caller-supplied. This report is the complement: whatevernameis meant to carry, no current spawn path delivers it. - #80560 covers the neighboring gap that makes the naming workaround impossible: named teammate rows never trigger
subagentStatusLineat all. - #78954 is the same class of report for
effort: payload and documentation out of sync.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗