Repository navigation
Hand a claude session its mail through the hooks it already calls - #27
Merged
Merged
Conversation
A session only read messages when told to call the inbox tool. The coordinator now answers three of the hooks it already receives for the status dot - UserPromptSubmit, PostToolBatch and Stop - with the waiting messages as additionalContext and a systemMessage naming the senders, so the person watching the pane sees each delivery. On Stop the context continues the turn, and the state stays Working. The reply never carries a decision or a block. Mail is held back, and stays in the box for the next event or for inbox, inside a subagent (agent_id set), on a Stop already continuing (stop_hook_active), and past mailBudget, below Claude Code's 10,000-character context cap. The messages go out as JSON, so a body cannot pose as a second message. Each event gets its own endpoint because the reply names its event. Deck still never writes into a pane, so an idle session reads its mail when its next turn starts, and other agents still collect with inbox. TestLiveClaudeReadsMailWithoutAsking proves claude 2.1.296 accepts the reply at both ends of a turn; it fails with Stop delivery disabled.
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.
Agents had to be reminded to check the inbox. A
claudesession now reads new messages automatically: the coordinator answers theUserPromptSubmit,PostToolBatchandStophooks it already receives for the status dot with the waiting messages asadditionalContext, plus asystemMessagenaming the senders so the person watching sees each delivery.Stopthe context continues the turn, so mail that arrives as a turn ends is read before it stops.inbox, inside a subagent, on aStopalready continuing, and past the size budget below Claude Code's 10,000-character cap.inbox.Checked:
make racepasses locally.TestLiveClaudeReadsMailWithoutAskingpassed against claude 2.1.296 and fails with Stop delivery disabled. Each guard was removed in turn and a test went red. Not covered: a reply lost in transit loses its mail, and two agents messaging each other can keep each other busy. Not tried in a real terminal.