Add Claude Code's local settings to gitignore - #787
Open
purinkle wants to merge 1 commit into
Open
Conversation
Claude Code is a coding tool. It writes a file called `.claude/settings.local.json` into whatever project you run it in. That file holds settings for one person on one machine. It records which commands that person has let the tool run, and where things live on their disk. Nobody else needs it. Today the file shows up as a new file in `git status` in every project where the tool has been used. That makes it easy to add to a commit by mistake. In a client project, one person's settings would then be shared with the whole team. The pattern goes in the shared `gitignore` file. The `gitconfig` file already points git at it for every project on the machine, so one line here covers them all. It starts working as soon as `rcup` runs. The rest of the `.claude` folder is left alone. Files a team does want to share, such as `settings.json` and `CLAUDE.md`, stay tracked. That split is why the local file has `.local` in its name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
purinkle
added a commit
that referenced
this pull request
Aug 18, 2026
Claude Code keeps notes to itself while it runs. It puts them in a `.claude` folder inside whatever project it is working in. The notes track things like which jobs are waiting, which helpers are running, and where its spare copies of the project sit. They belong to one run on one machine, so they mean nothing to anyone else. Nothing in this repo covers these names yet. A sweep of one developer's projects found two of them sitting untracked. That is not many, but the cost of missing one is a commit full of somebody else's local state. The names come from watching what the tool writes, not from a manual, so a later version of the tool may rename them. If that happens these lines do no harm, because git quietly skips a pattern that matches nothing. The `settings.local.json` file is covered on its own in #787. That one is written up in the tool's manual and turns up far more often, so it is worth keeping the two changes apart. Co-Authored-By: Claude Opus 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.
Claude Code is a coding tool. It writes a file called
.claude/settings.local.jsoninto whatever project you run it in. Thatfile holds settings for one person on one machine. It records which
commands that person has let the tool run, and where things live on
their disk. Nobody else needs it.
Today the file shows up as a new file in
git statusin every projectwhere the tool has been used. That makes it easy to add to a commit by
mistake. In a client project, one person's settings would then be
shared with the whole team.
The pattern goes in the shared
gitignorefile. Thegitconfigfilealready points git at it for every project on the machine, so one line
here covers them all. It starts working as soon as
rcupruns.The rest of the
.claudefolder is left alone. Files a team does wantto share, such as
settings.jsonandCLAUDE.md, stay tracked. Thatsplit is why the local file has
.localin its name.Co-Authored-By: Claude Opus 5 noreply@anthropic.com