feat: session handoff protocol and interruption resilience#9
Open
oloflun wants to merge 1 commit intocote-star:mainfrom
Open
feat: session handoff protocol and interruption resilience#9oloflun wants to merge 1 commit intocote-star:mainfrom
oloflun wants to merge 1 commit intocote-star:mainfrom
Conversation
Add three patterns for reliable cross-agent handoffs: 1. Clean handoff: chorus send at conclude + chorus messages at standup. Added session handoff protocol sections to CLAUDE.md, AGENTS.md, and GEMINI.md with exact commands and --clear flag usage. 2. Interrupted handoff (Claude Code): scripts/hooks/chorus-session-end.sh — a SessionEnd hook that auto-sends git state (branch, uncommitted count, last commit) to codex and gemini on every CLI exit. Guards with .agent-chorus/ presence check so it is safe to install globally. Use SessionEnd not Stop — Stop fires per response turn, SessionEnd fires exactly once on process exit. 3. Mid-task checkpoint (Codex/Gemini): .agent-chorus/CHECKPOINT.md written at the start of each significant task block. Survives interruption without requiring a hook system. Added to AGENTS.md and GEMINI.md. Also adds docs/session-handoff-guide.md covering all three patterns, the Gemini protobuf limitation (chorus read --agent gemini returns NOT_FOUND when sessions are stored as .pb rather than JSONL), and the JSONL stub workaround at conclude time. GEMINI.md was previously near-empty (11 lines context-pack block only). Now has full chorus integration block matching CLAUDE.md/AGENTS.md depth. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
01c0276 to
4c2e516
Compare
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.
Closes #8
Summary
Adds three patterns for reliable cross-agent handoffs even when sessions are interrupted:
chorus sendat conclude +chorus messagesat standup — added to CLAUDE.md, AGENTS.md, and GEMINI.md with exact commandsscripts/hooks/chorus-session-end.sh— aSessionEndhook that auto-sends git state to other agents on any CLI exit, including crashes and closed windows. Guards on.agent-chorus/presence so it is safe to install globally..agent-chorus/CHECKPOINT.mdpattern for agents without a hook system — written at task start, survives interruption without requiring hooksAlso expands GEMINI.md which was near-empty (11 lines, context-pack block only) to a full integration block matching the depth of CLAUDE.md and AGENTS.md.
New Files
scripts/hooks/chorus-session-end.sh— reusableSessionEndhook with install instructions in the file headerdocs/session-handoff-guide.md— covers all three patterns, the Gemini protobuf limitation (chorus read --agent geminireturnsNOT_FOUNDwhen sessions are.pbnot JSONL), and the JSONL stub workaroundWhy
SessionEndnotStopStopfires after every response turn.SessionEndfires exactly once when the process exits. UsingStopwould flood agent message queues with one entry per exchange.Test Plan
chorus send --from claude --to codex --message "test" --cwd .succeedschorus messages --agent codex --cwd . --jsonreturns the messagebash scripts/hooks/chorus-session-end.shwithCLAUDE_PROJECT_DIR=.sends to codex + gemini.agent-chorus/does not exist (guard check)chorus messages --agent codex --jsonafter hook run contains branch + uncommitted count + last commitDeveloped and verified against agent-chorus v0.9.1 on Windows 11 with Claude Code, Codex, and Gemini/Antigravity running in parallel on the same project.
🤖 Generated with Claude Code