`subagentStatusLine` docs list `name` unconditionally, but only some spawn paths deliver it

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 1 comment · opened Aug 1, 2026

Environment

  • Claude Code 2.1.220 (2.1.220.5b4), macOS (Darwin 25.6.0)
  • subagentStatusLine configured 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 has id, name, type, status, description, label, startTime, model, effort, contextWindowSize, tokenCount, tokenSamples, and cwd.

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

  1. Add this entry to ~/.claude/settings.json:

``json
"subagentStatusLine": { "type": "command", "command": "tee /tmp/subagent-payload.json" }
``

  1. Restart Claude Code.
  2. Ask Claude to spawn a subagent, for example: "use an Explore agent to list the repo files".
  3. While the agent panel shows the task row, read /tmp/subagent-payload.json and check the task objects for a name key.

Expected

One of:

  • Tasks carry name on some reachable spawn path, and the documentation states when the field is present, in the same way it does for model and effort.
  • The documentation moves name to the conditional fields or drops it from the list.

Related

  • #80937 asks to expose agentType per task, and its discussion treats name as caller-supplied. This report is the complement: whatever name is 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 subagentStatusLine at all.
  • #78954 is the same class of report for effort: payload and documentation out of sync.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗