A slash makes a gitignore rule local

Four session transcripts reached main, one of them 103 KB inside a feat(cc)! PR. Nothing was misconfigured; the rules were written the way most people write them.

The rule that did not travel

A pattern containing a slash is anchored to the directory holding the .gitignore. Pick a path to see whether the root-anchored rule reaches it.

path

What was tracked, and why it survived

PathSizeLanded in
docs/feat--opus5-cc220-adoption/.claude/memory/sessions/<uuid>/events.jsonl103 KB#3141
src/hooks/src/pretool/bash/.claude/memory/sessions/<uuid>/events.jsonl--
src/mcp-server/.claude/memory/sessions/<uuid>/events.jsonl (x2)--

**/.claude/memory/ was added later and does cover this going forward. But .gitignore never untracks retroactively, so a file already in the index stays there no matter how well the rule is written afterwards.

The fix, and the part deliberately left alone

+ **/.claude/state/
+ **/.claude/telemetry/

Verified inert for existing files: 0 tracked under a nested state/ or telemetry/ today, so these stop new writes and disturb nothing.

Not extended to orchestration/, coordination/ or agent-memory/. src/hooks holds 18 real test fixtures under .claude/orchestration/, and project-scope .claude/agent-memory/ is tracked on purpose. A blanket rule there would silently swallow a legitimate addition, which is worse than the bug being fixed because nothing surfaces at git add time.

Two probes that lied on the way here

Found by a peer session hitting the identical anchoring bug in another repo.