TODO: Migrate worktree location to /tmp
TODO: Migrate worktree location to /tmp
Move all Claude agent worktree operations from repo-local directories to
/tmp. Worktrees are session-scoped (10+ PRs/day), so persisting them in the repo tree creates stale accumulation and wastes tokens when agents encounter outdated state.Changes Needed
1. Update worktree-workflow SOP
Specify
/tmp/claude-worktrees/[repo]/[branch] as the canonical worktree location. Remove any references to .claude/worktrees/ or .worktrees/ as worktree roots.2. Update claude-custom hooks/config
Audit
claude-custom repo for any hooks or config that reference .claude/worktrees/ or .worktrees/ and update paths to /tmp/claude-worktrees/.3. Add post-merge freshness step
Add a post-merge hook or SOP step: after PR merge, run
git fetch origin + git pull in ~/[repo] to keep local main current. This prevents new worktrees from branching off stale commits.4. Clean up existing stale worktrees
One-time sweep: remove any existing stale worktrees in
.claude/worktrees/ and .worktrees/ across all repos. Verify no active sessions depend on them before cleanup.5. Reconcile related TODOs
Review and likely supersede:
todo-worktree-staleness-prevention— may be fully addressed by the /tmp migration + post-merge freshness steptodo-worktree-cleanup— may be fully addressed by the /tmp migration (auto-clean on reboot)
Related
phase-postgres-epilogue-cleanup— parent phaseworktree-workflow— SOP to updatesop-claude-config-development— config conventions to updatetodo-worktree-staleness-prevention— likely supersededtodo-worktree-cleanup— likely superseded