Yes. Security firm Apiiro scanned public GitHub in early November 2026 and found 2,539 real secrets sitting in public repositories — because Claude Code's "Yes, and don't ask again" saves the exact command you approved, secret included, as a permanent allow rule in .claude/settings.local.json, a file that routinely gets committed. This was not a breach of Anthropic. It was a convenience feature doing exactly what it was built to do, applied to input that should never have contained a live secret.
What Apiiro actually found
Apiiro searched public GitHub for the exact filename Claude Code uses to remember command approvals and pulled 104,185 public copies between November 1 and 3, 2026. The results, published November 5:
| Measure | Result |
|---|---|
Public copies of .claude/settings.local.json checked | 104,185 |
| Copies holding at least one real secret | 1,122 (1.1%) |
| Distinct secrets in those files | 1,379 |
| Database passwords | 379 |
| Supabase service-role keys | 122 |
| SSH logins for public servers | 43 |
| GitHub, GitLab and npm tokens | 42 |
| AWS keys | 23 |
| Extra secrets found only in git history | 734 |
| Forks carrying the same secrets | 211 |
| Total secrets across history, shared settings and transcripts | 2,539 in 1,994 repos |
| Organisations affected | 63 |
501 of the secrets could open a database directly — 379 database passwords plus 122 Supabase service-role keys. The worst cases Apiiro reported included a database vendor's own admin-level cloud key, a production Azure Postgres password, a Square production token, and the owner password of a medical-records database. In the median repository the file had sat on the default branch for 217 days.
Three honest caveats before you panic. First, Apiiro did not test most of the credentials it found, so "real" means credible — matching a known provider format or paired with a public host — not confirmed valid. Only one notified organisation confirmed its key was still live. Second, Apiiro sells coding-agent security products, so it has a stake here; no third party has repeated the counts. Third, your secret scanner probably would not have caught this: Gitleaks flagged 564 of the 1,122 files and TruffleHog 643, and neither flagged 215 — mostly plain passwords typed inside commands, which have no recognisable shape for a scanner to match.
How one click turns into a public secret
Claude Code asks permission before running most shell commands. After the tenth time it asks about the same command, approval fatigue sets in, and the shortcut is right there: "Yes, and don't ask again". That approval lasts permanently per repository and command, and Claude Code saves it as an allow rule in .claude/settings.local.json.
The trouble is what gets remembered. Approve a database migration run as PGPASSWORD="<redacted>" psql ..., an sshpass -p login, or a curl call with an Authorization: Bearer header, and the whole string — secret included — is written to disk as the remembered rule. Apiiro reproduced the behaviour with both Opus 5.5 and Fable 5.1, so the model makes no difference. And the more you click it, the worse it gets: about 9.9% of settings files over 8 KB held a secret, against 0.17% of files under 500 bytes.
The file is meant to stay local, and Claude Code adds it to your machine's global git excludes the first time it writes it. But a global exclude only exists on the machine that wrote it. It misses every case that matters: the file was created before git init; a teammate's laptop or a CI runner clones the repo without the rule; someone created the file by hand; or git was already tracking it, which ignore rules never undo. The file can also leave without git at all — in npm packages, Docker images built with a broad copy step, zip archives and synced folders. In 539 of the 1,105 repositories Apiiro traced, a commit co-authored by Claude itself had touched the file.
This was reported before anyone scanned for it. A bug report describing approved commands with credentials stored in plaintext was filed against Claude Code in August 2025 and auto-closed as "not planned" in January 2026 with no maintainer reply. Security firm ironPeak documented the same pattern independently in early 2026. Boris Cherny, who leads Claude Code at Anthropic, has since acknowledged the product has not historically done secret scrubbing and said the team is "looking into what we can do to prevent this". As of November 8, no automatic redaction had shipped.
The 10-minute check
Run these in every repository where you have used Claude Code, before you change anything else:
- Is the file tracked?
git ls-files | grep -E "\.claude/settings(\.local)?\.json"— any output forsettings.local.jsonmeans it is committed. - Was it ever committed?
git log --all --oneline -- .claude/settings.local.json— any commit means the content is in history even if the file is gone now. - Read the allow list. Open
.claude/settings.local.jsonand look forPGPASSWORD=<redacted>,sshpass -p,mysql -p,Authorization: Bearer, connection strings likepostgres://user:password@host`, and anything that looks like a key. - Check the whole organisation. GitHub code search with
path:.claude/settings.local.json org:YOUR_ORG, and repeat for.claude/settings.json. - Check what else shipped. Look for a
.claude/folder in published npm packages, Docker images and shared archives.
Deleting the file does not undo exposure. Apiiro found 734 secrets that existed only in older commits, and 211 forks carrying copies. If a secret shows up anywhere in that history, it has to be treated as public.
The fix, in the right order
- Rotate first. Rotate every credential the file ever held and treat each one as compromised. Start with database passwords and anything paired with a public host. Removing the file leaves history, forks and clones untouched, which is why rotation comes before cleanup.
- Untrack it properly. Run
git rm --cached .claude/settings.local.json, add.claude/settings.local.jsonto the project's own.gitignore, and commit. A repo-level rule travels with the repo; a global exclude does not. - Delete the rules. Remove every allow rule containing a secret from the local file, even in repositories that were never pushed.
- Rewrite history for public repos. Use
git filter-repoand ask the host to purge cached views. Forks keep the old commits, which is why rotation came first. - Stop handing the agent live secrets. Reference secrets through environment variables like
$DB_PASSWORD, so a saved rule holds the variable name and never the value. Approve patterns such asBash(npm run *)instead of literal commands — the pattern matchesnpm run buildandnpm run testwithout storing any argument. - Scan the agent folders. Treat
.claude/,.cursor/,.gemini/and.specstory/like.envfiles. Add them to pre-commit and CI scanning, with custom rules that catch passwords inside commands — the default scanner rules miss exactly this shape.
The same flaw, two more places
Claude Code is not the only place a live secret gets handed to something that only needed to make a call. The same root cause shows up in the other two AI stories of the month, and if you shipped with an AI builder, you should check both.
Your Lovable app's database may be open. A scan of 159,041 Lovable projects found 34,545 using Supabase, and 24,664 of them returned records on page load with no authentication at all. Email-bearing records sat in 10,560 tables across 7,403 sites — including more than 1,000 passport records, 80,000 forum profiles, 200,000 chat messages, and 280,000 customer emails inside a single CRM app. That is the same failure with the roles reversed: instead of a secret handed to the tool, it is an open door the tool never asked you to close. Lovable's reply was that this is an industry-wide problem and the owner is responsible for their own app — which is true, and which is why the fix is yours to make: turn on Row Level Security and test it as a stranger, not as the owner. We covered the full production checklist in our Lovable app production guide, and the deeper breakdown of what breaks first.
Goldman Sachs pulled the tools from its bankers. On November 2, Bloomberg reported that Goldman Sachs updated its internal guidance in October 2026 to restrict Claude Code and GitHub Copilot to roughly 12,000 engineers and "strats" — bankers and traders who had been using them for months lost access. The reason given was "productivity and risk management" after a "period of experimentation". That is a reversal: the bank's CIO had praised non-engineer "vibe coding" in July 2026. Goldman did not ban AI — it reassigned the tools to the people who own the code. Even a bank with unlimited security budget will not let people who don't own the code ship AI-written code unsupervised. If your team ships AI-built apps, someone has to own the repo — its history, its permissions, and its secrets.
What we'd do
If a client brought us a repo at Lynxwell Digital after a story like this, we'd start with the 10-minute check above across every repository, not just the one they were worried about — then rotate anything the history ever held, because a leaked key in a fork is still a live key. We'd put the agent folders in .gitignore and CI scanning the same day, and switch every approval to pattern rules so no literal command can ever carry a secret again. And for an app built with Lovable or v0, we'd run the same check on the database: Row Level Security on, tested as a stranger, before anything else ships. If you want us to do that audit for you — repo history, exposed keys, and database permissions, with the findings in plain language — that's our free audit, and we'll tell you what's actually exposed before you spend anything.
FAQ
Did Claude Code get hacked?
No. Nothing in Anthropic's infrastructure was breached. Claude Code's "don't ask again" feature saves the literal approved command — secret included — into a project file, and that file gets committed like any other. The leak is a feature working as designed on input that should never have contained a live secret.
How do I know if my repo leaked a secret?
Run git ls-files | grep -E "\.claude/settings(\.local)?\.json" to see if the file is tracked, and git log --all --oneline -- .claude/settings.local.json to see if it was ever committed. Then read the allow list in the file for passwords, tokens and connection strings. For a whole organisation, search GitHub code for path:.claude/settings.local.json org:YOUR_ORG.
I deleted the file — am I safe?
No. Apiiro found 734 secrets that existed only in git history, and 211 forks carrying copies. Deleting the file removes it from the current branch; it does nothing about history, forks, clones, or search-engine caches that already indexed it. Rotate the credentials first, then clean up.
Doesn't my secret scanner catch this?
Probably not. Of the 1,122 files Apiiro classified as holding a real secret, Gitleaks flagged 564 and TruffleHog flagged 643 — and neither flagged 215, mostly plain passwords typed inside commands. Those have no recognisable shape for a standard scanner rule to match. Add custom rules for patterns like PGPASSWORD=<redacted> and sshpass -p, and scan agent folders like .claude/` explicitly.
Is this only a Claude Code problem?
No. Apiiro compared 16 coding agents and found Claude Code was the only one confirmed to save the full approved command in a project file by default — but it also found secrets in shared settings files, agent transcripts and VS Code Copilot auto-approve settings. The same root cause shows up elsewhere: Lovable apps with Row Level Security off expose their whole database, and Goldman Sachs just pulled Claude Code from bankers and traders — nobody owned the code the AI wrote.
Built your app with Lovable, Bolt or Replit and it’s acting up with real users? Our Launch Safety Audit is $390, and free if we find nothing critical: lynxwelldigital.com/lp/fix-ai-app