From d8be33d13ec9f24b5f482120f78a0fd7826743e4 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Tue, 30 Dec 2025 00:49:10 -0800 Subject: [PATCH] fix: Witness cleanup uses gt polecat nuke for correct repo base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The witness template previously instructed using raw git commands: - git worktree remove polecats/ - git branch -d polecat/ This failed because git worktree operations must run from the repo that created the worktree (mayor/rig or .repo.git), not the rig root. Now uses `gt polecat nuke` which handles repo base detection via the repoBase() function and properly cleans up worktrees. Fixes gt-gp6i 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- templates/witness-CLAUDE.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/templates/witness-CLAUDE.md b/templates/witness-CLAUDE.md index 8ca90fb0..8c08d13d 100644 --- a/templates/witness-CLAUDE.md +++ b/templates/witness-CLAUDE.md @@ -59,10 +59,13 @@ Before killing ANY polecat session, verify: Polecat: Verified: clean git state, issue closed" ``` -2. **Kill session**: `tmux kill-session -t gt-{{RIG}}-` -3. Remove worktree: `git worktree remove polecats/` (if ephemeral) -4. Delete branch: `git branch -d polecat/` (if ephemeral) -5. **Notify Mayor** (for tracking): +2. **Nuke the polecat** (kills session, removes worktree, deletes branch): + ```bash + gt polecat nuke {{RIG}}/ + ``` + NOTE: Use `gt polecat nuke` instead of raw git commands. It knows the correct + worktree parent repo (mayor/rig or .repo.git) and handles cleanup properly. +3. **Notify Mayor** (for tracking): ```bash gt mail send mayor/ -s "Polecat processed" -m "Work: MR sent to refinery for branch: "