Status line: expose active agents and connected MCP servers in stdin JSON

Resolved 💬 6 comments Opened Mar 30, 2026 by DG-AP Closed Jun 25, 2026

Feature Request

Summary

Add active agent invocations and connected MCP server state to the status line stdin JSON, so custom status line scripts can display real-time session state.

Current behaviour

The stdin JSON passed to statusLine.command contains:

  • model (display name, id)
  • context_window.used_percentage
  • cost.total_cost_usd
  • workspace.current_dir

It does not contain which agents have been invoked or which MCP servers are actually connected.

Desired behaviour

Add two fields to the stdin JSON:

{
  "agents": {
    "available": ["sustainable-coder", "reviewer"],
    "active": ["sustainable-coder"]
  },
  "mcp": {
    "configured": ["gmail", "n8n", "ide"],
    "connected": ["n8n", "ide"]
  }
}
  • agents.available — agents loadable from ~/.claude/agents/ and project .claude/agents/
  • agents.active — agents currently invoked/running in this session
  • mcp.configured — servers in mcp.json
  • mcp.connected — servers that successfully connected at session start

Why this matters

Custom status lines (via statusLine.command) are a powerful way to surface session state in the terminal. Right now scripts can only approximate this by listing config files — they can't distinguish a connected MCP from a broken one, or know if an agent is currently running.

This would enable status lines like:

MINAI | claude-sonnet-4-6 | ctx:42% | $0.18
agents:sustainable-coder(active) | mcp:n8n✓ ide✓ gmail✗

Workaround

Currently listing all files in ~/.claude/agents/ and all keys in mcp.json as an approximation. Works for configured state, not actual connection/activity state.

🤖 Submitted via Claude Code

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗