Skip to content

Repo housekeeping: 44 merged branches and 3 stale agent worktrees #87

Description

@kitikonti

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:

  1. 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.
  2. 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

  • git worktree list shows only the main checkout
  • .claude/worktrees/ is empty or gone
  • git branch lists only main plus anything deliberately kept
  • A decision is recorded (here) on backup-before-reset-20251218-210028 and feature/task-groups-wip before either is deleted
  • .claude/** is excluded from coverage, lint, format, and lint:colors walks
  • npm run ci:local passes afterwards

Related: #84

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions