Skip to content

fix: CLAUDE.md missing worktree/branch cleanup rules after PR #2478 merge #2507

@mrveiss

Description

@mrveiss

Problem

Session on 2026-03-26 added three CLAUDE.md changes for worktree/branch hygiene:

  1. Issue completion checklist steps 7-8 (remove worktree, delete branch)
  2. New "Worktree & Branch Cleanup (MANDATORY)" section under Branch Strategy with bulk cleanup commands
  3. End-of-session ritual step 2 (clean up worktrees & branches for closed issues)

PR #2478 (issue #2467) was merged concurrently, overwriting all three additions. Only the cleanup-worktrees.sh reference on line 416 survived.

Impact

Without these rules in CLAUDE.md, agents will continue leaving stale worktrees and branches after issue closure — the same problem that caused 130+ stale branches to accumulate.

Fix

Re-add the three CLAUDE.md sections. The exact content is documented in this session's conversation. Key additions:

  • Steps 7-8 in "Issue is complete ONLY when" checklist
  • "Worktree & Branch Cleanup" section with single-issue and bulk cleanup commands
  • End-of-session ritual step 2

Discovered During

Worktree/branch cleanup session on 2026-03-26 (151 → 4 branches).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationpriority: high

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions