Repository navigation
Description
Skills: finishing-a-development-branch (Step 6), interacting with subagent-driven-development
Versions: reproduced against 6.3.0; the same code path and wording are in 6.2.0
Environment: git 2.55.0, Linux
Summary
Step 6 of finishing-a-development-branch protects uncommitted work by relying on
git worktree remove to refuse:
If removal is refused (
contains modified or untracked files): the worktree holds files that
exist nowhere else — uncommitted plans, notes, or scratch work. Never--forceon your own
initiative. Show your human partner what is at stake and ask […]
That guard is keyed on untracked files. git worktree remove does not count ignored files as
untracked, so it does not refuse for them.
subagent-driven-development creates its workspace through scripts/sdd-workspace, which writes a
self-ignoring .gitignore containing * at .superpowers/sdd/. A worktree whose only extra content
is that workspace therefore reports a clean status, git worktree remove succeeds with exit 0, and
the workspace is destroyed without the operator ever seeing Step 6's three-way prompt.
The content at risk is the content the guard exists for: the progress ledger's Ruling: lines and the
implementer/reviewer reports. 6.3.0's own §Finish makes the point — "A ruling that dies with the
workspace was a decision made in secret."
Reproduction
git init -q r && cd r
git commit -q --allow-empty -m init
git worktree add -q ../w -b feat
# Exactly what scripts/sdd-workspace creates:
mkdir -p ../w/.superpowers/sdd/my-plan
printf '*\n' > ../w/.superpowers/sdd/.gitignore
echo "ledger line that exists nowhere else" > ../w/.superpowers/sdd/my-plan/progress.md
# 1. What Step 6's guard effectively inspects:
git -C ../w status --porcelain -uall
# → (no output; reads clean)
# 2. Remove it, no --force:
git worktree remove ../w
# → exit 0, no refusal, no prompt
cat ../w/.superpowers/sdd/my-plan/progress.md
# → No such file or directoryThis is not a git bug
git worktree remove documents refusal for a dirty or untracked-file-containing worktree; ignored
files are outside that check. The defect is the skill's inference that a non-refusal means nothing
unique is present in the worktree.
When it actually bites
In the normal successful path it does not: subagent-driven-development §Finish deletes the workspace
itself once the final whole-branch review is clean, so by the time finishing-a-development-branch
runs there is nothing left to lose.
It bites when the workspace outlives the SDD session:
- the branch and worktree are kept after the SDD run and the worktree is removed later, by hand or by
a subsequent run; - a run is abandoned, or its final review never comes back clean, so §Finish's deletion never happens;
- a session is compacted or resumed and the controller stops before §Finish;
- any external cleanup that removes the worktree.
In those cases the ledger and reports are the only copy, and --force was never needed to lose them.
Related, and worth a second look
The release notes for the .superpowers/sdd/ move record the adjacent case:
because the workspace is git-ignored working-tree scratch,
git clean -fdxwill delete the progress
ledger; recover fromgit logif that happens.
git log recovers which tasks completed — the commits the ledger names. It does not recover the
ledger's rulings, the parked/adjudicated findings, or the implementer and reviewer reports, none of
which are in git at all. The recovery advice holds for progress state but not for the decision record
that 6.3.0 added the "Rulings I made" step to protect.
Possible directions
Offered as options, not a preferred fix:
-
Widen Step 6's pre-removal check to consider ignored content, e.g. via
git -C "$WORKTREE_PATH" status --porcelain -uall --ignored=matchingThis would need filtering or classification rather than feeding the existing prompt directly:
worktrees routinely hold ignored build output, dependency trees, and caches that are safely
disposable, and prompting on all of it would be noise that trains the operator to dismiss the
prompt. -
Check specifically for a surviving SDD workspace — the one ignored artifact Superpowers itself
creates, and therefore the targeted fix with the lowest false-positive rate: if
$WORKTREE_PATH/.superpowers/sdd/is non-empty, do not remove the worktree silently. -
Say what to do when the workspace outlives the run.
subagent-driven-development§Finish
currently covers only the delete-at-final-review-clean case; a sentence on preserving the workspace
when the run ends any other way would close the gap from the other side.
(2) and (3) are complementary — one guards the boundary, the other tells the controller what the
boundary means.
How this was found
A real session's workspace survived past §Finish and was copied out of the worktree by hand before
removal, on the assumption that removal would refuse. The check above showed removal would not have
refused, which is what prompted this report.
Activity
Enough1122 commentedon Sep 27, 2026
Confirmed on main (8ca22db, v6.4.2), git 2.55.0 — your repro is exact, including the exit 0.
Both ends are on mainline:
skills/subagent-driven-development/scripts/sdd-workspace:81writesprintf '*\n' > "$base/.gitignore", and Step 6 keys only on git's refusal message (skills/finishing-a-development-branch/SKILL.md:177), with the diagnostic at:183running--porcelain -ualland no--ignored. Ignored files never make a worktree dirty, so the guard's inference — no refusal means nothing unique is in there — does not hold for the one artifact superpowers itself creates.Your (2) is the fix worth taking: treat a non-empty
$WORKTREE_PATH/.superpowers/sdd/as refusal-equivalent and run the existing three-way prompt.--ignored=matchingfires on node_modules, target/, .venv and build output on essentially every removal, and a prompt that always fires is one the operator learns to dismiss.(3) is the other side of the same boundary: §Finish (
skills/subagent-driven-development/SKILL.md:483) only covers delete-at-final-review-clean, so a run that ends any other way has no stated handling.Your
git logpoint is right but already filed as #2344 — that one is the release-note wording, not this guard.fix(finishing): surface surviving Superpowers scratch before worktree…
abat-kek commentedon Nov 6, 2026
Hit this twice on Windows, with one addition.
git status --porcelain --ignoredbeforegit worktree removefound unique ignored files (SDD workspace logs, a.env.localthatdiffered from the main checkout); backing them up first worked. But
git worktree removethenfailed on a pnpm
node_moduleswith "Filename too long" — and still unregistered theworktree, leaving a half-deleted directory. The failure did not undo the unregistration.
Only
rd /s /q "\\?\<path>"removed the rest, and an auto-mode classifier refused thatcommand as irreversible local destruction, so in practice this last step is a hand-off to the
human (a ready-made command), not an agent step.
Suggestion for the cleanup step: run the
--ignoredstatus first and copy anything that is nota regenerable artefact; after a failed
remove, measure the state (git worktree list, doesthe directory still exist?) instead of assuming nothing happened; phrase the long-path removal
as a hand-off.
Posted by Claude Code (Claude Opus 5.5) at the account holder's request; observations from superpowers 7.0.2 on Windows 11.
arittr commentedon Nov 10, 2026
We reproduced the cleanup on v7.0.2. Ordinary Git status was clean. Removing the worktree exited 0 and deleted both the ignored SDD ledger and a test
.env.local. @abat-kek, for the Windows long-path case, could you share your Git for Windows version, thecore.longpathssetting and any saved output from the failed removal andgit worktree listimmediately afterward?AI triage using
gpt-6-astrain Codex Desktop (runtime0.167.0-alpha.3.2, session01a1c319-035f-71e1-bb53-090ff17d8f95). Approved by@arittr.fix(finishing): return the finishing skill to dev's text where no iss…
fix(finishing): list ignored worktree files in Step 2 as well
fix(finishing): remove the worktree only once both Step 2 listings ar…