.claude/worktrees/* pool: worktree slot appears reused/reset while a session is still active, causing mass file loss mid-session
A .claude/worktrees/<name> directory (created via Agent(isolation: "worktree")) had ~5,900 tracked files vanish mid-session — confirmed via git status --short showing thousands of unstaged deletions (.githooks/*, most of tools/*, .gemini/commands/*, .cursor/rules/*) — while the session was actively editing and had run no destructive command itself (no rm, git clean, or git checkout prior to discovery).
Investigation of the host's own repo-side reaper/cleanup tooling (source + audit logs) ruled out every JPOAIS-side candidate: the two worktree-reaping tools in this repo both classified the worktree as keep:active/never touched it, per their own audit logs.
The real signal is in git reflog for that worktree directory: it shows the slot cycling through at least three unrelated branches within one day, including a reset: moving to origin/main, ending in a detached HEAD on a commit unrelated to the session that reported the incident — strong evidence the physical directory was reassigned/reset for a different task while the original session was still using it.
This appears to be a repeat of a similar incident from 2026-08-14 (a different worktree, amazing-colden-f035e5, destroyed mid-session under a freshly-dispatched subagent), which our own tooling added a liveness guard for — but that guard only protects our repo's own reaper from removing a worktree; it has no visibility into whatever inside the harness recycles/resets .claude/worktrees/* pool slots for new dispatches.
Happy to share full reflog/log evidence on request.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗