One Pager · Security ·
Is Your Agent Leaking Your Keys?

Don't Ask Again

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.

The Two Links

In a hurry? Do The Check. If anything turns up, go straight to Rotate.

1,122
Public Files With Secrets
1,379
Secrets Inside Them
215
Missed By Both Scanners
Found One?

Rotate It. Then Get Back To Selling.

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.

The Solo Founder Lab · Opening Soon

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.

Lab.exeWaitlist Open

Ship Safe. Then Sell.

  • Live product teardowns. Your app, your landing page and your pricing, reviewed in front of everyone.
  • Weekly CTO office hours. Live, hot-seat style. Bring the setup you're not sure is safe.
  • Launch Pad. When you launch, the room shows up.
  • The 30-Day Launch Plan. Validate, plan, build and launch, one week at a time. Members only.

Free to join the waitlist. Opens at $49/mo, and the price goes up as seats fill, so first in pays the least.

The File

One File Remembers Every Command You Approved

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.

Where
your-project/.claude/settings.local.json, next to .claude/settings.json. The folder starts with a dot, so plain ls won't show it.
Meant for
You, on this machine, and nobody else. The shared settings.json is meant to be committed, and 298 public copies of that one had secrets too.
Why it leaks
Claude Code hides the file with your global git excludes, on your laptop only. It never adds it to the project's own .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.
What leaked
379 database passwords, 43 SSH logins for public servers, 42 GitHub, GitLab and npm tokens, 23 AWS keys, plus AI model keys and a few private keys. One company the researchers contacted confirmed its key was still live.
settings.local.json✣
What A Leak Looks Like
{
  "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.

The Check

Six Checks, About Five Minutes

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.

01 · Is It There?Local

Look in the hidden folder.

If you've ever clicked "don't ask again," it's probably there.

ls -la .claude/
02 · What's In It?Local

Open it and read every rule.

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
PGPASSWORD=mysql -psshpass -pBeareruser:pass@hostsk-ghp_AKIA
03 · Is Git Tracking It?Repo

Any output means it's in the repo.

If settings.local.json shows up here, every push sent it to GitHub.

git ls-files .claude/
04 · Was It Ever Committed?History

Check every version, not just today's.

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'
05 · Every Repo On GitHubOrg

Search all your repos at once.

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
06 · Everywhere ElseLocal

It doesn't have to reach GitHub to leak.

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
Stop Tracking It

One Line In Your .gitignore

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.

Untrack.sh
# 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
Clean The File Too

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.

Don't Ignore All Of .claude/

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.

Next Time

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.

Rotate

Assume It's Already Out

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.

01

List every secret the file ever held. Use the history check in 04, not just today's file.

02

Make a new one. Put it in your app's environment variables and redeploy, so nothing breaks.

03

Kill the old one. Revoke, delete or change it. Don't just stop using it.

04

Check the logs. Look for anything you don't recognize since the day it was first committed.

Secret
Rotate It
Then Check
Database password
Change it in your host's dashboard (Supabase, Neon, RDS) or run ALTER USER app WITH PASSWORD '...'. Update DATABASE_URL everywhere it lives.
Connection logs, new users and roles, tables you didn't touch.
AI model API key
Anthropic, OpenAI or Google console, then API keys: create a new key, swap it in, delete the old one.
Usage and billing for spikes you didn't cause.
GitHub or GitLab token
GitHub: Settings, Developer settings, Personal access tokens. GitLab: Preferences, Access tokens. Revoke it and make a new one with fewer scopes.
The security log, new deploy keys and SSH keys, commits you didn't push.
npm token
npm token list, then npm token revoke <id>. Make a new granular token.
Package versions you didn't publish.
AWS access key
IAM, Users, Security credentials: create a new key, deploy it, deactivate the old one, then delete it.
CloudTrail, servers running in regions you don't use, the bill.
SSH login
Change the password, switch to SSH keys and set PasswordAuthentication no.
last, /var/log/auth.log and ~/.ssh/authorized_keys for keys you didn't add.
Private key
Make a new key pair. Swap the public key in everywhere the old one was trusted, then remove the old one.
Logins and signatures made with the old key.
Any other service key
Most dashboards have a button for it. Stripe calls it "Roll key."
The service's API request log.
Full Audit

Then Run The Big One

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.

1 · Install
npx skills add https://github.com/cloudflare/security-audit-skill \
  --skill security-audit
2 · The Prompt
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.
Not On Every Commit

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.

Run It Twice

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.

Give It A Sandbox

It only runs your code inside a sandbox with no network. Without one, it marks those leads "needs validation" instead of guessing.

It Doesn't Rotate Keys

If a key was ever public, rotate it, whatever the report says.

One More Thing

Tools Are The Easy Part.

Anybody can build software now. Not everybody can build a business.

The Solo Founder Lab

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.

Lab.exe✣

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 ▶