Claude Code silently modifies global git settings without your approval

meta, announcements

I recently switched to Claude Code. So far, I'm enjoying it, and am excited to use it more. But I discovered something concerning.

Claude Code modified my .config/git/* folder without explicitly asking for my permission to do so. Not its own config, but my global user config for git. It created a brand new .config/git/ignore and then populated it with **/.claude/settings.local.json.

$ cat ~/.config/git/ignore 
**/.claude/settings.local.json
# ^ I wasn't informed of this!

I only found a single Reddit post about it, from 10 months ago. Where I would have expected at least annoyance and some frustration, I found zero comments at all.

This behaviour should be generally frowned upon. A CLI tool silently reaching outside its own project directory to mutate global user configuration violates the principle of least surprise: I invoked the tool to do work in this repo, not to have it edit files that affect every other repo on my machine. It's also invisible: there's no prompt, no warning, no log line pointing at what changed or where. The side effect only surfaces later, when you're debugging why a file isn't being tracked and have to go hunting for the culprit across config locations you didn't touch.

It would have been slightly better if it modified my project-local .gitignore. At least then the change would live inside the repo it applies to, show up in git status, and be obvious during review. Better still would be the tool simply asking, or printing what it's about to do and letting me decline. Silent global mutation is the worst of the available options.