diff --git a/internal/cmd/crew_at.go b/internal/cmd/crew_at.go index cfd52587..d292c057 100644 --- a/internal/cmd/crew_at.go +++ b/internal/cmd/crew_at.go @@ -133,8 +133,9 @@ func runCrewAt(cmd *cobra.Command, args []string) error { // Check if we're already in the target session if isInTmuxSession(sessionID) { // We're in the session at a shell prompt - just start Claude directly + // Pass "gt prime" as initial prompt so Claude loads context immediately fmt.Printf("Starting Claude in current session...\n") - return execClaude() + return execClaude("gt prime") } // Attach to session using exec to properly forward TTY diff --git a/internal/cmd/crew_helpers.go b/internal/cmd/crew_helpers.go index 127edd34..0e3eda87 100644 --- a/internal/cmd/crew_helpers.go +++ b/internal/cmd/crew_helpers.go @@ -147,7 +147,8 @@ func isShellCommand(cmd string) bool { // execClaude execs claude, replacing the current process. // Used when we're already in the target session and just need to start Claude. -func execClaude() error { +// If prompt is provided, it's passed as the initial prompt to Claude. +func execClaude(prompt string) error { claudePath, err := exec.LookPath("claude") if err != nil { return fmt.Errorf("claude not found: %w", err) @@ -155,6 +156,9 @@ func execClaude() error { // exec replaces current process with claude args := []string{"claude", "--dangerously-skip-permissions"} + if prompt != "" { + args = append(args, prompt) + } return syscall.Exec(claudePath, args, os.Environ()) }