Home › Guides › Claude Code secrets check

Did Claude Code save your password? Check your repo in 2 minutes

TL;DR · 📰 News

Check your repo now

Always-allow rules can save passwords in plain text in .claude/settings.local.json. Paste it in the checker below.

1,122public repos with secrets
2 minto check
4git commands
0fixes shipped (Nov 12)
News guide illustration: abstract glowing code editor windows
Read the full short answer

Short answer: when you pick "Yes, and don't ask again" on a shell command in Claude Code, it saves that command as an allow rule in .claude/settings.local.json. If the command had a password or token in it, the secret is now in that file in plain text. Claude Code keeps the file out of git only through your own computer's global git ignore, not the repo's .gitignore, so it gets committed on a new machine, in a container, or in a folder that became a repo later. Security firm Apiiro found 1,122 public copies on GitHub holding secrets. As of Nov 12, 2026, Claude Code has not shipped a fix. Paste your file into the checker below, then run the four git commands.

Checked Nov 12, 2026 on Claude Code's settings docs, the Claude Code changelog, Ars Technica (Nov 9) and GitLab's guide. Counts are Apiiro's own research (published Nov 5, updated Nov 8). Apiiro sells security tools and did not test whether the secrets still work.

What's going on

  • The save. Claude's docs say that when you choose "Yes, and don't ask again" for a Bash command, "Claude Code saves that approval as an allow rule in .claude/settings.local.json." Sometimes the rule is a pattern like Bash(npm test:*). Sometimes it's the exact command, password and all.
  • The leak. The first time Claude Code writes the file, it adds **/.claude/settings.local.json to your global git excludes. That protects one laptop. It doesn't travel with the repo, it doesn't cover a file that's already tracked, and it doesn't exist on a fresh machine, CI runner or teammate's clone.
  • The numbers (Apiiro). 104,185 public copies of the file across 103,617 repos, collected Nov 1 to 3. 1,122 of them (about 1.1%) held at least one secret, 1,379 distinct secrets, from 63 organizations. More than a third open a database directly. Counting git history and other agent files, Apiiro reports 2,539 secrets in 1,994 repos.
  • Scanners missed a lot. Of the roughly 1,100 files, 215 were caught by neither gitleaks nor TruffleHog. A password after PGPASSWORD= or sshpass -p looks like an ordinary word to a scanner.
  • Deleting the file isn't enough. Old versions in git history held 734 secrets that weren't in any current copy, and forks kept copies after the originals were cleaned.

Free checker: paste your settings.local.json

Interactive

Open .claude/settings.local.json in your project, copy everything, and paste it here. It runs entirely in your browser. Nothing is sent anywhere. It flags allow rules that look like they hold a password, token, key or connection string, and masks what it finds.

What it looks for: private keys, AWS, GitHub, GitLab, npm, Slack, Stripe, Square, OpenAI/Anthropic-style keys, JWTs (Supabase service-role keys are JWTs), passwords in NAME=value prefixes, sshpass -p, mysql -p, --password, curl -u user:pass, user:pass@ in URLs, and auth headers. Values that start with $ (environment variables) are treated as safe. A clean result is not proof: read each rule yourself.

The 4 git commands (run in each repo you push)

1. Is the file tracked right now?

git ls-files | grep -E '(^|/)\.claude/settings(\.local)?\.json$'

2. Was it ever committed, on any branch, in any folder? Any output means it's in your history even if you deleted it.

git log --all --name-only --format= | grep 'settings.local.json' | sort -u

3. Stop tracking it and ignore it in the repo itself (this keeps your local copy):

git rm --cached .claude/settings.local.json
echo ".claude/settings.local.json" >> .gitignore
git add .gitignore && git commit -m "Stop tracking Claude Code local settings"

4. Find every copy on your machine so you can read each allow list:

find ~ -path '*/.claude/settings.local.json' 2>/dev/null

Also look at the shared .claude/settings.json that teams commit on purpose. Apiiro found secrets in 298 of 76,011 public copies of it.

Found a secret? Rotate first, clean up second

  1. Revoke or rotate the credential with whoever issued it (database, AWS, GitHub, Supabase, and so on). This is the step that actually protects you. Start with anything pointing at a public server: database passwords and SSH logins give direct access.
  2. Check the provider's logs for use you don't recognize.
  3. Then untrack and ignore the file with command 3 above.
  4. Scrub history only if you need to. Once a secret is revoked, rewriting history is often unnecessary. If you do, GitHub's guide uses git-filter-repo, and forks keep their own copies, so check those too.
  5. Delete the bad rule from the allow list (or run /permissions in Claude Code) so it doesn't get copied somewhere else.

Stop it happening again

  • Never type a secret into a command Claude runs. Use an environment variable, like psql "$DATABASE_URL", so the saved rule holds $DATABASE_URL, not the password.
  • Pick plain "Yes" when a command has a secret in it. Save "don't ask again" for patterns like Bash(npm run:*).
  • Put .claude/settings.local.json in every repo's .gitignore, and in your repo template, so it travels with the project.
  • Turn on secret scanning and push protection on GitHub or GitLab. Anthropic's Claude Code lead recommended it, and it's free on public GitHub repos. Just remember it misses passwords with no known format.
  • Treat agent folders like .env. Apiiro's advice covers .claude/, .cursor/, .gemini/ and similar folders. We haven't checked how each of those tools stores standing approvals, so review them instead of assuming they're clean.

What Anthropic has said, and what's changed

  • Nov 7: On Hacker News, Claude Code lead Boris Cherny said "Historically Claude Code has not done secret scrubbing" and the team is "looking into what we can do to prevent this," naming auto mode catching it and built-in secret scanning as ideas. He also said the file is gitignored when Claude creates it, so these copies were likely made by hand and checked in.
  • Apiiro's data pushes back on that: in 539 of 1,105 repos it traced, a commit co-authored by Claude changed the file. That doesn't prove Claude pushed every secret.
  • Auto mode isn't a full fix either. When a commenter pointed out sensitive commands can still be saved in auto mode, Cherny called it a "good catch."
  • As of Nov 12, 2026: we found no Claude Code changelog entry that stops secrets from being saved in allow rules. The older bug reports (the first from August 2025) were closed by a bot as inactive. We'll update this page when a fix ships.

FAQ

6 questions

Where is Claude Code's settings.local.json?

In the .claude folder at the root of your git repo: .claude/settings.local.json. If you start Claude Code in a subfolder, it still reads and writes the file at the repository root.

Does "Yes, and don't ask again" save my password?

It can. The approval becomes an allow rule, and when the prompt offered the exact command, the rule is the command text, including any password, token or connection string you typed into it.

Isn't the file gitignored already?

Only on the computer where Claude Code first wrote it, through your global git excludes. The repo's own .gitignore isn't changed, and ignore rules don't apply to a file that's already tracked.

Is it safe to paste my file into the checker?

The checker is plain JavaScript that runs in your browser tab. It doesn't send what you paste anywhere. If you'd rather not paste it at all, open the file and read the allow list yourself, looking for anything after =, -p, : in a URL, or an auth header.

Has Anthropic fixed it?

Not as of Nov 12, 2026. Anthropic said it's looking into it, including built-in secret scanning, but no release we found changes how allow rules are saved.

Do Cursor, Codex or Copilot have the same problem?

This research covered Claude Code. Apiiro advises treating every agent's settings folder like a .env file, and we haven't verified how each tool stores approvals, so check those folders too.

Ship your app: the rest of the stack

Picked your AI coding tool? These are the usual next costs. Free tiers first, and prices checked Oct 20, 2026 on each vendor's pricing page.

Code review

AI writes code fast; something should read it before it ships.

  • CodeRabbitAI review on every pull request, in GitHub or GitLabFree for public repos; Essentials $24/user/mo billed annually ($30 monthly)

Already paying for Copilot or Codex Plus? Both include AI pull request review, so try that first.

Hosting

Where your app lives once it works on your machine.

  • VercelNext.js and front-end appsHobby free (personal, non-commercial); Pro $20/mo per developer seat
  • Netlify referralStatic sites and front ends, unlimited Pro membersFree; Personal $9/mo; Pro $20/mo with unlimited members
  • RailwayBack ends, workers and databases with no server setupFree trial $5 credit; Hobby $5/mo incl. $5 usage; Pro $20/mo
  • RenderHeroku-style web services, cron jobs and PostgresHobby $0 + compute; Pro $25/mo + compute

Database and auth

Most AI-built apps need a Postgres database and logins.

  • SupabasePostgres + auth + storage in one; Lovable and Bolt connect to itFree (2 projects, pause after 1 week idle); Pro from $25/mo
  • NeonServerless Postgres with branching, pay for what you useFree (100 projects); paid plans usage-based

Domain name

A real domain for your app.

  • Cloudflare RegistrarDomains at cost with no markupWholesale price per TLD
  • PorkbunCheap domains with free WHOIS privacyVaries by TLD
  • NamecheapPopular registrar with hosting and email add-onsVaries by TLD

Referral link: we may earn a commission at no extra cost to you. It never changes our picks.

Editorial disclosure

Rankings are not for sale. Sponsored placements and affiliate links are always labeled, and they never change our recommendations, quiz results, prices, or comparison data. Links marked "referral" are affiliate links (Netlify): if you buy through them, we may earn a commission at no extra cost to you. Every other link is a plain link that pays us nothing, and pricing source links are never affiliate links. Editorial policy.