Add gt recycle command for instant session hot-reload

Uses tmux respawn-pane to kill and restart agent sessions in place,
bypassing the handoff/manager flow for quick context cycling.

Supports local recycle (current session) and remote recycle (other
roles) with automatic client switching.

🤖 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-22 23:12:19 -08:00
parent c134a7bd01
commit 22fe745595
2 changed files with 249 additions and 0 deletions

View File

@@ -544,3 +544,11 @@ func (t *Tmux) SetMailClickBinding(session string) error {
"display-popup", "-E", "-w", "60", "-h", "15", "gt mail peek || echo 'No unread mail'")
return err
}
// RespawnPane kills all processes in a pane and starts a new command.
// This is used for "hot reload" of agent sessions - instantly restart in place.
// The pane parameter should be a pane ID (e.g., "%0") or session:window.pane format.
func (t *Tmux) RespawnPane(pane, command string) error {
_, err := t.run("respawn-pane", "-k", "-t", pane, command)
return err
}