I did not see this one coming: the little “Yes, and don’t ask again” option in Claude Code has been writing full commands, passwords included, into a file that plenty of people then pushed to public GitHub repos. Security firm Apiiro counted 1,122 of them.
What actually happens
When Claude Code wants to run a shell command and you pick “Yes, and don’t ask again”, it saves a permission rule in .claude/settings.local.json in your project. The catch is that the rule can contain the whole command as you approved it. If that command had a password or API key typed inline, the secret now sits in plain text in a file in your repo.
Apiiro looked at 104,185 public copies of that file and found a real secret in 1,122 of them, 1,379 distinct secrets in all. Add git history, the shared settings.json and agent transcripts, and their total goes up to 2,539 secrets in 1,994 public repositories. They also looked at 16 coding agents, and say Claude Code was the only one that stores the full approved command in a project file by default.
Why the gitignore did not save people
The file is supposed to be gitignored, but as far as I can tell from the write-ups that only happens when Claude Code creates it in a fresh repository. Clone or fork a project, or add it to a repo that already exists, and nothing protects it. That is exactly how files like this end up on GitHub: a git add . published the password.
What I would do
Some caveats first. Apiiro did all the counting itself and sells security tooling for coding agents, and I could not find anyone repeating the numbers. They also did not test whether the secrets still work. Even so, the mechanism is easy to understand and cheap to check.
My list would be short: search your own repos for that file (git ls-files | grep settings.local.json), add .claude/settings.local.json to your .gitignore, rotate any secret you find (removing the file is not enough, it stays in history), and keep passwords in environment variables or a secrets manager instead of inline in commands.
The funny part is that the option is literally meant to save you a click. It was saving the secret too.
Further reading
- Apiiro: Coding agents leaking secrets on GitHub (“Don’t Ask Again”)
- DEV Community: Claude Code’s ‘Don’t Ask Again’ saved secrets in 1,122 public files
- Aviatrix: Claude Code ‘Don’t Ask Again’ bug exposes 1,122 GitHub credential files
- On this site: Claude Code on your own VM: MacBook for the conversation, Unraid for the work
- On this site: ask Claude Code a /btw question and keep your context clean
