ai-coding-minesIndexGitHub

Setting vanished on every device after a "local cleanup" git rm

Claude Code and agents

Symptom

An agent ran git rm on an editor's settings directory, "cleaning up local settings." From the next pull, the setting (a graph-view colour palette, say) was gone on every device.

Cause

The file was a deliberately tracked shared setting, whitelisted through a ! exception in .gitignore. The rest of the directory was untracked, so the one whitelisted file went unnoticed, and the folk rule "editor settings are local" justified the git rm. Deleting a tracked file travels with the commit. It is not a local cleanup, it is a delete on every machine.

Fix

Check tracking intent before deleting.

A whitelisted file does not get deleted. To change the value, edit the file and commit. The rest of the directory's untracked files stay untracked, which is correct.

Verify

Before committing a deletion, list it with git diff --cached --diff-filter=D --name-only and run git check-ignore -v on each path. No ! match may appear.

A tracked file is one somebody decided to track. A whitelist entry is a decision, not an accident.