Every coding agent asks permission before it runs a shell command, and every developer eventually clicks the button that stops it asking. In Claude Code that button is labelled “Yes, and don’t ask again.” Choosing it writes an allow rule into the project’s local settings file, .claude/settings.local.json. If the approved command was one exact command rather than a pattern, the rule stores that command in full — including any password or token typed inside it, in plain text.
The application-security vendor Apiiro went looking for the consequences. Researchers Shmulik Cohen and Matan Giladi collected public GitHub data between November 1 and November 3 and scanned 104,185 public copies of that one file. They classified 1,122 of them — about 1.1% — as containing secrets, holding 1,379 distinct credential values. Widening the search to git history, deleted earlier versions of the file, the deliberately shared .claude/settings.json, and agent transcripts raised the total to 2,539 secrets across 1,994 repositories.
Apiiro’s breakdown of what was in there: 379 database passwords, 43 SSH logins for publicly reachable servers, 42 tokens for GitHub, GitLab and npm, and 23 AWS keys. It notified affected organisations on November 2 and 3. One company confirmed its exposed key was still live.
Why the scanners missed them
This is the part that should worry security teams. Apiiro ran two standard secret scanners over the same files with verification disabled: gitleaks flagged 564 of the 1,122, TruffleHog flagged 643, and neither flagged 215. The misses share a shape — passwords typed inline inside a command, after PGPASSWORD= or sshpass -p or mysql -p. Scanners are built to recognise credentials that look like credentials: long high-entropy strings in a config field. A human-chosen database password sitting mid-command looks like an argument.
There is a partial guard already in place. Anthropic’s documentation says that the first time Claude Code writes the file inside a git repository, it adds the path to the user’s global git excludes. That protects the developer who created the file on the machine where it was created. It does not travel with the project to anyone else, it is not the repository’s own .gitignore, and it does nothing at all for a file that has already been committed. Of 1,105 repositories Apiiro traced, 539 contained a commit listing Claude as a co-author that modified the file.
Our take: The leak is not the story. The source of the leak is. Any agent that remembers a decision has to write that decision down, and the natural place to write it is a file inside the repository you are already committing. The industry spent a decade teaching developers that .env is dangerous. Agent state directories — .claude/, .cursor/, .gemini/ — are now credential stores too, and almost nobody treats them that way. Apiiro says that across 16 coding agents it compared, Claude Code was the one it confirmed saving the full approved command to a project file by default; that is a design detail that can be changed, and the broader pattern is not.
What to watch
- Whether Anthropic strips literal values out of allow rules, or moves the file outside the project tree entirely. A GitHub issue raised in August 2025 was closed by an automated bot in January 2026 after 60 days of inactivity; Apiiro says four related reports met the same bot and none drew a reply.
- Whether GitHub push protection and the major scanners learn to read passwords embedded in command strings, not just in key-shaped fields.
- Whether your own organisation has these files. The search is one query against your GitHub org for
.claude/settings.local.jsonand.claude/settings.json, history included. Rotate before you delete — removing the file leaves the commits, the forks and the clones.
Two caveats worth stating plainly. Apiiro sells application and agent security products, so it has a commercial interest in this finding. And it did not test the credentials it found: this is measured exposure, not a demonstrated breach. Anthropic had not published a response at the time of the reports.
