Skip to content

pstack: worktree-cleanup treats untracked and ignored files as disposable (--force, rm -rf) #449

Description

@YURDAKULOGLU

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions