When you hit “Yes, and don’t ask again” in Claude Code, it can save the exact command you approved to .claude/settings.local.json. That includes any password or token you typed into it. Apiiro found 1,122 public copies of that file with at least one secret, The Hacker News reports. One company confirmed its leaked key was live.
Why it slips out
Claude Code adds the file to your global git excludes on that one machine, not to the project’s .gitignore. So it doesn’t follow the repo to another clone or another machine. Common scanners missed a lot of them too: gitleaks caught 564, TruffleHog 643, and 215 slipped past both.
What to do
- Search your repos and git history for
.claude/settings.local.jsonand.claude/settings.json - Rotate every secret those files ever held first, then clean up
- Stop typing secrets on the command line. Use env vars or a secrets manager
My take
Convenience features that write secrets to disk in plain text need garlic. Add the file to every project’s .gitignore today.
God Bless, and Needs Garlic!