From 0e384a425bea6c31e4cf0cc3f80f65ae51740d4c Mon Sep 17 00:00:00 2001 From: Baptiste Parmantier Date: Sun, 27 Sep 2026 13:01:43 +0200 Subject: [PATCH] chore: keep agent worktrees out of the repository MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A subagent launched with worktree isolation gets a full checkout under `.claude/worktrees/agent-/`, and the directory survives the agent. Four of them appeared during one session's work and showed up as untracked content — each one a complete copy of the tree, including its own `target/`, so committing one by accident would be spectacular. `.claude/` cannot be ignored wholesale: `.claude/skills/` is tracked and is where this repo's own skills live. Only the worktree directory is excluded. A removed worktree also leaves its branch checked out until `git worktree prune` runs, which is what makes that branch impossible to check out from the main copy with the unhelpful `fatal: '' is already used by worktree at …`. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7d8d7f80..8f598626 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .DS_Store docs/ .claude/*.local.md +.claude/worktrees/