chore: Ignore Claude Code's local files, keeping the shared settings - #177
Merged
Conversation
.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
There was a problem hiding this comment.
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.
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.
.claude/settings.local.jsonis per-developer and.claude/worktrees/holds transient agent worktrees. Both show up as untracked noise in any clone.settings.local.jsonis 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.jsonis deliberately tracked — #131 added it to pre-approve thegithub-projectsMCP 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.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
The
settings.local.jsoncheck was run with the global excludesfile disabled, so it proves the repository's own rule works rather than the machine's.