Skip to content

chore: Ignore Claude Code's local files, keeping the shared settings - #177

Merged
tablackburn merged 1 commit into
mainfrom
chore/ignore-claude-local-files
Aug 26, 2026
Merged

chore: Ignore Claude Code's local files, keeping the shared settings#177
tablackburn merged 1 commit into
mainfrom
chore/ignore-claude-local-files

Conversation

@tablackburn

Copy link
Copy Markdown
Contributor

.claude/settings.local.json is per-developer and .claude/worktrees/ holds transient agent worktrees. Both show up as untracked noise in any clone.

settings.local.json is ignored today only through a global git config on one machine, so every other clone still sees it. This fixes that for everyone.

Why not just .claude/

.claude/settings.json is deliberately tracked#131 added it to pre-approve the github-projects MCP server for all clones. Since gitignore does not untrack files, a blanket .claude/ entry would state an intent the repository does not follow, and would mislead the next person who reads it.

.claude/*
!.claude/settings.json

This ignores the directory's contents, re-includes the one file that is shared on purpose, and covers anything Claude Code drops in there in future without needing another edit.

Verified

settings.json tracked and NOT ignored: ok
settings.local.json ignored by repo:   ok    (checked with core.excludesfile disabled)
worktrees ignored:                     ok
untracked noise remaining:             (none)

The settings.local.json check was run with the global excludesfile disabled, so it proves the repository's own rule works rather than the machine's.

.claude/settings.local.json is per-developer and .claude/worktrees/ holds
transient agent worktrees. Neither belongs in the repository, and both
currently show up as untracked noise in any clone.

settings.local.json is ignored today only through this machine's global
git config, so every other clone still sees it. Putting it here fixes that
for everyone.

Ignoring the whole directory would be wrong: .claude/settings.json is
deliberately tracked -- #131 added it to pre-approve the github-projects
MCP server for all clones -- and gitignore does not untrack files, so a
blanket entry would state an intent the repository does not follow.
Ignoring the contents and re-including that one file says what is
actually meant, and covers anything Claude Code adds there later.

Verified: settings.json stays visible to git, settings.local.json and
worktrees/ are ignored without relying on a global excludesfile, and
git status is clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012AKaM9i6NyMFDcJNeC34h5
Copilot AI lite review requested due to automatic review settings August 26, 2026 19:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown

Test Results

    4 files  ±0    740 suites  ±0   4m 51s ⏱️ -8s
  472 tests ±0    470 ✅ ±0   2 💤 ±0  0 ❌ ±0 
1 892 runs  ±0  1 831 ✅ ±0  61 💤 ±0  0 ❌ ±0 

Results for commit 0e4e4c7. ± Comparison against base commit 9177803.

@tablackburn
tablackburn merged commit f89997f into main Aug 26, 2026
9 checks passed
@tablackburn
tablackburn deleted the chore/ignore-claude-local-files branch August 26, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants