Problem
The local repo has accumulated 47 branches and 3 registered worktrees left over from the big systematic code review and from agent runs. This is not just cosmetic — the stale worktrees are physically inside the project tree and are being picked up by tooling (see #84, where they drag reported test coverage from 95% down to 33%).
Current state
Branches: 47 total, 44 already merged into main
| Group |
Count |
Status |
worktree-review-* |
40 |
merged — leftovers from the full code review |
worktree-agent-* |
3 |
merged, 57-89 commits behind main |
worktree-code-review |
1 |
merged |
main |
1 |
keep |
backup-before-reset-20251218-210028 |
1 |
not merged, 62 commits ahead, last commit 2025-12-18 |
feature/task-groups-wip |
1 |
not merged, 1 commit ahead, last commit 2025-12-23 |
Only main exists on origin — all 46 others are local-only.
Worktrees: 3 registered
$ git worktree list
/home/martin/Projects/app-gantt dd0165e [main]
/home/martin/Projects/app-gantt/.claude/worktrees/agent-a04838b9 17a8a6b [worktree-agent-a04838b9]
/home/martin/Projects/app-gantt/.claude/worktrees/agent-a9447c08 17a8a6b [worktree-agent-a9447c08]
/home/martin/Projects/app-gantt/.claude/worktrees/agent-aa950db9 d270a98 [worktree-agent-aa950db9] prunable
.claude/worktrees/ is 25 MB of duplicated checkout.
Decisions needed before deleting
Two branches are not merged and hold work that exists nowhere else:
backup-before-reset-20251218-210028 — 62 commits, created before a hard reset in Dec 2025. Almost certainly superseded by what actually landed on main since, but it is the only copy. Confirm it is genuinely obsolete before deleting, or push it to origin as an archive.
feature/task-groups-wip — a single WIP commit, "task groups implementation (incomplete)", Dec 2025. Task groups were subsequently delivered (per ROADMAP.md, task groups shipped ahead of schedule), so this is likely dead. Verify, then delete or fold any remaining ideas into an issue.
The 44 merged branches carry no unique commits and are safe to delete unconditionally.
Proposed cleanup
# 1. Remove the prunable worktree registration and any others no longer wanted
git worktree remove .claude/worktrees/agent-a04838b9
git worktree remove .claude/worktrees/agent-a9447c08
git worktree prune
# 2. Delete merged branches (safe: -d refuses anything unmerged)
git branch --merged main | grep -v '^\*' | grep -v ' main$' | xargs -r git branch -d
# 3. Handle the two unmerged branches only after deciding above
# Archive: git push origin backup-before-reset-20251218-210028
# Or drop: git branch -D backup-before-reset-20251218-210028
# git branch -D feature/task-groups-wip
Prevention
Add .claude/worktrees/ to the ignore/exclude paths of tooling that walks the project tree, so a future agent worktree cannot silently corrupt a report again:
Acceptance criteria
Related: #84
Problem
The local repo has accumulated 47 branches and 3 registered worktrees left over from the big systematic code review and from agent runs. This is not just cosmetic — the stale worktrees are physically inside the project tree and are being picked up by tooling (see #84, where they drag reported test coverage from 95% down to 33%).
Current state
Branches: 47 total, 44 already merged into
mainworktree-review-*worktree-agent-*worktree-code-reviewmainbackup-before-reset-20251218-210028feature/task-groups-wipOnly
mainexists onorigin— all 46 others are local-only.Worktrees: 3 registered
.claude/worktrees/is 25 MB of duplicated checkout.Decisions needed before deleting
Two branches are not merged and hold work that exists nowhere else:
backup-before-reset-20251218-210028— 62 commits, created before a hard reset in Dec 2025. Almost certainly superseded by what actually landed onmainsince, but it is the only copy. Confirm it is genuinely obsolete before deleting, or push it tooriginas an archive.feature/task-groups-wip— a single WIP commit, "task groups implementation (incomplete)", Dec 2025. Task groups were subsequently delivered (perROADMAP.md, task groups shipped ahead of schedule), so this is likely dead. Verify, then delete or fold any remaining ideas into an issue.The 44 merged branches carry no unique commits and are safe to delete unconditionally.
Proposed cleanup
Prevention
Add
.claude/worktrees/to the ignore/exclude paths of tooling that walks the project tree, so a future agent worktree cannot silently corrupt a report again:vitest.config.ts→coverage.exclude(covered by Coverage thresholds are silently not enforced, and coverage scope includes stale worktrees #84).gitignore,.eslintignore/ eslintignores,.prettierignore, andscripts/lint-colors.shfor the same gapAcceptance criteria
git worktree listshows only the main checkout.claude/worktrees/is empty or gonegit branchlists onlymainplus anything deliberately keptbackup-before-reset-20251218-210028andfeature/task-groups-wipbefore either is deleted.claude/**is excluded from coverage, lint, format, andlint:colorswalksnpm run ci:localpasses afterwardsRelated: #84