The claim
Choosing “Yes, and don’t ask again” on a Claude Code shell-command prompt saved an allow rule holding the full command text, including any inline password, connection string, or bearer token, to .claude/settings.local.json (independent, Cloud Security Alliance; CSO; Dark Reading). Apiiro published research on public copies of that file on 5 or 6 November 2026, and CSO reported separate GitGuardian research on 11 November.
Anthropic’s fix is Claude Code release v2.1.323, dated 12 November on its GitHub releases page. A “don’t ask again” rule that looks like it holds a secret, or would be saved to a git-tracked settings.local.json, now lasts for the session only. The release also fixed the file not being ignored globally on a new machine or when a folder later became a git repository (vendor, Anthropic release notes).
The claim we test: upgrading to 2.1.323 closes the leak.
The inputs
Neither study’s own write-up was readable to us. Every count below is as relayed by the outlet named, and the two studies used different scopes and methods, so their totals are not added.
| What was counted | Figure | Label |
|---|---|---|
Public copies of settings.local.json Apiiro examined | 104,185 in 103,617 repositories | independent (Apiiro, via CSA and Dark Reading) |
| Copies holding at least one secret | 1,122, with 1,379 distinct secrets | independent (same) |
| Share of copies with a secret | 1,122 ÷ 104,185 = 1.08% | our maths |
| Including git history, shared settings, and chat logs | 2,539 secrets in 1,994 repositories; 734 only in history | independent (same) |
| Forks carrying the same secrets | 211 forks of 74 repositories | independent (same) |
| GitGuardian, public GitHub | 31,088 distinct secrets in 23,276 repositories; 5,343 valid when detected | independent (GitGuardian, via CSO) |
| Share valid when detected | 5,343 ÷ 31,088 = 17.2% | our maths |
| GitGuardian, Docker Hub | 613 distinct secrets, 99 valid, in 543 image repositories | independent (same) |
Apiiro’s 1,379 included 379 database passwords, 43 SSH logins for public servers, 42 GitHub, GitLab, or npm tokens, and 23 AWS keys (independent, Apiiro via CSA). Apiiro did not test whether its secrets worked.
The result
The upgrade is necessary and not sufficient. It changes what Claude Code writes next. It changes nothing already written.
- Files already pushed stay public. The rule is in the repository until someone removes it.
- History keeps it after removal. 734 of Apiiro’s secrets existed only in git history (independent, via CSA).
- Forks keep their own copies. 211 forks carried the same secrets (independent, via Dark Reading).
- Images ignore
.gitignore. GitGuardian traced its Docker Hub finds toCOPY .copying the project directory (independent, via CSO). - The global ignore was one laptop deep. On first write Claude Code added the file to the user’s global git excludes, which protects that workstation and not teammates, CI, containers, or npm tarballs (independent, CSA; CSO).
Shipping the fix is Anthropic’s job. Revoking what already leaked is yours.
Where it breaks
- “Looks like a secret” is not defined. The release notes do not say how the check decides. Low-entropy passwords in command syntax, such as
PGPASSWORD=,sshpass -p, andmysql -p, are what conventional scanners miss: gitleaks flagged 564 and TruffleHog 643 of the 1,122 secret-bearing files, and neither flagged 215 (independent, via CSA and CSO). - The trend is not the risk. GitGuardian’s monthly leak occurrences fell from 12,535 in April 2026 to 959 in October (independent, via CSO), a 92.3% fall (our maths). Those are occurrences by month of leak, and a recent month may be undercounted until it is scanned. Old secrets do not expire with the trend.
- Who pushed is unclear. In 539 of 1,105 traced repositories a commit listing Claude as co-author changed the file, 48.8% (our maths from Apiiro’s figures via CSA). The Cloud Security Alliance says this does not establish that Claude Code pushed every exposed credential.
- It was known. GitHub issue #5544, filed 11 August 2025, reported verbatim plaintext storage of approved commands and was closed by an automated process as not planned on 3 January 2026 (independent, via CSA). Boris Cherny, head of Claude Code, said Claude Code has historically not scrubbed secrets and that Anthropic was looking at options (independent, via Dark Reading and Qodo). Anthropic did not respond to CSO.
- The fair counterargument. About 1.1% of public copies held a secret, enterprise repositories are private, and the global ignore already applied. True for a clean private estate. Forks, images, packages, and contractor laptops are where copies go, so it is a reason to scan, not to skip.
Five steps this week
- Step 1. Set the floor. Make 2.1.323 the minimum Claude Code version through managed settings. Owner: developer platform owner.
- Step 2. Exclude
.claude/at repository level. Add it to the.gitignore,.dockerignore, and.npmignoretemplates, and rungit rm --cachedon tracked copies. Do not rely on each laptop’s global excludes. Owner: repository owners, with the platform team. - Step 3. Scan where copies go. Full git history, container images, and internal package registries, with custom rules for command-line passwords and
Authorization: Bearerheaders. Salesforce teams should add patterns for SFDX auth URLs and org access tokens; no source we read names a Salesforce credential among the leaks, so this is a check, not a finding. Owner: application security lead. - Step 4. Rotate before you clean. Treat every credential found as exposed: revoke and reissue it, then purge it from history. For Salesforce, that means the Connected App or External Client App tokens behind the auth URL. Owner: each credential owner, tracked by the CISO.
- Step 5. Stop typing secrets into approved commands. Move them to environment variables or a secrets manager, and narrow allow rules to patterns. Owner: engineering leads.
Missing
- Apiiro’s and GitGuardian’s own write-ups. We read only the outlets that relayed them.
- How 2.1.323 decides a rule looks like a secret, and whether low-entropy passwords trip it.
- Whether any of Apiiro’s 1,379 secrets were valid.
- Any Anthropic tool or guidance to find and purge rules saved before 2.1.323.
- A Prestanda scan. We have not run Step 3 on any estate; it is a test design, not a result.
Frequently asked questions
Does upgrading to Claude Code 2.1.323 fix the leak?
It stops new secret-looking approvals being saved and repairs the global git ignore on new machines (Anthropic release notes). It does nothing for secrets already pushed, in git history, in forks, in container images, or in packages.
Where does Claude Code keep don't ask again approvals?
In .claude/settings.local.json in the project, as allow rules that held the full command text, including any inline password or token, per the Cloud Security Alliance and CSO.
Will our secret scanner find these?
Not reliably. In Apiiro's data, as relayed by the Cloud Security Alliance, gitleaks flagged 564 and TruffleHog 643 of 1,122 secret-bearing files, and neither flagged 215. Add rules for command-line passwords.
Should we rotate or just delete the file?
Rotate first. Deleting the file leaves the secret in git history, forks, and images, and the credential works until it is revoked.
Sources
- Claude Code v2.1.323 release notes, Anthropic, GitHub releases page dated 12 November (vendor). Read on 23 November; a re-read on 27 November was blocked by our network.
- Research note on the Claude Code settings secret leak, Cloud Security Alliance, 8 November 2026 (independent; relays Apiiro).
- AI coding agents leak secrets on GitHub, Dark Reading (independent; relays Apiiro and Boris Cherny).
- Claude Code’s don’t ask again button has a secrets-spilling problem, CSO, 11 November 2026 (independent; relays GitGuardian).
- Claude Code don’t ask again and secrets, Qodo (vendor blog; relays Boris Cherny).
- Not read: Apiiro’s and GitGuardian’s original write-ups, GitHub issue #5544, The Hacker News, and InfoQ (blocked or not reached).
Living page. Last updated 27 Nov 2026. We update this note when Anthropic documents its secret check or a purge tool, or when Apiiro or GitGuardian publish validity figures we can read at source. Rolling coding agents out across engineering? Talk to us.