원클릭으로
sweep-worktrees
Reclaims zombie linked worktrees (and their branches) that /worktree-end could not remove due to Windows CWD lock or similar.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Reclaims zombie linked worktrees (and their branches) that /worktree-end could not remove due to Windows CWD lock or similar.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Conduct a decision-tree interview with the user to lock in requirements, motivation, scope, and non-goals before planning.
Stage 3 of three-stage planning pipeline. Produce a file-level implementation plan via detail-planner/detail-reviewer loop, then get user approval. Inputs are confirmed intent (<session-id>-intent.md) and outline (<session-id>-outline.md) from prior stages.
Edit source code for the current task. Delegates editing and lint/typecheck/self-repair to a subagent.
Plan and write test cases with high reasoning effort. Test iteration runs in a subagent to minimize confirmations.
Explore the codebase to understand existing patterns, constraints, and relevant files before planning.
Investigate git history, docs/history.md, and GitHub issue/PR timeline since the relevant issue opened, to surface changes that may invalidate the issue's premises.
| name | sweep-worktrees |
| description | Reclaims zombie linked worktrees (and their branches) that /worktree-end could not remove due to Windows CWD lock or similar. |
| user-invocable | true |
| model | sonnet |
| context | fork |
Reclaims zombie linked worktrees left behind when /worktree-end could not
physically remove a worktree (e.g. Windows CWD lock from VS Code's extension
host). After successful worktree removal, also deletes the corresponding
branch. Also scans WORKTREE_BASE_DIR for orphan directories not tracked by
git's worktree registry.
SWT-1. Resolve $AGENTS_CONFIG_DIR from the environment; abort with a clear error
if unset.
SWT-2. Invoke the sweeper script (no --apply = dry-run):
bash "$AGENTS_CONFIG_DIR/bin/sweep-worktrees.sh" [--apply] [--min-age-hours N] [--ci-mode]
SWT-3. Print the script's stdout verbatim. Do not summarize or filter.
Forward the user's flags verbatim. Add no flags of your own.
--apply must be explicit to delete.--force is not supported; the script uses git worktree remove without --force.git branch -D) is authorized only AFTER the worktree is
removed (git's cascade rule blocks branch deletion while the worktree is
registered).branch -D target).Main repo: field
in WORKTREE_NOTES.md. Basename match alone is NOT ownership proof — two
unrelated repos can share agents/dotfiles basenames. The former
"empty-or-notes-only" gate was removed: a partial git worktree remove can
leave a full checkout without a .git file, which is safe to delete when
ownership is proven.Pre-#503 state that this skill no longer reclaims (acceptable one-time cleanup cost; this skill stays safe by refusing to act on it):
pending-branch-delete marker files at
<git-common-dir>/info/pending-branch-delete inside each repo's .git
directory (per-repo, not under ~/.workflow-plans/). They are inert after
#503 — the hook ignores them entirely. Locate and delete per-repo:
find ~/git -type f -path '*/.git/info/pending-branch-delete' -delete
Adjust the search root to wherever you keep clones.Main repo: field. Gate 5 skips them as repo_mismatch because
ownership cannot be proven. Inspect manually and remove with
git worktree remove (if still registered) or rm -rf (if not registered
and contents are confirmed disposable).