Skip to content

chore(devops): add stale worktree cleanup process #2467

@mrveiss

Description

@mrveiss

Problem

During v0.2.0 release prep, 14 git worktrees were found lingering under .worktrees/, including 5 for already-merged PRs and closed issues. No automated or documented cleanup process exists.

Impact

  • Disk space waste (each worktree is a full repo copy)
  • Branch deletion fails when worktree holds the branch
  • Confusion about which worktrees represent active work

Discovered During

v0.2.0 release — had to manually remove worktrees before merging PRs.

Suggested Fix

  • Add a cleanup script or git hook that removes worktrees whose branches are merged/deleted
  • Document worktree lifecycle in CLAUDE.md or developer guide
  • Consider a pre-release checklist step: "prune stale worktrees"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions