Skip to content

fix(using-git-worktrees): auto-create .worktrees/ instead of global fallback#1092

Open
RaviTharuma wants to merge 1 commit intoobra:mainfrom
RaviTharuma:fix/worktree-auto-create-local
Open

fix(using-git-worktrees): auto-create .worktrees/ instead of global fallback#1092
RaviTharuma wants to merge 1 commit intoobra:mainfrom
RaviTharuma:fix/worktree-auto-create-local

Conversation

@RaviTharuma
Copy link
Copy Markdown

Summary

  • Remove ~/.config/superpowers/worktrees/ as global fallback directory
  • When no .worktrees/ or worktrees/ exists, auto-create .worktrees/ in the project root
  • Ensure the directory is gitignored before proceeding
  • Update Quick Reference, Common Mistakes, and Red Flags sections accordingly

Problem

In autonomous modes (autopilot, subagent-driven-development, ralph), agents don't ask the user where to create worktrees — they silently pick the global fallback ~/.config/superpowers/worktrees/<project>/. This causes:

  1. 1GB+ of worktrees accumulating in a config directory
  2. Code changes, tests, and builds running inside ~/.config/
  3. Confusing file layout — code modifications buried in a config folder

Solution

Always keep worktrees local to the project. If .worktrees/ doesn't exist, create it automatically instead of falling back to a global directory. This is safe because:

  • .worktrees/ is a common convention (hidden directory, like .git)
  • The skill already verifies gitignore status and adds the entry if missing
  • Project-local worktrees are easier to discover, manage, and clean up

Fixes #1091

…allback

Remove ~/.config/superpowers/worktrees/ as fallback directory.
When no .worktrees/ or worktrees/ exists, auto-create .worktrees/
in the project root and ensure it's gitignored.

In autonomous modes (autopilot, subagent-driven-development),
agents don't ask the user — they silently pick the global fallback,
causing worktrees to accumulate in ~/.config/ (1GB+ for a few branches)
with code changes happening in unexpected locations.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

using-git-worktrees: global fallback creates worktrees in ~/.config/superpowers/ — should auto-create .worktrees/ instead

1 participant