If you've ever told Claude Code "don't ask again," you might be leaking your passwords. It saves the command you approved to a file in your project, and if that command had a password or an API key in it, the secret gets saved too, in plain text. Researchers just found 1,122 of those files on public GitHub with secrets inside.
This is an afternoon, not a crisis. Check the file, rotate what leaked, add one line to .gitignore. Turning it into a month-long security rewrite of an app nobody pays for yet is Building Theater.
I'm building a place where you learn to build products that work like a real company's on your own, and get them in front of people who pay, with a CTO who's built two seven-figure software companies in your corner.
Ship Safe. Then Sell.
Free to join the waitlist. Opens at $49/mo, and the price goes up as seats fill, so first in pays the least.
When Claude Code asks to run a command and you pick "Yes, and don't ask again," it writes an allow rule to .claude/settings.local.json. Sometimes the rule is a pattern, like npm test *. Sometimes it's the exact command you approved. If that command had a password in it, the password is in the file now.
your-project/.claude/settings.local.json, next to .claude/settings.json. The folder starts with a dot, so plain ls won't show it.settings.json is meant to be committed, and 298 public copies of that one had secrets too..gitignore, so a teammate, a new laptop or a CI box doesn't get that protection. In 539 of the 1,105 repos Apiiro traced, a commit co-authored by Claude changed the file.{
"permissions": {
"allow": [
"Bash(npm run test:*)",
"Bash(git status)",
"Bash(PGPASSWORD=hunter2 psql -h db.acme.io -U admin)",
"Bash(sshpass -p 'S3rver!' ssh root@203.0.113.7)",
"Bash(curl -H 'x-api-key: sk-ant-api03-EXAMPLE' ...)"
]
}
}
Pink lines are leaks. The first two rules are fine: one's a pattern and one has nothing secret in it. Every secret here is made up.
Deleting the file doesn't fix it either. Git keeps every old version, and Apiiro found 734 more secrets in old versions that were gone from today's files.
Run these from the root of every project you've used Claude Code in. Read the file with your own eyes. Secret scanners missed 215 of the 1,122 files, mostly passwords typed inside a command.
If you've ever clicked "don't ask again," it's probably there.
ls -la .claude/
Then search both settings files for the usual suspects. A short file is quicker to read than to search.
cat .claude/settings.local.json grep -niE 'pass|secret|token|bearer|api.?key|sk-|ghp_|glpat-|npm_|AKIA|PRIVATE KEY|://[^ ]*:[^ ]*@' \ .claude/settings*.json
If settings.local.json shows up here, every push sent it to GitHub.
git ls-files .claude/
The second command prints every old version of both files and searches them. Anything it finds counts, even if you deleted it months ago.
git log --all --oneline -- .claude/ git log --all -p -- .claude/settings.local.json .claude/settings.json \ | grep -niE 'pass|secret|token|bearer|api.?key|sk-|ghp_|AKIA'
Paste this into GitHub search and swap in your username or org. Check forks too: 211 forks of 74 repos carried the same secrets.
path:.claude/settings.local.json user:your-username path:.claude/settings.json org:your-org
The file rides along in npm packages, Docker images, zip files and synced folders. Treat .claude/, .cursor/, .gemini/ and .specstory/ like .env files.
# Will it ship in your npm package?
npm pack --dry-run | grep .claude
Ignore the file in the project itself, so the protection travels with the repo instead of living on one laptop. If you found a secret, rotate it first. This step stops the next leak. It doesn't undo the last one.
# 1. Stop tracking it. Your local copy stays put. git rm --cached .claude/settings.local.json # 2. Ignore it in this repo, so it travels with the project echo ".claude/settings.local.json" >> .gitignore # 3. Commit and push git add .gitignore git commit -m "Stop tracking Claude Code local settings" git push # 4. Check it worked. It should print the .gitignore line. git check-ignore -v .claude/settings.local.json
Even if it was never committed, open settings.local.json and delete every rule with a secret in it. It's plain JSON, or run /permissions inside Claude Code.
The shared settings.json, commands and skills in there are meant to be committed. Ignore the one local file. Then check settings.json has no secrets in it either.
Approve patterns, not exact commands: Bash(npm run:*). Keep secrets in environment variables, so the saved rule says psql "$DATABASE_URL" and never the password.
Once a key has been in a public repo, someone has it. Bots scan GitHub for keys within minutes of a push, and the commit stays in every clone and fork. Deleting the file, the commit or even the repo doesn't take it back. The only fix is to make the old key worthless.
List every secret the file ever held. Use the history check in 04, not just today's file.
Make a new one. Put it in your app's environment variables and redeploy, so nothing breaks.
Kill the old one. Revoke, delete or change it. Don't just stop using it.
Check the logs. Look for anything you don't recognize since the day it was first committed.
ALTER USER app WITH PASSWORD '...'. Update DATABASE_URL everywhere it lives.npm token list, then npm token revoke <id>. Make a new granular token.PasswordAuthentication no.last, /var/log/auth.log and ~/.ssh/authorized_keys for keys you didn't add.Cloudflare open-sourced the security audit skill behind its own vulnerability-hunting setup. It turns your coding agent into an audit team: one agent maps your app, others hunt for holes, and a fresh agent tries to disprove every finding before it reaches the report. Tell it to check your agent settings files while it's in there.
npx skills add https://github.com/cloudflare/security-audit-skill \ --skill security-audit
Security audit this codebase. As part of reconnaissance, check .claude/settings.local.json and .claude/settings.json, both the current files and every version in git history, for passwords, tokens, API keys and connection strings saved inside permission rules. Do the same for .cursor/, .gemini/ and .specstory/. Treat any secret you find there as exposed. List where it appears, which commit added it and what it unlocks, but never print the secret itself in the report.
This is the closest thing to paying someone for a pen test. It's slow and uses a lot of tokens. Run it before real customer data goes in, before launch, and after big changes.
Cloudflare says one run found about half of what repeated runs found. Runs build on each other, so the second one goes after the gaps.
It only runs your code inside a sandbox with no network. Without one, it marks those leads "needs validation" instead of guessing.
If a key was ever public, rotate it, whatever the report says.
Anybody can build software now. Not everybody can build a business.
Reading about tools is a great way to feel busy. The Lab is for Founders who'd rather get customers: weekly office hours with a CTO who's built two seven-figure software companies, and a room of other Founders who care whether anybody buys what you're making.
Less Theater. More Customers.
Want my 30-Day Launch Plan? It's for Lab members only: validate, plan, build and launch, one week at a time.
See The Solo Founder Lab ▶