diff --git a/internal/cmd/install.go b/internal/cmd/install.go index 61c25c7d..6365cbca 100644 --- a/internal/cmd/install.go +++ b/internal/cmd/install.go @@ -188,6 +188,15 @@ func runInstall(cmd *cobra.Command, args []string) error { fmt.Printf(" ✓ Created .claude/settings.json\n") } + // Initialize git BEFORE beads so that bd can compute repository fingerprint. + // The fingerprint is required for the daemon to start properly. + if installGit || installGitHub != "" { + fmt.Println() + if err := InitGitForHarness(absPath, installGitHub, !installPublic); err != nil { + return fmt.Errorf("git initialization failed: %w", err) + } + } + // Initialize town-level beads database (optional) // Town beads (hq- prefix) stores mayor mail, cross-rig coordination, and handoffs. // Rig beads are separate and have their own prefixes. @@ -234,14 +243,6 @@ func runInstall(cmd *cobra.Command, args []string) error { fmt.Printf(" ✓ Created .claude/commands/ (slash commands for all agents)\n") } - // Initialize git if requested (--git or --github implies --git) - if installGit || installGitHub != "" { - fmt.Println() - if err := InitGitForHarness(absPath, installGitHub, !installPublic); err != nil { - return fmt.Errorf("git initialization failed: %w", err) - } - } - fmt.Printf("\n%s HQ created successfully!\n", style.Bold.Render("✓")) fmt.Println() fmt.Println("Next steps:")