A user kicked off a Claude Code agent to do a coding task and walked away. Read the tail of what the agent just said and decide which of four states it's in, so the system knows whether to notify the user. The classification drives a phone notification: "blocked" pings the user to come back; everything else doesn't. So the question you're really answering is: does the user need to come back right now, and if not, is the work finished or still going? A false "blocked" is an annoying interruption for nothing. A false "done" or "working" when the agent is actually stuck waiting on the user means the work sits idle until they happen to check. THE FOUR STATES "done" — the agent answered the ask or delivered the thing, and isn't planning to do anything else unprompted. This is the most common end-of-turn state in interactive sessions. There doesn't have to be a PR, commit, or file — if the user asked a question and the tail is the answer (not a plan to find one), that's done. Explanations, analyses, recommendations, "here's what I found", "the cause is X", "no change needed", and "files at " closings are all done. "working" — the agent intends to keep going without being asked: it said "now let me…", "next I'll…", "running…", "checking…", or it's waiting on something it kicked off (CI, build, subagent, deploy, timer). Look for explicit forward intent or a named external wait. "blocked" — the agent cannot continue without the user. The closing is a direct question the agent NEEDS answered to proceed, a request to provide something (a file, a credential, a decision, an OTP), an instruction the user must execute ("reply `go`", "approve the PR", "run /login"), or an auth/API error the user can fix. Test: would the user replying or acting unblock it? "failed" — the agent gave up because the task is structurally impossible as framed: wrong repo, the feature doesn't exist, the premise is false, every approach exhausted with nothing the user could hand over to unblock it. Rare. If the agent names a specific missing resource, that's "blocked", not "failed" — the user CAN unblock it. THE HARD BOUNDARIES Done vs working: a closing that explains, summarizes, reports findings, or shows what was changed — without saying it's about to do more — is "done". Don't infer "working" from caveats, follow-up suggestions, or the absence of the word "done". Only call "working" when there's explicit forward intent ("now let me", "next I'll", "running") or a named external wait the agent started ("waiting on CI", "build in progress", "fork still running"). Done vs blocked — optional offers vs gates: after delivering, agents often close with an offer to do more: "let me know if you want X", "if you'd like, I can also Y", "ping me and I'll Z", "say the word and I'll update", "want me to dig into that?", "tell me the IDs and I'll re-home", "happy to do the latter if you want", "shall I also…?". These are "done" — the deliverable shipped; the offer is extra. The discriminating test: if the user ignores the closing question, is the original ask still satisfied? Yes → done. No → blocked. The exception is when the question is about WHETHER or HOW to ship the work the user asked for — which PR to put it in, apply it or not, push or hold, which approach to take. Then the deliverable isn't landed without the answer, so that's "blocked". "Found the fix. Want me to add it to this PR or open a new one?" → blocked (delivery isn't decided). "Fixed it in this PR. Want me to also clean up the old helper while I'm here?" → done (delivery is complete; the extra is tangential). Working vs done vs blocked — when the closing mentions waiting on something: the discriminator is whether the AGENT ITSELF will do more. • Agent says it will act ("I'll report when X lands", "next check in 5 min", "shepherding CI", "will re-poll", "checking back", "N agents in flight — I'll consolidate") → "working". The agent owns the next step, regardless of what it's waiting on. • Agent won't act, and there's a user-addressed gate with no re-poll ("reply `go` to merge", "awaiting your approval", "which approach do you want?") → "blocked". Only the user can move it forward. • Agent won't act, and the wait is on a third party or passive trigger ("auto-merge armed, awaiting stamp", "posted to #stamps", "CI will run") → "done". The agent's part is over; whatever happens next happens without it. A closing with both ("Awaiting your `go`. Next check in 20m") is "working" — the agent will re-check on its own; `go` is an optional accelerator, not a hard gate. Stickiness: you're told the previous state. Don't move done→working or failed→working unless the agent explicitly restarted. Moving working→done is the normal end-of-turn outcome — lean "done" when the closing is declarative with no future-tense plan. EXPLICIT MARKERS — these are unambiguous, treat them as ground truth: • "No response requested." / "No action needed." / "Nothing needed from you." → done • "result: " on its own line → done (and is output.result) • "Next check in