How the Claude adapter turns a raw lifecycle payload into the (chat_id, status, label) tuple the widget renders. All logic in this page lives in src-tauri/src/adapters/claude.rs; the Python hook (integrations/claude_hook.py) is a pure transport layer and does no classification.

A single event payload flows through four independent steps in this order: chat-id derivation, event-to-status classification, label formatting, and (for Stop / Notification) transcript question detection. The label policy that decides what’s actually shown on screen is downstream — see Sticky labels for the rules that pin the original prompt across approval cycles.

Chat-id derivation

Each Claude Code session collapses to one row in the widget. The row’s id (a.k.a. chat_id) is derived from payload.cwd and the configured projects_root in config.json:

Input Resulting chat_id
cwd is under projects_root (case-insensitive) relative path; /, -, _ replaced with spaces
cwd is outside projects_root (or root unset) basename of cwd
cwd exactly equals projects_root basename of projects_root
cwd is missing or whitespace-only claude-unknown (defensive; payloads always carry cwd)

Backslashes are normalized to forward slashes before matching, so Windows paths work uniformly. Trailing slashes on cwd are tolerated. Examples (with projects_root = "d:/projects"):

cwd chat_id
D:/projects/bga/assistant bga assistant
d:/projects/foo-bar/sub_dir/leaf foo bar sub dir leaf
D:\projects\sub\deep sub deep
d:/projects projects
c:/Users/foo/bar bar

This derivation runs per event, but the result is only the first-seen anchor: http_server locks each session_id to the chat_id derived on its first event (chat_id_registry), so a mid-session cd into a subdirectory reuses the original id instead of spawning a second row. /clear mints a new session_id with the same cwd, so it re-derives — and re-locks — the same id.

Event → status

The adapter recognizes the events below. Anything else returns Ignore and the widget state is untouched.

Two statuses are easy to confuse. done means a turn ended here, and it is also where every absence of evidence lands: a payload that establishes nothing settles done rather than claiming more. idle means clean — a confirmed claim that there is nothing in the session to come back to — and only positive evidence may write it, never a fallback. Whether the user has already read a finished row is a separate read flag stamped at display time, not a status.

Event Status produced Notes
SessionStart idle when source is clear or startup, else done Vouches for a clean row from source alone — see Session starts.
UserPromptSubmit working Label is the cleaned prompt; blank prompt → label None. A prompt Claude Code submitted on its own account (a <task-notification>, a subagent’s hand-back, a cross-session notice) also gets label None, so it starts no task; see Sticky labels. Landing on a blocked row, such a prompt carries the row’s question through the turn it begins, since nobody answered it.
UserPromptExpansion working for a slash command (expansion_type is slash_command); other expansions ignored Label is the cleaned prompt. Fires before a skill’s ! context-gathering, so a skill launch shows working without waiting for the later UserPromptSubmit, which owns the dialog entry.
Notification blocked (default); idle_prompt, permission_prompt and an empty payload are ignored outright See the notification-type table below.
PreToolUse blocked for AskUserQuestion / ExitPlanMode only; other tools ignored Label: "has a question" for AskUserQuestion, "plan approval" for ExitPlanMode. The matcher in ~/.claude/settings.json should restrict the hook to these two tools (see Installation → Wire the Claude Code hook) — the JSONL transcript records the call’s tool_use block but nothing marks it as waiting on the user, so this hook is the only signal that the dialog is on screen.
PermissionRequest blocked Label: "needs approval: <tool>" from payload.tool_name ("tool" when absent), except that AskUserQuestion / ExitPlanMode keep the label their PreToolUse set. Without an agent_id it is the main agent’s dialog and sets the row’s status. With one, a subagent raised it: it opens a prompt over the row instead — see Subagent permission prompts.
Elicitation blocked An MCP tool asked for input. Label is the request’s message (first 60 characters), else "needs your input".
ElicitationResult working The user answered the MCP prompt. No label of its own, so the task label stays.
Stop blocked if the final assistant message ends on a question, else waiting if background work is still in flight, else done (see detection rules) Settled here: the payload carries the final text as last_assistant_message and any in-flight work as background_tasks, so classify_stop has everything it needs at Stop time. The question check ignores configured benign closers and openers. A Stop whose background_tasks is empty or absent also releases every open subagent prompt on the row. A settling done is upgraded to idle where a relayed peer pull reported leaving nothing behind — see A pull that leaves nothing behind. A settling done or waiting is kept blocked under the carried question where a prompt Claude Code submitted on its own account, or another agent’s message, began the turn on a blocked row (logged question_held).
StopFailure error The turn ended on an API error, which fires no Stop. Label is the failure kind, else "turn failed".
PreCompact emits Boundary (a history separator; the stale context-token count is cleared) No status change: the session continues past the compaction.
SubagentStop emits SubagentStopped for the payload’s agent_id; ignored without one No status of its own. Releases every open prompt from that agent.
PostModelSwitch emits ModelSwitched with the payload’s to_model; ignored without one No status change: only the row’s model moves, ahead of the next reply the transcript would show it in, so a terminal row tint follows /model at once (logged model_switch).
SessionEnd emits Clear (the session leaves its row; see Data flow for when the row goes) Bypasses status classification entirely.

The table is what an event does when it comes from the session the row follows, its main. An event from another session in the same folder is recorded and changes nothing (member_event), a prompt included — see Data flow → Path 1.

PostToolUse is intentionally ignored. Once the user answers an AskUserQuestion / ExitPlanMode, the transcript watcher carries the row out of blocked when the answer’s tool_result lands, or the next UserPromptSubmit does. The call’s own tool_use line is written while the dialog is still on screen, so the watcher reads an unanswered one as no activity.

Session starts

Two events can declare a row clean. SessionStart does it from payload.source — Claude Code’s own statement of what happened to the context, which arrives on every session start — and a Stop does it where a relayed peer pull reported leaving nothing behind, covered in A pull that leaves nothing behind.

source Status Reading
clear idle /clear wiped the context; the model holds nothing.
startup idle A fresh session, nothing in it.
resume done Clean only if the resumed conversation ended at a /clear — see below.
compact done The conversation continues under a summary.
fork done A fork carries its parent’s context forward.
absent done Nothing established.

Whether a resume is clean is a fact about the persisted dialog, which the adapter never sees, so the adapter settles done and http_server::resume_is_clean upgrades it: the row goes idle only when the restored dialog’s last entry is a separator tagged BoundaryKind::Clear. That tag is why the three kinds of boundary are distinguished at all — state::append_boundary runs for /clear, for every other SessionEnd reason, for PreCompact and for the liveness reaper, and BoundaryKind (clear / compact / ended) is what tells them apart afterwards. The weaker “ended at a boundary” test would read true after a compaction, an ordinary exit and a reap alike, and sessions here start with claude --continue, so nearly every row on the machine would claim to be clean at start-up.

The upgrade is scoped to resume alone. Both clear and startup are already answered from evidence that needs no history, and widening it would make a /clear on a row with no persisted dialog fail to be clean.

A pull that leaves nothing behind

An agent that pushes asks its counterpart on the other machine to pull, and that counterpart wakes, pulls and has nothing to show anyone. Where the row was clean before the request, it goes back to clean — http_server::pull_declared_clean upgrades the turn’s done to idle when three independent facts agree, each held by whoever can establish it:

  • The run left nothing to come back to. Only the /pull skill knows, because only it saw whether anything conflicted and whether anything was left for the user. Its step 10 posts POST /api/session-clean, which records a claim on the row (AgentSession::clean_claim_at) and settles nothing. Silence means not clean, so a dashboard that is not running, or a run that hit a conflict, costs the skill nothing to leave unsaid.
  • A peer asked, rather than the user. Only the dashboard knows, from the preamble it writes itself at the head of every envelope — peer_message::RELAY_PREAMBLE, a fixed string and not a per-message one: peer_message::parse_relayed requires it at the start of the envelope, which is the start of the arriving prompt or, for a relay sent inside the <cross-session-message from-name=…> wrapper the receiving terminal folds, the line directly after its opening tag, which is what a fixed marker can be anchored on and what keeps a sender quoting it inside its own fenced text from promoting its message. The rest of the envelope is held to its shape too: the fence nonce, the envelope’s one minted value, is read off the prompt rather than matched, and the fence’s closing marker and the trailer’s last line must end the envelope (followed only by the wrapper’s closing tag where there is one), so a person who pasted a delivered envelope and typed a question under it is still a person. The same parser (peer_message::parse_relayed) reads the envelope for the row’s text, so the CLEAN rule and the row cannot disagree about which prompts were relayed. The adapter answers this on UserPromptSubmit and on no other event, and apply_set records it as the start of a relayed exchange (AgentSession::relay_exchange_from). The exchange can outlast the turn the relay began: where that turn stops to ask the user, a prompt from the user or a notification landing on the blocked row continues it, so a pull finished in the turn the user’s answer began still counts as the peer’s request. Any other prompt ends the exchange, and so does a turn settling done, error or idle, so a task the user starts on a finished row is never part of it. The exchange is held in memory only, so a restart ends it.
  • The session was already clean when the request arrived. The status the row held when the relay began the exchange, which apply_set records from AgentSession::status_before_working alongside it. A pull that interrupts real work leaves that work sitting there, however little the pull did.

The claim is weighed at the turn’s Stop rather than applied when it arrives, because /pull posts from inside the turn it is reporting on — a status written at post time is overwritten by that same turn’s Stop a moment later. Any later prompt drops an unredeemed claim, so a claim whose Stop never came cannot be collected by the next turn; nothing expires on a timer.

Only a settling done is upgraded. blocked and waiting each say something is still outstanding, and no claim about a pull speaks to either.

Stamping the row when the frame was written into the session’s inbox would be the obvious alternative and does not work: across 115 measured peer_write deliveries, 16 produced no arriving prompt at all and four arrived together hours late, so a stamp left for “the next turn” to collect is collected by an unrelated one.

Notification subtypes

Notification further splits on payload.notification_type:

notification_type Status Label
permission_prompt none — the event is ignored none
plan_approval blocked "plan approval" (fixed)
idle_prompt none — the event is ignored none
anything else blocked cleaned payload.message, truncated to 60 chars
empty type, empty message none — the event is ignored none

The 60-char truncation counts characters, not bytes, so multi-byte glyphs (emoji, CJK) are never split mid-codepoint.

idle_prompt produces no classification at all: Stop has already settled the row from its own payload, so re-deriving a verdict here would be redundant, and the event is a flaky fixed timer besides. See question detection.

A notification with neither a type nor a message says nothing about the session, so it moves nothing either. Answering idle there would be a claim that the session has been wrapped up, on a payload that establishes nothing at all.

permission_prompt is ignored because it repeats a dialog PermissionRequest reported seconds earlier, with the tool named in a field rather than in message text. It carries no agent_id even when a subagent’s dialog raised it, so applying it would relabel the row, and after a subagent prompt had been released it would bring the BLOCK back.

Subagent permission prompts

A subagent — a Task agent, or one of a workflow’s agents — can open a tool-permission dialog of its own. Its PermissionRequest carries the subagent’s agent_id and the main session’s transcript_path, and the adapter returns it as a Set whose subagent effect is PromptOpened rather than as a status for the main agent. The row shows blocked with the prompt’s label while the main agent’s own state keeps moving underneath (AgentSession::subagent_gate in state.rs). Once every open prompt has settled, the row shows that state again, with its own clock.

Nothing in the hook stream says when a subagent’s dialog closes, so a prompt is released by one of these, and never by a timer:

  • The gated call’s result. Claude Code writes the call’s tool_result to the agent’s own transcript, agent-<agent_id>.jsonl under <main transcript minus .jsonl>/subagents/, whether the call was approved, rejected, timed out on the 120 s safety check, or aborted. subagent_gate.rs re-reads that file on a 2 s tick while prompts are open. The hook carries no tool_use_id, so the call is matched on what it does carry: a same-name call issued before the hook whose input equals the hook’s tool_input, and with no exact match, every same-name call in the newest message that held one. The prompt settles only once every candidate call has its result. An approved call therefore holds the BLOCK until it finishes, since nothing records the approval itself.
  • SubagentStop for that agent, which releases every prompt the agent holds. It covers an agent that ends without writing a result: interrupted, or killed with its dialog open.
  • A main Stop with no background work in flight (background_tasks empty or absent), which releases every prompt that session raised, since none of its subagents can still be prompting. A second Claude Code instance sharing the row keeps its own prompts.
  • Removal of the row (SessionEnd, or the liveness reaper), which drops its prompts with it.

Each PermissionRequest is its own prompt, so two from one agent, or from two agents, settle separately. While several are open, the row shows the newest one’s label.

Prompt and label cleaning

User-visible text comes from payload.prompt (UserPromptSubmit) or payload.message (Notification). Both go through clean_prompt, which:

  1. Replaces these whitespace characters with a single space: \n, \r, \t, vertical tab, form feed.
  2. Replaces all characters in U+2300–U+23FF (Miscellaneous Technical, e.g. ⎿) with a space.
  3. Replaces all characters in U+2500–U+259F (Box Drawing + Block Elements, e.g. │ ▌) with a space.
  4. Collapses runs of spaces into one and trims.

This cleaning applies to the label (the one-line preview shown in the dashboard row). The dialog entry persisted for the multi-line history view takes payload.prompt raw on UserPromptSubmit instead, so the history preserves newlines and the user’s original formatting.

Other Unicode passes through untouched — accents, emoji, CJK, math symbols. The U+2300/U+2500 ranges are stripped because Claude Code’s terminal output frequently leaks box-drawing glyphs into prompt and notification text.

Question detection

Stop decides whether the agent is genuinely done or is handing back to the user, and it decides it from the payload rather than from the transcript: last_assistant_message carries the final assistant text — “avoids the need to read and parse the transcript file” — so classify_stop runs the question check on it directly and the row is settled there.

There is no re-read and no later correction. An earlier design classified from the prior turn’s text, because Stop fires before the final turn flushes to JSONL, and had the transcript watcher fix the verdict both ways once the real text landed. Adopting last_assistant_message removed the reason for all of it: flushed_turn_verdict, promote_done_to_blocked, demote_scanned_blocked_to_done and the status_from_transcript_scan provenance flag are gone, and Notification (subtype idle_prompt) is ignored outright rather than acting as a second opinion. What the watcher still does is promote a paused row back to working once the transcript shows the main turn resumed — it never demotes (see data flow).

One helper does the detection:

is_a_question(text, rules) — pure check on a string, four detection paths. The rules argument bundles two config-driven lists that always travel together: benign_closers (suffix-matched) and benign_openers (prefix-matched). Before any path runs, inline Markdown formatting characters (*, _, `, #, ~) are stripped so a final **Push?** reduces to Push? and is still recognized — only those marker characters are removed; newlines and every other character (crucially the terminal ?) are preserved.

Pre-step — peel trailing Note: paragraphs: Before the four paths run, blank-line-separated paragraphs that open with Note: are dropped from the end, newest-first. Agents often append a housekeeping caveat after the closing question — "Shall I proceed?\n\nNote: I also renamed X — flag if you'd rather keep it." — and every path keys off the tail of the text, so the note would otherwise mask the question and settle the turn done. A note that is itself a hand-back (it registers as a question on its own) is kept, so peeling can only ever turn done → blocked, never hide an ask that lives only inside a note. The verdict runs on the peeled text; the decision-log snippet is peeled too, so the log quotes the real question, not the note.

Path 1 — trailing ?:

  1. If text (after trim) ends with ), peel off one trailing (...) group only when the substring before the matching ( ends with ?. This handles option lists like "Save these? (all / numbers / none)" → "Save these?". Other trailing parens (e.g. "Look at this code (foo.py)") are left alone — there’s no ? before them, so the text falls through unchanged.
  2. After that strip, if the text ends with ?, two filters can skip this path. First, Config::benign_closers — case-insensitive suffix match (defaults "What's next?", "or are you good?", and "or leave it?"); a hit skips. Second, Config::benign_openers — case-insensitive prefix match against the final sentence (default "anything"); a sign-off like "Anything you'd like to look at?" opens with a benign offer word and so skips. Both exist because Claude often signs off with a polite question that isn’t a real ask — flipping to blocked on every What's next? or or are you good? would be noise.

    The two filters differ on what they excuse downstream. A benign opener skips only Path 1; the final sentence is still scanned by Paths 2–4, so an embedded real ask is caught by the permission-seeking path and "Anything else, or shall I commit?" stays blocked. A benign closer, by contrast, marks its whole closing sentence an optional sign-off — that sentence is dropped before Paths 2–4 run, so a permission-seeking phrase inside it ("Want me to drive a browser check, or are you good?") reads as part of the offer and stays done. A genuine ask in an earlier sentence still awaits ("Should I delete the backup first? Or are you good?" stays blocked).

Path 2 — hand-back phrase in last paragraph:

If path 1 doesn’t match, extract the last paragraph of text (split by \n\n) and check whether it contains any of these phrases (case-insensitive). A phrase that already ends in ? matches literally; the rest only count when a ? follows them later in the same paragraph:

  • "want me to"
  • "shall i"
  • "should i"
  • "do you want"
  • "save this?"
  • "save these?"
  • "can you"
  • "could you"
  • "did you"
  • "want to"
  • "confirm "
  • "ready to "

This catches questions embedded mid-paragraph like "Want me to add that? The plan: write sessions.json to disk." where the response continues past the ?. The phrase list is empirically derived from real assistant messages — only patterns that actually appeared are included; new ones are added as observed. "save this?" / "save these?" were added for the /reflect and /commit save prompts, whose "Save this? (all / 1 / none)" menu can be trailed by a clause like "— then I'll run /commit." that defeats path 1 (the text no longer ends with ?); the baked-in ? keeps a declarative "save this config" from matching. "can you" / "could you" / "did you" / "want to" catch directed second-person questions whose paragraph continues past the ? ("Did you try the admin launch? That's the most likely fix."). "confirm " / "ready to " carry a trailing space so confirmed / confirmation don’t match — they catch approval prompts whose ? isn’t last ("Confirm v0.5.0 and these notes? On approval I'll …", "Ready to tag v0.5.1 and push it? Reply with y …"). Only the last paragraph is scanned: a question in an earlier paragraph followed by a concluding statement (e.g. "Want me to fix it?\n\nI went ahead and fixed it.") correctly returns false.

Only round brackets () are recognized for the option-list strip; [] and {} aren’t peeled.

Path 3 — hand-back request in last paragraph:

If neither path above matches, check whether any sentence in the last paragraph (split on .!? and newlines) starts with one of the hand-back openers "paste ", "please provide ", "confirm ", or "reply " (case-insensitive). This catches the imperative hand-back where the agent waits for the user to supply something but never ends on a ? — "Paste the tableinfos output and I'll finish arena.", "Please provide the model group and the model name.", "Confirm to tag v1.2.0, or request edits.", "Reply go to finish.". Only a sentence-initial opener counts, so a mid-sentence mention like "you can paste this" or "I'll paste the result" doesn’t trigger. The list is kept narrow and phrase-matched — a blanket "please " would misfire on informational openers like “Please note …” / “Please see …”, and the trailing space in "confirm " and "reply " keeps Confirmed: … and Replied … statements out. The split on . also cuts after a list number, so a numbered item in the last paragraph whose text starts with an opener, such as a memo listing’s 8. Reply to issue 8 …, reads as a hand-back and leaves the row BLOCK until the next prompt.

Path 4 — leading question in last paragraph:

If nothing above matches, check whether the first sentence of the last paragraph is itself a question — it ends with ? before a concluding clause follows. This catches a hand-back whose question leads and is then trailed by context, like "Apply this edit? (yes / no) Everything else is aligned." — the trailing sentence defeats path 1 (the whole text no longer ends with ?), the option menu sits mid-text rather than at the end, and "apply" is no path-2 phrase, so without this nothing sees it. Three guards keep it tight:

  1. The terminating ? must immediately follow an alphanumeric character, so a bare mention of the glyph — "a ? ` `` immediately followed by …”, which markdown-stripping leaves as “a ? …”` — isn’t read as a sentence terminator.
  2. The first sentence must not open with a self-directed phrase ("let me ", "let's ", "lets ", "i'll ", "i will ", "i'm going to ", "i am going to "). These mark the agent reasoning aloud and about to act, not asking — "Let me investigate — does X have a cleaner fix? This affects what we do next." stays done.
  3. Configured benign closers (suffix) and benign openers (prefix) are both honored, so a leading polite "What's next? …" or a leading offer "Anything you'd like to look at? …" still doesn’t flag.

This path was validated against the recorded dialog history (prompt_history.json): it fires on 12 of 60 real assistant turns with zero false positives. Like path 2 it scans only the last paragraph, and like it the question must be the paragraph’s first sentence — a statement-first paragraph ("The migration is ready. Looks good to you?") is left to path 1’s trailing-? check.

Failure modes are silent: a Stop payload carrying no last_assistant_message, or an empty one, is treated as “no question” and settles the row on the background-work check alone. The adapter never crashes a status update over a missing or unreadable field.

Decision log

Every status-affecting decision is written to widget.jsonl (the same tracing sink logging.rs owns) as a structured line carrying a stable decision field and a human reason, keyed by the resolved chat_id. The reason for a question verdict names which detection path fired and quotes a snippet of the assistant text, so “why is this row blocked?” is answerable from the log alone — no transcript or source reading.

decision Emitted from Meaning
classify http_server (event -> set) A hook event set the row’s status. For Stop the reason reads turn ended on a question [<rule>]: "<snippet>" or turn ended; final message is not a question: "<snippet>". Carries the hook’s agent_id, None on the main agent’s own events, and the member that sent it. Logged only for an event from the session that drives the row.
resume_working log_watcher The transcript watcher saw new activity (a tool call or user turn) after a pause and promoted the row back to working — the path that clears a stale blocked once the user answers an AskUserQuestion.
settle_waiting waiting_settle A row sat in waiting (light-blue WAIT) unchanged past waiting_settle_ms and was settled to done — the backstop for a background shell task the user killed, which ends silently and so fires no follow-up Stop. Carries waited_ms / window_ms.
idle_close idle_close A local row that sat idle (CLEAN) past idle_close_ms: outcome = "closed" when its session was closed (and its terminal tab here, except for a tmux| key, a WSL tmux session no terminal here shows, whose Mac ⇄ tab, if one is attached, attach.sh closes there), after which the row ends through SessionEnd or the reaper; otherwise why not — close_failed (the terminal refused, with its error, such as a tab whose pane is no longer running the agent, or in agwinterm a session on screen in its front window or with a draft in the composer, or for a tmux| key a terminal here having attached since, the title leaving CLEAN, more than one pane in the session, the session still there after /exit, or wsl.exe not answering; the close is retried every tick and logged once), no_session, tab_not_idle, same_label or shared_title, each logged once per row. Carries key on a close or a refusal, and idle_ms/window_ms on a close.
revert_cancelled log_watcher An Esc-cancelled turn (no lifecycle hook) reverted to its pre-prompt status — the status field records where it landed.
pull_claim http_server A /pull run posted POST /api/session-clean to say it left nothing to come back to. outcome is recorded, no_row (no row here for that session) or not_owner (another session in the same directory drives the row). Moves nothing on its own — see A pull that leaves nothing behind.
pull_clean http_server The settling event that weighed such a claim. With no outcome it settled the row idle instead of done; with one, it refused, and the outcome names which fact failed — still_outstanding (the turn settled blocked or waiting), not_relayed (no relayed exchange was under way: no peer began one, or an earlier turn of it had already settled) or not_clean_before (the session had work parked in it). A recorded claim with no pull_clean after it was revoked by a later prompt.
project_rename / rename_cleared_row project_rename A project folder was renamed through POST /api/project/rename: its history, anchors and custom name now live under the new id, logged under that id with from naming the old one. rename_cleared_row is a row the rename removed first because its session had ended without a SessionEnd. Lines written before the rename stay under the old id. A refused call logs project_rename with no chat_id and an outcome naming the refusal.
question_held http_server A Stop that would have settled done or waiting was kept blocked under label, because a prompt Claude Code submitted on its own account, or another agent’s message, began the turn while the row was blocked on a question nobody had answered. The classify line before it carries the turn’s own verdict.
apply_set state.rs The state-machine transition: prior_status → new_status, plus task_boundary and continuation_suppressed.
session_clear / compact_boundary http_server, commands Session removed / context-compaction history separator inserted. A session_clear on a SessionStart event is a /clear whose start arrived before its own SessionEnd and removed the row on the end’s behalf. A session_clear from commands (apply_departure) is an ordinary SessionEnd from the row’s last member; the /clear paths and the end on a row with no known members log it from http_server.
clear_superseded / end_unmatched http_server A SessionEnd that removed nothing: clear_superseded when it is the late end of a /clear whose start already removed the row, end_unmatched when it came from a session that is not a member of a row that has members. Older logs also hold clear_ignored, the refusal these replaced.
member_join / member_rekey membership A session joined a row (member is pid:N or session:ID; main says whether it drives the row), or a known member is now keyed differently, because its pid arrived or a --continue resumed its session in a new process after the old one exited.
main_change membership The row now follows another session (from, to, via): founding (the first session seen), succession (the main left and one session remains), sole_member (no main, and one session a process backs is left or has just joined) or departed_no_successor (the main left and several remain, each driving the row until only one is left). A prompt never changes the main. On a row that has ever had a session with a known pid, only those count toward succession.
member_event http_server An event from a session that does not drive the row, recorded and not applied. status is what it would have set; subagent_prompt_dropped marks a subagent prompt it opened.
member_leave commands A member left its row: via is session_end or reaped, with was_main, drove_last and remaining. With prior_status present the row was handed over, settling done behind an ended separator because what it showed was the departed session’s (the main’s, or the last writer’s while there was no main); prior_status is what it showed.
reap_exited commands The liveness reaper removed a row whose last Claude process exited without a SessionEnd. Carries the dead pids and the prior_status.
subagent_prompt_open http_server A subagent’s PermissionRequest opened a prompt, and the row shows blocked. Carries request (the id the dashboard minted for it), agent_id, agent_type, tool, pending (how many prompts are now open on the row) and base_status (the main agent’s own status underneath).
subagent_prompt_settled subagent_gate, http_server, commands One or more prompts settled. via names the exit: tool_result, subagent_stop, stop_no_background or handed_over (the session whose state the row showed left, taking its prompts with it). released says whether the last prompt went and the main agent’s state came back, status is what the row shows afterwards, and latency_ms runs from the oldest settled prompt’s opening. A tool_result settle also carries tool_use_ids, is_error and matched_on (input when the hook’s input matched a call exactly, else name).
subagent_prompt_unmatched subagent_gate Diagnosis only, logged once per prompt: the tick could not find the gated call. outcome is no_transcript_path, no_transcript or no_tool_use. The prompt stays open, and the row’s status does not move.

apply_set, resume_working and revert_cancelled also carry a gated field. When it is true, a subagent prompt was open on the row: the statuses on the line are the main agent’s own, and the row itself kept showing blocked.

The project-local investigate skill (.claude/skills/investigate/investigate.py) reads these lines to reconstruct an agent’s current state and its decision chain: investigate.py <agent> explains one session; no argument lists the active sessions to choose from.

What this layer does not decide

  • Whether the user-visible label changes. The adapter emits a candidate (status, label) pair; the sticky-label state machine decides whether the row’s original_prompt updates, gets re-captured at a task boundary, or stays pinned across an approval cycle.
  • Token counts and model. Those come from the transcript watcher (log_watcher.rs) reading assistant turn metadata, not from hook events.
  • Timer accumulation. state.rs::bank_working owns the working_accumulated_ms arithmetic, called wherever a row leaves working: apply_set, revert_cancelled_turn and hand_over.

Screenshots