From 99a619ae09ae89504b0e8541ad8d02e77bc6d5ce Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sun, 28 Dec 2025 16:18:52 -0800 Subject: [PATCH] fix: Add startup delay before nudging newly spawned polecats (gt-1dbcp) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude needs ~2 seconds to initialize before it can process nudges. Without this delay, the initial "Work slung" message would arrive before Claude was ready, causing the SessionStart hook not to fire. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/cmd/sling.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/internal/cmd/sling.go b/internal/cmd/sling.go index a450904b..fcb39f85 100644 --- a/internal/cmd/sling.go +++ b/internal/cmd/sling.go @@ -6,6 +6,7 @@ import ( "os" "os/exec" "strings" + "time" "github.com/spf13/cobra" "github.com/steveyegge/gastown/internal/beads" @@ -13,6 +14,10 @@ import ( "github.com/steveyegge/gastown/internal/tmux" ) +// claudeStartupDelay is how long to wait for Claude to start before nudging. +// This fixes gt-1dbcp: polecat auto-start doesn't process initial nudge. +const claudeStartupDelay = 2 * time.Second + var slingCmd = &cobra.Command{ Use: "sling [target]", GroupID: GroupWork, @@ -176,6 +181,12 @@ func runSling(cmd *cobra.Command, args []string) error { } targetAgent = spawnInfo.AgentID() targetPane = spawnInfo.Pane + + // Wait for Claude to start up before nudging (fixes gt-1dbcp) + if targetPane != "" { + fmt.Printf("Waiting for Claude to initialize...\n") + time.Sleep(claudeStartupDelay) + } } } else { // Slinging to an existing agent @@ -531,6 +542,12 @@ func runSlingFormula(args []string) error { } targetAgent = spawnInfo.AgentID() targetPane = spawnInfo.Pane + + // Wait for Claude to start up before nudging (fixes gt-1dbcp) + if targetPane != "" { + fmt.Printf("Waiting for Claude to initialize...\n") + time.Sleep(claudeStartupDelay) + } } } else { // Slinging to an existing agent