chore: ignore agent scratch worktrees - #201
Closed
cosmin-staicu wants to merge 1 commit into
Closed
cosmin-staicu wants to merge 1 commit into
cosmin-staicu wants to merge 1 commit into
Conversation
Sessions place throwaway checkouts under .claude/worktrees/, and nothing ignored them, so `git add -A` from the repository root picks one up as an embedded git repository and commits a gitlink to it. Scoped to that directory rather than .claude/, because .claude/commands/cla-add-signer.md is tracked on purpose. Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
cosmin-staicu
requested review from
alinahornet,
cosminvlad,
litheon,
lucianaparaschivei and
razvalex
as code owners
September 22, 2026 05:51
Member
Author
|
Folded into #202, which carries the same |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Why
Agent sessions place throwaway checkouts under
.claude/worktrees/. Nothing ignored them, so agit add -Afrom the repository root picks one up as an embedded git repository and commits a gitlink — a160000entry pointing at a path that exists on one machine and nowhere else. It happened on #196 and had to be backed out.What
One entry:
Scoped to that directory rather than
.claude/, because.claude/commands/cla-add-signer.mdis tracked on purpose — it is the maintainer command added in #52 for recording contributors insignatures/cla.json. Ignoring the parent would shadow it..claude/settings.local.jsonneeds nothing here; it is already covered by a global ignore.Verification
git statusno longer reports?? .claude/worktrees/with a worktree present, andgit check-ignore -v .claude/worktrees/resolves to this rule. Nothing else changes.Contributor declaration
git commit -s).