Repository navigation
End a Claude Code turn on its answer and remind it of an owed update in a turn of its own - #3596
Merged
Merged
Conversation
…in a turn of its own Where a watch follows the turn, Stop no longer continues a turn over an owed, unstarted answer: the agent's note about it replaced the turn's answer in Claude Code's focus view. The watch wakes a turn of its own whose prompt names the owed answer, and the prompt's ref-less pickup records that reminder, so the update wakes nothing more until it is delivered again. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Oct 22, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The new deferred journey does not prove that the owed comment is answered in a turn opened by the watch.
… turn Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Max's decision #3a on the overnight report: when a Claude Code turn ends still owing a page answer, end it on its answer and remind the agent in a turn of its own (option A).
The defect
Leaf's Stop hook continued a turn that still owed an answer to a delivered update, telling the agent which update it owed. The agent then wrote one more message, usually a short note about the comment. Claude Code's focus view shows only each turn's last message, so that note stood in place of the answer the turn had written. In Max's sessions of 10–19 October this was 9 of the 65 Stop continuations; #3256 had already moved the late-input cases to a turn of their own.
What changes
Harness.watches_between_turns: Claude Code at its terminal, Pi with a UI).hook_transport.stop_continuesno longer counts response debt there. Under plain--printand on Codex, where no watch wakes a later turn, Stop still continues the turn as before. A page Leaf could not re-vendor still continues the turn.session.left_owed,activity.left_owed). After a Stop closes the turn, the watch wakes for each owed answer that turn didn't start and that no prompt has named since the update's delivery. It wakes the same way End a turn on its answer: Stop leaves late input to the watch #3256 wakes for late input. That turn's prompt hook names the owed answer with its exact ref, as every prompt already does. The wake line says the page has an update still owed an answer, rather than new input.answer.ref(pick_up_acknowledged).delivery.remindedreads that pickup: a ref-less pickup after the newest delivering one means a prompt has named the update since its delivery. This is the same pickup record Confirm a Claude Code hook delivery at the turn's next hook, and deliver it again if the turn ends first #3591 (decision Reach interact.py ascolloquy, and fold the lint into note #2) reads as handed but unconfirmed. So a turn that ends still owing the same answer wakes nothing more, whether the reminder came from the watch's turn or from a prompt the user typed. A new delivery of the update, as when it changes hands, starts over.leaf waitand the Codex adapter keep their watch passes as they were:session.read_watch_pass's default still wakes only for a batch.Checks
test_a_turn_ends_on_its_answer_and_a_turn_of_its_own_names_what_it_owes: a prompt hands a comment over, and Stop ends the turn with no output. The watch wakes with the owed-answer line, the next prompt names the comment, and when that turn ends still owing it, nothing more is owed a wake. On main, the first Stop continues the turn instead.test_agent_sees_the_complete_interaction_recovery's snapshot now shows a Stop with no output, the watch's reminder wake, and the reminder in the next prompt, where it used to show the reminder in the Stop hook's output.--print(printing), where it still does. Two monkeypatched policies take the new keyword.leaf-dev journey claude-codegains adeferredstep. The user's own turn, told to leave Leaf's comments for later, is handed a comment at a tool boundary and ends on its answer, with no Stop hook continuing it. The step checks that the user's turn closed with the comment unanswered, that no Stop hook output named it, and that a later prompt named it before it was answered. The full journey passed every step on this branch. Indeferred, the user's turn ended on "done", and the woken turn answered the comment 35 s after it was sent, with one wake row and no empty one. The journey's row count now counts a wake as filled when its prompt carries a reminder (ATTENTION_OPENING) as well as a delivery. The--hooks-modulearm named in the decision no longer exists, since Quiet Claude Code delivery: one background watch, no mid-turn wakes, hidden wake rows #3540 removed the module's watch, so the plugin's module loaded in this one run.