Claude Code "Don't Ask Again" Leak: Check Your Repos Now
If you use Claude Code, there's a small file in your project you should look at today. Security researchers found passwords and API keys sitting in public GitHub repos because of it, and in many cases the owners had no idea.
What happened
On November 6, the security company Apiiro shared research on a file called .claude/settings.local.json. According to The Hacker News, it found 1,122 public copies of that file on GitHub holding at least one secret, with 1,379 different secrets in total.
Here's how it happens. Claude Code asks before it runs most shell commands. If you pick "Yes, and don't ask again," it saves an allow rule in that file so the same command runs without asking next time. Sometimes the rule is a pattern, like npm test. Sometimes it's the exact command you approved. If that command had a password or token typed into it, the secret gets saved too, in plain text.
Claude Code does try to keep the file out of git, but only through your own computer's global git settings. It doesn't add the file to the project's .gitignore, so a teammate's machine, a fresh laptop, or an old commit can still push it. The researchers found that in 539 of 1,105 repos they traced, a commit listing Claude as a co-author had changed the file.
Why it matters
These weren't harmless test keys. The Hacker News reports that more than a third of the secrets open a database directly, including 379 database passwords, plus 43 SSH logins, 42 GitHub, GitLab and npm tokens, and 23 AWS keys. One company the researchers contacted confirmed its key had been live.
Deleting the file doesn't fix it. Old versions stay in git history and in forks. The researchers found 734 more secrets in older versions of the file, and 211 forks carrying the same secrets as the originals.
Common secret scanners also miss a lot of these. Gitleaks flagged 564 of the 1,122 files and TruffleHog flagged 643. A password after something like mysql -p just looks like an ordinary word in a command line.
The SANS Internet Storm Center also said its honeypots saw new requests for the .claude folder this weekend, so people are already looking for these files.
What to do now
If you or anyone on your team uses Claude Code, here's what the researchers recommend, in this order:
- Search your GitHub account or organization for .claude/settings.local.json and .claude/settings.json, and check git history too, even where the file is gone now.
- Rotate first. Change every password, token and key those files have ever held before you clean anything up.
- Stop tracking the file with git rm --cached .claude/settings.local.json, and add it to the project's own .gitignore.
- Open the file on your own computer, even if it was never committed, and delete any rule that contains a secret.
- Keep secrets out of commands. Use a variable like $DB_URL from your secrets manager, so the saved rule only holds the name.
- Approve patterns, like Bash(npm run:*), instead of single exact commands.
The same idea applies to other AI tool folders, like .cursor/ or .gemini/. Treat them like a .env file: assume they might hold something private, and keep them out of your repo and your secret scanning blind spots.
My take
AI coding tools save a lot of time, and I use them every day. But "don't ask again" is an easy button to press when you're moving fast, and this is a good reminder that convenience settings get saved somewhere. Spend ten minutes today checking your repos. If you find a secret, rotate it first and ask questions later.