statusLine: add optional periodic refresh interval

Resolved 💬 2 comments Opened May 5, 2026 by Zarkk1zz Closed May 5, 2026

Problem

statusLine currently refreshes only on event-driven triggers (assistant messages, tool calls, user input). When the session is idle — e.g. background Task subagents running in parallel, long-running tests, or async work — the statusline becomes stale and continues to display outdated counters even though the underlying data sources (transcript JSONL, cache files, project state) have changed.

This is especially noticeable for:

  • Background Task subagent counters (number of running agents)
  • Memory/vector store entry counts populated by async writes
  • Swarm coordination state files that get updated outside Claude Code's event loop
  • Long-running operations whose progress is only visible via the statusline

Request

Add an optional periodic refresh interval to statusLine config:

{
  "statusLine": {
    "type": "command",
    "command": "node .claude/helpers/statusline.cjs",
    "refreshIntervalMs": 60000
  }
}

Behavior:

  • When set (e.g. 60000), the statusline command re-runs on a timer in addition to the existing event triggers.
  • When omitted/0, current event-only behavior is preserved (no breaking change).
  • Sensible minimum (e.g. 5s) to avoid abuse.

Use case

I maintain a custom statusline (statusline.cjs) that surfaces live counts of background subagents, AgentDB vector entries, swarm registry state, and hooks status. With many parallel Task subagents running for several minutes, the user has no visual feedback until they type something — the statusline shows 0/15 agents despite 7+ active subagents. A 60s tick would make idle progress observable.

Environment

  • Claude Code 2.1.128 (Windows 10)
  • Custom statusLine command (Node.js script reading transcript + project state)

Thanks!

View original on GitHub ↗

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