Narrow /.agent* gitignore pattern to stop matching .AGENTS/ on Windows - #74
Merged
Merged
Conversation
…/ on Windows core.ignorecase=true on Windows folds "/.agent*" onto the tracked .AGENTS/ memory directory (case-insensitive prefix + wildcard suffix match), causing `git add .AGENTS/memory/*.md` to silently refuse without -f. Narrow the pattern to the actual .agent-<id> naming convention and add a defensive negation for good measure. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Problem
On Windows, git runs with
core.ignorecase=true..gitignoreline 38'spattern
/.agent*(intended to ignore per-agent build library dirs like.agent-<id>/, per AGENTS.md's tarball build recipe) case-folds and matchesthe tracked
.AGENTS/directory too — the repo's own agent memory files(
.AGENTS/memory/architecture.md, etc.).Symptom: editing any
.AGENTS/memory/*.mdfile on Windows leaves it showingas modified in
git status, butgit add .AGENTS/memory/<file>.mdrefuseswith "The following paths are ignored by one of your .gitignore files".
git add -fworks around it, but agents hitting this may silently skip therequired memory update (AGENTS.md's standing instruction) instead of
force-adding — a lost-documentation failure mode. Confusingly,
git check-ignore -v .AGENTSreturns nothing (exit 1), disagreeing withgit add's refusal.Fix
/.agent*to/.agent-*, matching the actual.agent-<id>namingconvention used everywhere in AGENTS.md and
dev/benchmarks/*.R(greppedthe whole repo — every real usage includes the hyphen).
!/.AGENTS/negation immediately after, so a futurereversion to a broader pattern can't reintroduce the collision silently.
/.ab-*(line 40, paired A/B benchmarklibraries) for the same class of problem: no tracked path starts with
.ab(case-insensitive), so it's not currently affected. Left as-is.Test plan
git check-ignore -v .AGENTS— still nothing (exit 1), consistent with before.AGENTS/memory/architecture.md, ran baregit add .AGENTS/memory/architecture.md— succeeds without-f.agent-test/dir — still reported ignored bygit check-ignore -vand absent fromgit status.ab-testlib/dir — still ignored (line 40 unaffected).agent<letters>without a hyphen — none found; all real usages are.agent-<id>/.agent-<name>🤖 Generated with Claude Code