From 03775c6fc79dff9ca852080ca0610169dc6737e9 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Mon, 29 Dec 2025 18:01:09 -0800 Subject: [PATCH] Startup hooks nudge Deacon for GUPP backstop (gt-vdprb.3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add special handling for 'deacon' target in gt nudge command - Maps 'deacon' to gt-deacon session, gracefully handles if not running - Add gt nudge deacon session-started to SessionStart hooks - Updated settings-autonomous.json, settings-interactive.json, and ensurePatrolHooks() template 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .claude/settings.json | 2 +- .../claude/config/settings-autonomous.json | 2 +- .../claude/config/settings-interactive.json | 2 +- internal/cmd/deacon.go | 3 +- internal/cmd/nudge.go | 38 +++++++++++++++++-- 5 files changed, 39 insertions(+), 8 deletions(-) diff --git a/.claude/settings.json b/.claude/settings.json index 1dbac45a..2d9e0601 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -9,7 +9,7 @@ "hooks": [ { "type": "command", - "command": "gt prime" + "command": "gt prime && gt nudge deacon session-started" } ] } diff --git a/internal/claude/config/settings-autonomous.json b/internal/claude/config/settings-autonomous.json index b14e19b6..14d04bd7 100644 --- a/internal/claude/config/settings-autonomous.json +++ b/internal/claude/config/settings-autonomous.json @@ -9,7 +9,7 @@ "hooks": [ { "type": "command", - "command": "gt prime && gt mail check --inject" + "command": "gt prime && gt mail check --inject && gt nudge deacon session-started" } ] } diff --git a/internal/claude/config/settings-interactive.json b/internal/claude/config/settings-interactive.json index 1dbac45a..2d9e0601 100644 --- a/internal/claude/config/settings-interactive.json +++ b/internal/claude/config/settings-interactive.json @@ -9,7 +9,7 @@ "hooks": [ { "type": "command", - "command": "gt prime" + "command": "gt prime && gt nudge deacon session-started" } ] } diff --git a/internal/cmd/deacon.go b/internal/cmd/deacon.go index cb1f878c..26a2ed97 100644 --- a/internal/cmd/deacon.go +++ b/internal/cmd/deacon.go @@ -410,6 +410,7 @@ func ensurePatrolHooks(workspacePath string) error { } // Standard patrol hooks + // Note: SessionStart nudges Deacon for GUPP backstop (agent wake notification) hooksJSON := `{ "hooks": { "SessionStart": [ @@ -418,7 +419,7 @@ func ensurePatrolHooks(workspacePath string) error { "hooks": [ { "type": "command", - "command": "gt prime && gt mail check --inject" + "command": "gt prime && gt mail check --inject && gt nudge deacon session-started" } ] } diff --git a/internal/cmd/nudge.go b/internal/cmd/nudge.go index 24f65845..99e45ec3 100644 --- a/internal/cmd/nudge.go +++ b/internal/cmd/nudge.go @@ -15,10 +15,10 @@ func init() { } var nudgeCmd = &cobra.Command{ - Use: "nudge ", + Use: "nudge ", GroupID: GroupComm, - Short: "Send a message to a polecat session reliably", - Long: `Sends a message to a polecat's Claude Code session. + Short: "Send a message to a polecat or deacon session reliably", + Long: `Sends a message to a polecat's or deacon's Claude Code session. Uses a reliable delivery pattern: 1. Sends text in literal mode (-l flag) @@ -28,9 +28,13 @@ Uses a reliable delivery pattern: This is the ONLY way to send messages to Claude sessions. Do not use raw tmux send-keys elsewhere. +Special targets: + deacon Maps to the Deacon session (gt-deacon) + Examples: gt nudge gastown/furiosa "Check your mail and start working" - gt nudge gastown/alpha "What's your status?"`, + gt nudge gastown/alpha "What's your status?" + gt nudge deacon session-started`, Args: cobra.ExactArgs(2), RunE: runNudge, } @@ -65,6 +69,32 @@ func runNudge(cmd *cobra.Command, args []string) error { t := tmux.NewTmux() + // Special case: "deacon" target maps to the Deacon session + if target == "deacon" { + // Check if Deacon session exists + exists, err := t.HasSession(DeaconSessionName) + if err != nil { + return fmt.Errorf("checking deacon session: %w", err) + } + if !exists { + // Deacon not running - this is not an error, just log and return + fmt.Printf("%s Deacon not running, nudge skipped\n", style.Dim.Render("○")) + return nil + } + + if err := t.NudgeSession(DeaconSessionName, message); err != nil { + return fmt.Errorf("nudging deacon: %w", err) + } + + fmt.Printf("%s Nudged deacon\n", style.Bold.Render("✓")) + + // Log nudge event + if townRoot, err := workspace.FindFromCwd(); err == nil && townRoot != "" { + LogNudge(townRoot, "deacon", message) + } + return nil + } + // Check if target is rig/polecat format or raw session name if strings.Contains(target, "/") { // Parse rig/polecat format