From 6dd8808ff57c0d4e77c16be4ec0acef4bb6b0716 Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Mon, 31 Aug 2026 05:16:13 +0000 Subject: [PATCH] chore: ignore .claude/worktrees/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nothing under .claude/ is tracked, but it was not ignored either, so the three worktrees currently under .claude/worktrees/ show as untracked directories in `git status` on main — each one a full second copy of the repository. That is noise until it isn't. `git worktree add` with a relative path creates the new checkout inside whichever worktree is current rather than beside it, which is what happened here: a worktree meant for a sibling directory landed at .claude/worktrees//.claude/worktrees/, untracked content sitting on a branch with an open PR, one `git add -A` away from being committed. Only worktrees/ is ignored. Anything else under .claude/ stays visible so settings, agents or skills can be tracked deliberately if that is ever wanted. Verified the rule matches .claude/worktrees/ and not .claude/agents/, and that `git ls-files -ci --exclude-standard` reports nothing — no tracked file is shadowed by this. Co-Authored-By: Claude Opus 5 --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 9bd7756..18c2413 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,14 @@ __pycache__/ *.bak *.orig +# Claude Code worktrees. `git worktree add` with a relative path creates the +# new checkout inside whichever worktree is current, so without this an entire +# second copy of the repository — carrying its own .claude/worktrees/ — becomes +# untracked content on the branch being worked on, waiting for the next +# `git add -A`. Only worktrees/ is ignored: anything else under .claude/ stays +# visible, so settings or agents can be tracked deliberately if that is wanted. +.claude/worktrees/ + # ---- Large local artifacts never meant for git ---- ISOs/ software/