Skip to content

Ask for a result: line when a watching session has nothing pending - #1033

Merged
max-sixty merged 2 commits into
mainfrom
wait-started-result-v2
Sep 23, 2026
Merged

max-sixty merged 2 commits into
mainfrom
wait-started-result-v2

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Claude Code's session list groups a background session by the closing line of its last reply, and that grouping ignores background tasks. A result: line files the session under Completed even while leaf wait runs; only the row's word stays Working, since Claude Code checks for a running task before anything else. The hook from #1026 asked only for needs input:. A session holding a settled page ended with neither line, and Claude Code's classifier filed it under Working. That is why Leaf sessions waiting on a page sat under Working indefinitely.

  • hooks/wait-started.json also asks for result: <what you delivered>, but only when nothing waits on the user or on work the agent still has running (the watcher itself aside).
  • host-claude-code.md "Session list" explains both parts: the word Claude Code holds at Working, and how the closing line sets the group, including what happens with neither line.

I replayed the closing turn with the new wording, 6 runs per scenario, and every run chose the right ending:

  • e390c26f's open decisions → needs input: (6/6)
  • a merged fix whose page had settled → result: (6/6)
  • a merge whose CI watcher was still running → neither line (6/6)

Two earlier wordings failed the second and third cases.

This was written by Claude Code on behalf of max-sixty

🤖 Generated with Claude Code

max-sixty and others added 2 commits September 23, 2026 12:03
Claude Code's session list groups a session by its reply's closing line and
ignores background tasks while it does: `result:` files it under Completed
even while `leaf wait` runs, and only the row's word stays Working. The hook
asked only for `needs input:`, so a session holding a settled page fell to
the classifier and usually read as Working.

In replays the wording chose correctly in 18 of 18: `needs input:` for
e390c26f's open decisions, `result:` for a merged fix whose page settled,
and neither while the agent's own CI watcher was still running.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit cf46cc8 into main Sep 23, 2026
5 checks passed
@max-sixty
max-sixty deleted the wait-started-result-v2 branch September 23, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants