Agents view: sessions with an open ask filed under Working (buckets on state, not tempo); no bucket for state:failed; resumed sessions double-counted
Environment
Claude Code v2.1.220, macOS (darwin 25.6), Agents view (claude agents), ~19 concurrent sessions (mix of interactive desks, daemon-managed loop sessions using ScheduleWakeup, and background worker sessions).
Summary
The Agents view files sessions into buckets from state (working|done|blocked|failed), but the field that promptly tracks "an interactive prompt is open" is tempo (active|idle|blocked) in ~/.claude/jobs/<id>/state.json. The two disagree on exactly the sessions the "Needs input" bucket exists for, plus two adjacent gaps.
1. Sessions awaiting input are filed under "Working" (state vs tempo disagreement)
Observed live (2026-07-31): three sessions sat at open ExitPlanMode gates with state=working / tempo=blocked in their state.json. In the Agents view, one session with summary "approve plan" appeared under Needs input while another with the identical "approve plan" summary appeared under Working — the only difference being which status field had caught up. Orchestrator-style sessions that ask a question in prose and then re-arm a ScheduleWakeup never open a prompt at all, so they show tempo=idle and can never reach "Needs input" even when their own summary line literally says "awaiting me" (also observed).
Ask: bucket on tempo (or OR tempo=="blocked" into the awaiting-input bucket) rather than state alone — the prompt-accurate data is already on disk.
2. No bucket for state: "failed"
A session whose row carried state:"failed" with detail "working directory no longer exists or is not accessible: …" (its git worktree had been removed) appeared in none of the three visible buckets — the header counted "2 awaiting input · 11 working · 6 completed" over 19 rows on disk. A dead session with a vanished cwd is precisely one a user needs surfaced.
Ask: a Failed section, or fold failed into the awaiting-input bucket.
3. Re-dispatched sessions are double-counted
Two job directories with the same session name (a worker that died and was re-dispatched under the same name) each produced a row, inflating the header counts. Deduping by name keeping the newest updatedAt, or marking superseded rows, would keep the arithmetic honest.
4. (Minor, related) Summary column falls back to echoing the user's own message
The summary/detail column alternates between an LLM away-recap and, whenever the user has typed since the last recap, a last-prompt fallback — so a row can show the user's own words back at them as if they were session state ("i want you to look at…"), with no provenance marker distinguishing the two. A small provenance hint (e.g. dimmed "you:" prefix) would stop a user reading their own message as agent status.