The worktree-cleanup playbook and scripts/worktree-audit.sh (pinned at 12d587d) treat untracked and ignored files in a worktree as disposable.
scripts/worktree-audit.sh classifies untracked files as "disposable untracked scratch" (line 44) and counts only tracked edits as WIP.
playbooks/worktree-cleanup.md step 4 pauses only on tracked uncommitted edits (wip:N). Step 5 then runs git worktree remove --force <path>, and when the directory survives on ignored files, rm -rf followed by git worktree prune.
Untracked and ignored files are often the most valuable thing in an agent worktree: run artifacts, evidence directories, local graphs and indexes, .env files, scratch notes. None of these are recoverable from the branch. --force overrides exactly the refusal Git gives to protect them.
Expected: untracked and ignored files count as irreversible loss, like tracked WIP. The playbook pauses on them (or lists them for a decision) and never falls back to --force or rm -rf. A plain git worktree remove that refuses is the correct stop.
Links: playbook, audit script.
We use pstack 0.15.5 unmodified and route cleanup to our own retirement procedure until this changes.
The
worktree-cleanupplaybook andscripts/worktree-audit.sh(pinned at 12d587d) treat untracked and ignored files in a worktree as disposable.scripts/worktree-audit.shclassifies untracked files as "disposable untracked scratch" (line 44) and counts only tracked edits as WIP.playbooks/worktree-cleanup.mdstep 4 pauses only on tracked uncommitted edits (wip:N). Step 5 then runsgit worktree remove --force <path>, and when the directory survives on ignored files,rm -rffollowed bygit worktree prune.Untracked and ignored files are often the most valuable thing in an agent worktree: run artifacts, evidence directories, local graphs and indexes,
.envfiles, scratch notes. None of these are recoverable from the branch.--forceoverrides exactly the refusal Git gives to protect them.Expected: untracked and ignored files count as irreversible loss, like tracked WIP. The playbook pauses on them (or lists them for a decision) and never falls back to
--forceorrm -rf. A plaingit worktree removethat refuses is the correct stop.Links: playbook, audit script.
We use pstack 0.15.5 unmodified and route cleanup to our own retirement procedure until this changes.