Claude Code's “don't ask again” can save your passwords. Check your repo

“Yes, and don't ask again” saves the exact command, passwords included. Apiiro found secrets in 1,122 public copies of that file on GitHub. How to check your project and fix it.

Security · By Wael ·

Made with our content engine: AI script and voice, reviewed by a person before posting. The password in the terminal is an example.

When Claude Code asks permission to run a command and you pick “Yes, and don't ask again”, it saves that exact command as an allow rule in your project's .claude/settings.local.json file. If the command had a password typed into it, the password is saved too.

What the research found

Security firm Apiiro checked 104,185 public copies of that file on GitHub and found secrets in 1,122 of them (summarised on dev.to):

  • 379 database passwords
  • 43 SSH logins
  • 42 GitHub, GitLab and npm tokens
  • 23 AWS keys
  • and 734 more secrets still in git history across 509 repositories, where the file had been deleted but the history kept it

Two things worth knowing: Apiiro sells security products, and it didn't test whether the secrets still work.

Why Claude Code's protection isn't enough

Claude Code's settings docs say it adds the file to your global git excludes the first time it writes it, and that if you create the file by hand, you should add it to .gitignore yourself. Global excludes live on one machine. They don't protect a teammate's copy, a server, or a file that was already committed.

Check your project

Run these in the project folder:

# Is the file tracked now?
git ls-files .claude/settings.local.json

# Was it ever committed?
git log --all --oneline -- .claude/settings.local.json

# If so, stop tracking it and ignore it
git rm --cached .claude/settings.local.json
echo ".claude/settings.local.json" >> .gitignore

If either of the first two commands prints anything, change every password, token and key the file ever held. Deleting the file, or untracking it, doesn't remove it from your git history. From then on, keep secrets in environment variables rather than typing them into commands.

Had your app built by someone else, or by an AI? Ask them to run this check, or get us to look over it.

Video transcript

Your AI coding tool might be leaking your passwords. Hit “Yes, and don't ask again” in Claude Code, and it saves the exact command, password and all, inside your project.

Security firm Apiiro found secrets in 1,122 public copies of that file on GitHub. Database passwords, AWS keys, server logins.

Claude Code does try to keep that file out of git. But only on your own laptop.

So check your repo. If the file's in there, ignore it, and change every password it ever held, because deleting it won't clear your history.

Paid someone, or an AI, to build your app? Comment LEAK, and we'll send you a free prompt to check it.