dispatch reaper cannot remove its own worktrees: injected .claude lockdown files block git worktree remove #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally filed by @coilysiren on 2026-05-21T12:09:58Z - https://github.com/coilysiren/coily/issues/308
Problem -
coily dispatch's worktree reaper cannot clean up its own worktrees, so every dispatched worktree leaks until force-removed by hand.Symptom - On every
coily dispatch interactiverun, the reap phase skips stale worktrees:Root cause - coily dispatch injects lockdown files into every worktree it creates -
.claude/settings.jsongets modified and.claude/lockdown-deny.shis added.git worktree remove(without--force) refuses to delete a worktree that has modified or untracked files. So the reaper's own injected files are exactly what makesgit worktree removefail. Every dispatched worktree leaks. Observed on two stuck worktrees (infrastructure/issue-216,eco-mods-assets/issue-2), both with only.claude/lockdown-deny.shand.claude/settings.jsonas the blocking changes.Fix - The reaper should
--forcepast coily's own injected lockdown files. Options:--forcetogit worktree removein the reap path. Simplest. The reaper already decided the worktree is merged/done, so discarding the lockdown deltas is safe..claude/injection so the worktree is clean at reap time, then a plaingit worktree removesucceeds.--forcenarrowly - only force when the sole diff is coily's own.claude/settings.json+.claude/lockdown-deny.sh, and keep the plain remove (with the current skip-and-warn) for any worktree carrying real uncommitted work.The last option is the safest - it never silently discards genuine user work, only coily's own bookkeeping.