[Feature Request] Add state field to statusline JSON data

Resolved 💬 6 comments Opened Mar 29, 2026 by Tanariel Closed May 8, 2026

Bug Description
---
Feature request: Add state field to statusline JSON data

The statusline script receives useful data (model, tokens, git, cost...) but there's no way to know if Claude is currently busy (thinking, calling tools, waiting for subagents) or idle (waiting for user input).

I tried several workarounds:

  • Checking transcript JSONL file modification time → doesn't work because statusline only refreshes during Claude's activity
  • Using PreToolUse hooks to write a marker file → same timing issue
  • Parsing the last JSONL entry type → tool calls are "assistant" type, indistinguishable from final responses

None of these work reliably because the statusline refresh is tied to Claude's activity cycle, not an independent timer.

Proposed solution: Add a state field to the statusline JSON input, e.g.:
{
"state": "idle" | "thinking" | "tool_calling" | "waiting_subagents"
}

This would be trivial for the harness to provide (it already knows the state) and impossible for external scripts to reliably detect. Bonus: it would enable users to build richer status displays (spinners, color-coded states, etc.).

---

Environment Info

  • Platform: darwin
  • Terminal: tmux
  • Version: 2.1.87
  • Feedback ID: 9fa46117-3dec-4d1a-a5e9-4c57f3437a98

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/jibi/.local/share/claude/versions/2.1.87 (expected in multi-process scenarios)\n    at _p_ (/$bunfs/root/src/entrypoints/cli.js:2851:2138)\n    at Vn6 (/$bunfs/root/src/entrypoints/cli.js:2851:1218)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-29T13:23:43.562Z"},{"error":"Error: Request was aborted.\n    at gv_ (/$bunfs/root/src/entrypoints/cli.js:1365:16708)\n    at next (native:1:11)\n    at Gy9 (/$bunfs/root/src/entrypoints/cli.js:7572:8934)\n    at next (native:1:11)\n    at Ly9 (/$bunfs/root/src/entrypoints/cli.js:7577:10737)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-29T13:29:58.022Z"},{"error":"Error: Error normalizing tool input: ZodError: [\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"new_string\"\n    ],\n    \"message\": \"Invalid input: expected string, received undefined\"\n  }\n]\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:4556:849)\n    at map (native:1:11)\n    at WF_ (/$bunfs/root/src/entrypoints/cli.js:4556:563)\n    at Ly9 (/$bunfs/root/src/entrypoints/cli.js:7577:7099)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-29T13:40:37.485Z"}]

View original on GitHub ↗

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