-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Open
Labels
claude-codeClaude Code (Anthropic CLI) issuesClaude Code (Anthropic CLI) issues
Description
Problem
Worktrees created by using-git-worktrees persist indefinitely in .worktrees/ or ~/.config/superpowers/worktrees/. After a feature branch is merged or discarded, leftover worktree directories can accumulate and consume disk space — especially if the user forgets to run finishing-a-development-branch.
Proposal
Add an option to create worktrees in the OS temporary directory ($TMPDIR or /tmp) so they are automatically cleaned up by the OS (e.g., on reboot or periodic cleanup).
Example path: $TMPDIR/superpowers-worktrees/<project-name>/<branch-name>/
This could be:
- A new option in the directory selection prompt (option 3)
- Configurable via CLAUDE.md (e.g.,
Worktree directory: $TMPDIR/superpowers-worktrees/)
Benefits
- No manual cleanup needed for short-lived feature branches
- No
.gitignoreverification required (outside project) - No disk space accumulation from forgotten worktrees
- Works well with the "use and discard" workflow
Considerations
- OS cleanup timing varies (
$TMPDIRis cleaned more aggressively than/tmpon macOS) - If the OS removes the directory while git still references it,
git worktree pruneis needed to clean stale entries - Long-running feature branches may not be suitable for temp directories
- The skill could warn users about this trade-off during directory selection
Suggested UX
No worktree directory found. Where should I create worktrees?
1. .worktrees/ (project-local, hidden)
2. ~/.config/superpowers/worktrees/<project-name>/ (global, persistent)
3. $TMPDIR/superpowers-worktrees/<project-name>/ (temporary, OS auto-cleanup)
Which would you prefer?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
claude-codeClaude Code (Anthropic CLI) issuesClaude Code (Anthropic CLI) issues