What happened
On 3 November a live run of a worktree cleanup script (DRY_RUN=0 ~/.claude/scripts/wt-sweep.sh) removed 400 linked worktrees across 65 repositories, one of them in use by a coding session that was still running. The session noticed its own directory had gone mid-task.
Why it happened
The script spared a worktree only if its top directory had changed in the last 120 minutes or a running process had its working directory inside it. The session had entered the worktree and gone idle, and its job record named the main checkout, so neither check saw it.
git status --porcelain never lists ignored files, so a worktree whose only unshipped work sat in an ignored deliverables folder counted as clean and went to worktree remove --force.
How it ended
The worktree in use was restored from its branch. A transcript audit found at least 168 files written to ignored paths in the removed worktrees. It rebuilt 126 of them, among other ways by replaying each session’s recorded writes and edits in order, found surviving copies of 18 and could not recover 20. None of the files written with a heredoc came back.
A fix merged on 4 November: the sweep now holds any worktree a session is using and copies ignored deliverables out before removing anything.







