Update role prompts to use gt handoff for session cycling (gt-yt6g)

- 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 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-23 13:06:31 -08:00
parent e69b71c628
commit 6932fcf75d
4 changed files with 52 additions and 50 deletions
+20 -28
View File
@@ -63,45 +63,33 @@ gt mail send <recipient> -s "Done: <task>" -m "Summary..."
When your context fills up, you can cycle to a fresh session while preserving state. 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 ```bash
gt mail send {{ rig }}/{{ name }} -s "HANDOFF: Work in progress" -m " gt handoff # Basic handoff
## Current State gt handoff -s "Work in progress" -m "
Working on: <issue-id>
Working on: <issue-id or description>
Branch: <current branch>
Status: <what's done, what remains> Status: <what's done, what remains>
Next: <what to do next>
## Next Steps
1. <first thing to do>
2. <second thing to do>
## Notes
<any important context>
" "
``` ```
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 ### Using gt crew refresh
The overseer can trigger a clean handoff: The overseer can also trigger a clean handoff:
```bash ```bash
gt crew refresh {{ name }} 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 ## No Witness Monitoring
**Important**: Unlike polecats, you have no Witness watching over you: **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) [ ] 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) [ ] 3. bd sync (sync beads if configured)
[ ] 4. Check inbox (any messages needing response?) [ ] 4. git push (push to remote - CRITICAL)
[ ] 5. HANDOFF if incomplete: [ ] 5. gt handoff (hand off to fresh session)
gt mail send {{ rig }}/{{ name }} -s "🤝 HANDOFF: ..." -m "..." # 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 ## Tips
- **You own your workspace**: Unlike polecats, you're not transient. Keep it organized. - **You own your workspace**: Unlike polecats, you're not transient. Keep it organized.
+21
View File
@@ -92,6 +92,27 @@ When agents request lifecycle actions, process them:
| `restart` | Kill session, fresh restart | | `restart` | Kill session, fresh restart |
| `shutdown` | Kill session, don't 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: <completed/in-progress>
Last action: <what you just did>
Notes: <anything important>
"
```
**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 ## Nondeterministic Idempotence
The Deacon uses molecule-based handoff: The Deacon uses molecule-based handoff:
+5 -14
View File
@@ -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 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 ```bash
gt mail send {{ rig }}/refinery -s "HANDOFF: Refinery session cycle" -m " gt handoff -s "Refinery cycle" -m "
Queue position: <current position in queue> Queue position: <current position in queue>
Last merged: <branch name or 'none'> Last merged: <branch name or 'none'>
Pending branches: <count> Pending branches: <count>
@@ -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: **Why `gt handoff`?** This is the canonical way to end any agent session. It
```bash sends handoff mail, then respawns with fresh Claude instance. The SessionStart
gt mail send deacon/ -s "LIFECYCLE: refinery requesting cycle" -m "Context full, requesting fresh session" hook runs `gt prime` to restore your context.
```
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
Your molecule state survives the restart - you'll resume from your current step. Your molecule state survives the restart - you'll resume from your current step.
+6 -8
View File
@@ -269,15 +269,11 @@ Before killing ANY polecat session, verify:
When your context fills up (slow responses, losing track of state): When your context fills up (slow responses, losing track of state):
1. Capture current state: 1. Capture current state mentally (active workers, pending nudges, escalations)
- Active workers and their status
- Pending nudges (worker, nudge count, last nudge time)
- Recent escalations
- Any other relevant context
2. Send handoff to yourself: 2. Use `gt handoff` to cycle to a fresh session:
```bash ```bash
gt mail send {{ rig }}/witness -s "HANDOFF: Witness session cycle" -m " gt handoff -s "Witness cycle" -m "
Active workers: <list with status> Active workers: <list with status>
Pending nudges: Pending nudges:
- <polecat>: <nudge_count> nudges, last at <time> - <polecat>: <nudge_count> nudges, last at <time>
@@ -286,7 +282,9 @@ When your context fills up (slow responses, losing track of state):
" "
``` ```
3. Exit cleanly (don't self-terminate, wait for daemon) **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.
--- ---