Feature: Expose active subagent model + type in statusline JSON
Related
This is the statusline counterpart to #24094 (showing model in tool call UI). Together they'd give full model visibility across the CLI.
The Problem
The statusline JSON ($json.model) only contains the parent conversation's model. When subagents are running via the Task tool, there's no way to know:
- Which model the subagent is using
- What type of agent it is (Explore, Plan, general-purpose, etc.)
- How many subagents are running concurrently
- The task description
This means custom statusline scripts can't display subagent activity — the most dynamic and interesting part of a Claude Code session is completely invisible in the status bar.
What I'd Love to See
Add an active_agents field to the statusline JSON:
{
"model": { "id": "claude-opus-4-6", "display_name": "Claude Opus 4.6" },
"active_agents": [
{
"model": { "id": "claude-opus-4-6", "display_name": "Claude Opus 4.6" },
"agent_type": "Explore",
"description": "Find auth patterns",
"started_at": "2026-02-08T03:50:00Z"
},
{
"model": { "id": "claude-sonnet-4-5-20250929", "display_name": "Claude Sonnet 4.5" },
"agent_type": "general-purpose",
"description": "Run tests",
"started_at": "2026-02-08T03:50:02Z"
}
],
"context_window": { ... }
}
This would let statusline scripts show things like:
22:30 | Opus 4.6 | Explore (Opus) + general-purpose (Sonnet) | project | main clean | [====----] 35%
Current Workaround
I built PreToolUse/PostToolUse hooks on the Task tool that write subagent info to a cache file (~/.claude/cache/active-subagent.json), then the statusline PowerShell script reads that file. It works but has issues:
- Poll-based — statusline refreshes on interval, so fast agents get missed
- Race conditions — concurrent agents writing to same file
- Stale data — if a hook crashes, cache file persists showing phantom agents
- No resolved model — hooks only see the
modelparameter ("sonnet","opus", or absent for inherit), not the actual resolved model ID/display name
Native support in the statusline JSON would eliminate all of these problems since Claude Code already knows exactly which agents are active and what models they're using.
Why This Would Be Great
The statusline is the perfect place for at-a-glance agent activity — it's always visible, updates in real-time, and is already customizable. Adding active_agents would let power users build rich status displays that show the full orchestration picture. Combined with #24094 (model in tool call headers), this would make Claude Code's multi-agent system fully transparent.
Would love to see this! 🚀
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗