From 6932fcf75dc0259b7b5699258d9bb9fefd406ff0 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Tue, 23 Dec 2025 13:06:31 -0800 Subject: [PATCH] Update role prompts to use gt handoff for session cycling (gt-yt6g) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - crew.md: Use gt handoff instead of manual mail for handoff - witness.md: Use gt handoff in Session Self-Cycling section - refinery.md: Simplify Session Self-Cycling to use gt handoff - deacon.md: Add Session Self-Cycling section with gt handoff All non-polecat roles now consistently document gt handoff as the canonical way to end sessions. Polecats use gt done (handled by Witness). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- prompts/roles/crew.md | 48 ++++++++++++++++----------------------- prompts/roles/deacon.md | 21 +++++++++++++++++ prompts/roles/refinery.md | 19 ++++------------ prompts/roles/witness.md | 14 +++++------- 4 files changed, 52 insertions(+), 50 deletions(-) diff --git a/prompts/roles/crew.md b/prompts/roles/crew.md index 0a6666f9..306f459a 100644 --- a/prompts/roles/crew.md +++ b/prompts/roles/crew.md @@ -63,45 +63,33 @@ gt mail send -s "Done: " -m "Summary..." When your context fills up, you can cycle to a fresh session while preserving state. -### Manual Handoff +### Using gt handoff (Canonical Method) -Send a handoff mail to yourself: +The canonical way to end any agent session: ```bash -gt mail send {{ rig }}/{{ name }} -s "HANDOFF: Work in progress" -m " -## Current State - -Working on: -Branch: +gt handoff # Basic handoff +gt handoff -s "Work in progress" -m " +Working on: Status: - -## Next Steps - -1. -2. - -## Notes - - +Next: " ``` -Then end your session. The next session will see this message in its inbox. +This: +1. Sends handoff mail to yourself (with optional context via -s/-m flags) +2. Respawns with fresh Claude instance +3. The SessionStart hook runs `gt prime` to restore context +4. Work continues from your pinned molecule ### Using gt crew refresh -The overseer can trigger a clean handoff: +The overseer can also trigger a clean handoff: ```bash gt crew refresh {{ name }} ``` -This: -1. Prompts you to prepare handoff (if session active) -2. Ends the current session -3. Starts a fresh session -4. The new session sees the handoff message - ## No Witness Monitoring **Important**: Unlike polecats, you have no Witness watching over you: @@ -193,13 +181,17 @@ Before ending your session: ``` [ ] 1. git status (check for uncommitted changes) -[ ] 2. git push (push any commits) +[ ] 2. git add && git commit (commit any changes) [ ] 3. bd sync (sync beads if configured) -[ ] 4. Check inbox (any messages needing response?) -[ ] 5. HANDOFF if incomplete: - gt mail send {{ rig }}/{{ name }} -s "🤝 HANDOFF: ..." -m "..." +[ ] 4. git push (push to remote - CRITICAL) +[ ] 5. gt handoff (hand off to fresh session) + # Or with context: gt handoff -s "Brief" -m "Details" ``` +**Why `gt handoff`?** This is the canonical way to end any agent session. It +sends handoff mail, respawns with fresh context, and your work continues from +where you left off via your pinned molecule. + ## Tips - **You own your workspace**: Unlike polecats, you're not transient. Keep it organized. diff --git a/prompts/roles/deacon.md b/prompts/roles/deacon.md index 59296a56..8eaf1330 100644 --- a/prompts/roles/deacon.md +++ b/prompts/roles/deacon.md @@ -92,6 +92,27 @@ When agents request lifecycle actions, process them: | `restart` | Kill session, fresh restart | | `shutdown` | Kill session, don't restart | +## Session Self-Cycling + +When your context fills up (context-check step indicates HIGH): + +1. Complete current patrol step if possible + +2. Use `gt handoff` to cycle to a fresh session: + ```bash + gt handoff -s "Deacon patrol cycle" -m " + Patrol status: + Last action: + Notes: + " + ``` + +**Why `gt handoff`?** This is the canonical way to end any agent session. It +sends handoff mail, then respawns with fresh Claude instance. The SessionStart +hook runs `gt prime` to restore your context. + +Your molecule state survives the restart - you'll resume from your current step. + ## Nondeterministic Idempotence The Deacon uses molecule-based handoff: diff --git a/prompts/roles/refinery.md b/prompts/roles/refinery.md index 409d1c3b..5e2cd398 100644 --- a/prompts/roles/refinery.md +++ b/prompts/roles/refinery.md @@ -140,9 +140,9 @@ When your context fills up (slow responses, losing track of state, high token co 1. **Complete current work** - finish any in-progress merge or burn the current step -2. **Capture state in handoff mail**: +2. **Use `gt handoff`** to cycle to a fresh session: ```bash - gt mail send {{ rig }}/refinery -s "HANDOFF: Refinery session cycle" -m " + gt handoff -s "Refinery cycle" -m " Queue position: Last merged: Pending branches: @@ -150,18 +150,9 @@ When your context fills up (slow responses, losing track of state, high token co " ``` -3. **Request lifecycle action** - send to deacon: - ```bash - gt mail send deacon/ -s "LIFECYCLE: refinery requesting cycle" -m "Context full, requesting fresh session" - ``` - -4. **Set state flag** (if state.json exists): - ```bash - # Mark that you're ready to be cycled - echo '{"requesting_cycle": true}' > .runtime/refinery-state.json - ``` - -5. **Exit cleanly** - the daemon will restart you with fresh context +**Why `gt handoff`?** This is the canonical way to end any agent session. It +sends handoff mail, then respawns with fresh Claude instance. The SessionStart +hook runs `gt prime` to restore your context. Your molecule state survives the restart - you'll resume from your current step. diff --git a/prompts/roles/witness.md b/prompts/roles/witness.md index 117e86b3..2cdbee85 100644 --- a/prompts/roles/witness.md +++ b/prompts/roles/witness.md @@ -269,15 +269,11 @@ Before killing ANY polecat session, verify: When your context fills up (slow responses, losing track of state): -1. Capture current state: - - Active workers and their status - - Pending nudges (worker, nudge count, last nudge time) - - Recent escalations - - Any other relevant context +1. Capture current state mentally (active workers, pending nudges, escalations) -2. Send handoff to yourself: +2. Use `gt handoff` to cycle to a fresh session: ```bash - gt mail send {{ rig }}/witness -s "HANDOFF: Witness session cycle" -m " + gt handoff -s "Witness cycle" -m " Active workers: Pending nudges: - : nudges, last at