Commit 43a7980ee1f0

Vincent Demeester <vincent@sbr.pm>
2026-08-05 12:00:08
chore(agents): unify git worktree location
Worktrees were landing in three different roots depending on which tool created them (lazyworktree, the git_worktree fallback, herdr, or a bare git worktree add in /tmp), making them hard to find and clean up. Declared ~/.local/share/worktrees as the single root in the canonical agent instructions and pointed herdr at it explicitly.
1 parent 4d7ccce
Changed files (2)
dots
agents
config
dots/agents/AGENTS.md
@@ -62,6 +62,16 @@ The test: every changed line should trace directly to the user's request.
 - **NEVER use bare `git push`** - branch tracking can push to unexpected branches
 - **Before pushing, verify the tracking branch** with `git status`
 
+## Worktrees
+
+- **All git worktrees live under `~/.local/share/worktrees/`.** Never create them
+  in `/tmp`, in `$HOME`, or next to the repository.
+- Prefer `lazyworktree` (`lwt`) or the `git_worktree` tool — they already place
+  worktrees in the right root. Only fall back to raw `git worktree add` with an
+  explicit path under `~/.local/share/worktrees/<owner>/<repo>/<branch>`.
+- `herdr worktree create` needs `--path` to honour this; without it herdr falls
+  back to its own `~/.herdr/worktrees` root.
+
 ## Stack Preferences
 
 - **Package managers:** uv for Python (NOT pip)
dots/config/herdr/config.toml
@@ -5,6 +5,9 @@ onboarding = false
 [update]
 version_check = false
 
+[worktrees]
+directory = "~/.local/share/worktrees"
+
 [theme]
 name = "kanagawa"