You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After #170/#171 fixes, every SWE spawn results in two worktrees when only one is needed:
`worktree-agent-` β created by CC's automatic WorktreeCreate event firing `scripts/hooks/create-worktree.sh` (because `agents/swe.md` has `isolation: worktree` in its frontmatter).
The first one is leftover from the original Layer-2 workaround for CC's bug #27134/#44965 (worktree_add defaulting to `origin/HEAD` instead of `HEAD`). With SWE now always creating its own worktree explicitly via Bash, the auto one is redundant β and the new `cleanup-worktree-on-task-close.sh` only removes the task-branch worktree, leaving the auto one to accumulate.
Proposed
Remove `isolation: worktree` from `agents/swe.md` frontmatter (or change to a value that doesn't trigger CC's auto-worktree if such a value exists).
Remove `scripts/hooks/create-worktree.sh` + the WorktreeCreate hooks.json entry.
Verify with a fresh L5 dogfood that only the bro-created task-branch worktree gets created and cleaned up.
Risks
CC's bug may still bite if a future doctrine change re-introduces auto-worktree.
Some flows may rely on the agent isolation that CC's worktree provides for free. Worth checking that the explicit Bash-created worktree provides the same isolation guarantees.
Surfaced by
Local h5 re-run after #172 fixes β observed two worktrees in the project after task close, one cleaned, one orphaned.
After #170/#171 fixes, every SWE spawn results in two worktrees when only one is needed:
The first one is leftover from the original Layer-2 workaround for CC's bug #27134/#44965 (worktree_add defaulting to `origin/HEAD` instead of `HEAD`). With SWE now always creating its own worktree explicitly via Bash, the auto one is redundant β and the new `cleanup-worktree-on-task-close.sh` only removes the task-branch worktree, leaving the auto one to accumulate.
Proposed
Risks
Surfaced by
Local h5 re-run after #172 fixes β observed two worktrees in the project after task close, one cleaned, one orphaned.