TrendingNovember 12, 2026•6 min read·ByAyush Chaturvedi· Independent Entrepreneur

Claude Code’s “Don’t Ask Again” Button Leaked 2,539 Secrets to GitHub. Here’s the 10-Minute Audit.

The Claude Code secrets leak put database passwords, Supabase keys and AWS keys in public repos via settings.local.json. Here’s the 10-minute audit to run today.

Claude Code’s “Don’t Ask Again” Button Leaked 2,539 Secrets to GitHub. Here’s the 10-Minute Audit.

Key Takeaways

  • Clicking “Yes, and don’t ask again” in Claude Code saves the exact approved command to .claude/settings.local.json — including any password or token typed into it, in plain text
  • Apiiro found 104,185 copies of that file on public GitHub; 1,122 held real secrets, and the total climbs to 2,539 secrets across 1,994 repos once git history, forks and agent logs are counted
  • Standard scanners are not enough: gitleaks and TruffleHog both missed 215 of the 1,122 files, because the secrets sit inside shell commands rather than in known key formats
  • Rotate first, clean up second. Deleting the file does nothing for copies already in git history, forks, npm packages or Docker images

You've clicked it a hundred times. Claude Code asks permission to run a command, you're mid-flow, and you hit “Yes, and don't ask again.” This week we learned what that button does with the command: it writes it down, word for word, in a file that thousands of developers have pushed to public GitHub.

The Claude Code secrets leak topped Hacker News this week, and the numbers are ugly: 379 database passwords, 122 Supabase service-role keys, 23 AWS keys and more, sitting in plain text in public repos. If you build with Claude Code — and especially if you vibe-code on Supabase — this is a 10-minute audit you should run today.

How the Claude Code Secrets Leak Works

When you approve a command with “don't ask again,” Claude Code saves an allow rule to .claude/settings.local.json in your project. Sometimes that rule is a pattern like npm test *. Often it's the exact command you approved. So if the command was psql postgresql://postgres:hunter2@db.example.supabase.co, the password is now saved in a JSON file in your repo.

Claude Code does try to protect you. The first time it writes the file, it adds it to your global git excludes. But that only applies on your machine. It never adds the file to the project's own .gitignore. Clone the repo on another laptop, run a CI job, or have a collaborator commit, and the file is free to go public.

Timeline

  • Aug 11, 2025GitHub issue #5544 reports API keys stored verbatim in settings.local.json
  • Jan 3, 2026An inactivity bot closes the issue as “not planned”
  • Nov 6, 2026Apiiro publishes its scan of public GitHub
  • Nov 7–10The Hacker News, TechSpot and Dark Reading pick it up; it hits the HN front page and Claude Code's Boris Cherny responds in the thread

Cherny's response, as reported: Claude Code “has not done secret scrubbing” historically, the file “is not a file you should check into source control,” and the team is “looking into what we can do to prevent this.” He disputed that Claude itself commits the file. Apiiro counters that in 539 of the 1,105 repos it traced, a commit co-authored by Claude touched it. As of this writing, no fix has shipped.

The Numbers From Apiiro's Scan

104K

Public copies of settings.local.json

1,122

Files holding real secrets

2,539

Secrets incl. history, forks and logs

215

Files gitleaks and TruffleHog both missed

More than a third of the exposed secrets open a database directly. In half the affected repos, the file had been sitting on the default branch for at least 217 days. And of 16 coding agents Apiiro reviewed, Claude Code was the only one confirmed to save the full approved command to a project file by default.

Why Solo Founders Are the Most Exposed

Look at the secret types again: database passwords, Supabase service-role keys, SSH logins. That's not an enterprise stack. That's the indie stack — a Supabase backend, a VPS, a weekend MVP pushed to a public repo so you can deploy it or show it off.

A Supabase service-role key is the worst one on that list. It bypasses row-level security entirely. Anyone holding it can read, edit or delete every row in your database — every user, every payment record. No security team is going to catch it for you, because you are the security team.

The workflow makes it worse. When you're vibe-coding, you approve dozens of commands an hour, and pasting a connection string straight into the terminal is the fastest way to get unstuck. “Don't ask again” is built for exactly that kind of speed. The leak happens because you used the tool the way it's designed to be used.

Stay Ahead of the Trends

Get insights like this before they're everywhere. Weekly, no fluff.

Your Agent's Memory Is Now a Secrets File

Most coverage treats this as a Claude Code bug. It is one, but the bigger lesson applies to every agent you use: the folders your AI tools write to are now as sensitive as your .env file, and almost nobody treats them that way.

.claude/, .cursor/, .gemini/, .specstory/, agent memory files, saved chat logs. They all collect what you typed, including the things you shouldn't have. Apiiro also found secrets in 298 copies of the shared .claude/settings.json and in saved agent conversations.

Your existing safety net doesn't cover this either. Secret scanners look for known key formats like AKIA… or ghp_…. A password in the middle of a psql or ssh command doesn't match any of them, which is why gitleaks and TruffleHog both missed 215 files that held real credentials. Attackers' tools have caught up, though: the Shai-Hulud worm in September 2025 ran TruffleHog on infected machines, and it flagged more than half of these files.

This is the same pattern we've seen with malicious VS Code extensions and the LiteLLM breach. AI tooling sped up how fast we ship, and the security habits around it haven't caught up.

The 10-Minute Claude Code Security Audit

Do these in order. Rotation comes before cleanup on purpose.

1. Check if the file was ever committed

Run this in each repo. It checks the whole history, not only the current branch:

git log --all --oneline -- .claude/settings.local.json .claude/settings.json

On GitHub, search your account or org with path:.claude/settings.local.json to catch repos you've forgotten about.

2. Grep your local settings files

Even if nothing was committed, the file on your laptop may hold secrets that can still leak through a zip, a synced folder, an npm package or a Docker image:

find ~ -path '*/.claude/settings*.json' -not -path '*/node_modules/*' 2>/dev/null \
  | xargs grep -nEi 'password|secret|token|://[^/ ]+:[^@ ]+@|sk-|ghp_|AKIA'

3. Rotate everything you find

Database passwords, Supabase service-role keys, SSH keys, GitHub/npm tokens, cloud keys. If a secret was ever in a public commit, assume it was captured. Deleting the file doesn't help: old versions stay in git history, and Apiiro found 211 forks carrying the same secrets.

4. Stop tracking the file, in every repo

git rm --cached .claude/settings.local.json
echo ".claude/settings.local.json" >> .gitignore
echo ".claude/settings.local.json" >> .dockerignore

Add it to the project's .gitignore, not only your global excludes, so the protection travels with the repo. Then open the local file and delete every rule that contains a secret.

5. Keep secrets out of commands

Reference environment variables (psql "$DATABASE_URL") so a saved rule holds the variable's name, not its value. And approve patterns like Bash(npm run:*) instead of one-off commands.

6. Block agent folders at commit time

Add a pre-commit hook (gitleaks or similar) that also rejects any staged file under .claude/, .cursor/ or other agent folders that you don't mean to share. Blocking the path is more reliable than hoping the scanner recognizes a password inside a command.

What Happens Next

Expect Anthropic to ship something soon. Cherny named both options under evaluation: scanning and redacting secrets before they're written, and changing how permissions are stored so sensitive strings never get saved. Other agent vendors will quietly audit their own config files too.

But a fix going forward won't clean up the 2,539 secrets already out there, or the next file format nobody has scanned yet. Agents are becoming the main way solo founders touch production — databases, servers, deploys. Every one of those actions leaves a record somewhere. The founders who stay safe will be the ones who treat those records like credentials, not like settings.

The Bottom Line

  • “Don't ask again” saves the full command: any password typed into it lands in plain text in .claude/settings.local.json
  • The indie stack is the target: database passwords and Supabase service-role keys dominate the leaked secrets
  • Scanners miss it: passwords inside commands don't match known key formats, so block agent folders by path
  • Rotate before you clean up: git history and forks keep every secret you delete

Related Reading

Sources

Don't Miss the Next Big Shift

Every week, we break down the trends that matter for indie hackers and SaaS founders. Stay informed, stay ahead.

Join 3,000+ founders who stay ahead of the curve

Keep Reading