Claude Code's permission system lets you approve a shell command once and skip being asked again. Pick "Yes, and don't ask again" on a command that carries a real credential — an API key in a curl header, say — and that credential now sits in plaintext inside .claude/settings.local.json, a project file most developers don't think to treat as a secret store.
What the source says
Per CSO Online's report, GitGuardian researcher Guillaume Valadon scanned public GitHub and found 31,088 distinct secrets sitting in that one file, across 23,276 repositories. 5,343 were still valid when found. Of the secrets GitGuardian could test, 67% were working credentials — database passwords were the largest single category at 2,280 distinct credentials, ahead of cloud-provider and AI-service tokens.
It doesn't stop at git. Docker's COPY . instruction ignores .gitignore entirely — it needs an explicit .dockerignore entry to skip a file — so the same settings file turns up baked into public container images too: 613 more secrets (99 valid) across 543 image repositories and 7,625 tags. One valid Cloudflare API token showed up in 559 tags; a database password in 643 tags across seven image repos.
Claude Code does add the file to the local machine's global git-ignore list the first time it's written. That's a per-machine setting, not a per-file one — the same project cloned, forked, or checked out in CI starts from zero protection. GitGuardian says Claude Code lead Boris Cherny acknowledged the issue and was exploring fixes, including built-in secret scanning, but nothing had shipped as of the report. Monthly new leaks of this file peaked at 12,535 occurrences in April 2026 and fell to 959 by October — the report doesn't say why.
What it doesn't establish
This is a research scan of existing public exposure, not a count of who actually exploited any of it, and the report doesn't say what fraction of the 5,343 still-valid secrets have since been rotated. It also doesn't say whether Anthropic has shipped a fix since Boris Cherny's acknowledgment, or whether other coding agents with similar "approve once" permission caching have the same problem — this report is specific to Claude Code.
We've scored this 8/10 (high) in our own system, and flagged verified: false — not because the numbers are in doubt, but because this is one security firm's scan rather than something our own process reproduced.
Why it matters anyway
The underlying behavior — convenience features that persist literal argument values instead of just the shape of an approved command — is a design pattern worth checking for in any agent tool, not just this one. If you've ever clicked "don't ask again" on a command with a credential in it, .claude/settings.local.json is worth a look before you commit, fork, or build a container from that project.
Full scoring breakdown and source: https://www.stupidllm.com/incident/STUPID-2026-0167/
Top comments (0)