Anthropic's coding agent asks permission before it runs most shell commands. When a developer clicks "Yes, and don't ask again," Claude Code writes an allow rule into `.claude/settings.local.json`. If the prompt offered a single exact command with a password typed into it, the password goes into that file word for word, in plain text.
Apiiro went looking for the file on GitHub and found 104,185 copies across 103,617 public repositories. About 1.1% of them — 1,122 files — held at least one credential: 1,379 distinct secrets in all, including 379 database passwords, 43 SSH logins for public servers, 42 GitHub, GitLab and npm tokens, and 23 AWS keys. Add older versions that survive only in git history, the shared `.claude/settings.json` files teams commit on purpose, and saved agent chat logs, and the total reaches 2,539 secrets across 1,994 repositories.
As of Monday, every file containing a secret was still on its repository's default branch. In half of those repositories it had been there for at least 217 days. Forks carry the problem further: 211 forks of 74 repositories hold the same secrets as the originals.
The design flaw is that Claude Code's own protection does not travel with the project. The first time it writes the file in a git repository, it adds the path to the user's global git excludes, so git on that one machine ignores it everywhere. It never adds the path to the repository's own `.gitignore`. A colleague without that global setting, a CI runner, or a second laptop can commit the file without noticing. In 539 of the 1,105 repositories the researchers traced, the commit that changed the file listed Claude as a co-author; they read that as the agent committing the file itself.
Ordinary secret scanners are poorly suited to this. Given every copy, gitleaks flagged 564 of the 1,122 files and TruffleHog 643; neither flagged 215. Most misses are passwords typed inside commands: a value after `PGPASSWORD=`, `sshpass -p` or `mysql -p` looks like an ordinary word in an ordinary command line, not a key format.
Among the owners are 63 organisations, mostly software companies of all sizes. The researchers cite a database vendor's own admin-level cloud key and the owner password of a medical-records database among the strongest cases. They did not test whether the credentials still work; one company they notified this week confirmed its key had been live. Of 16 coding agents whose documentation they compared, Claude Code is the only one confirmed to save the full approved command into a project file by default.
None of this is a new discovery. A bug report filed on 11 August 2025 described exactly this behaviour. An automated bot closed it as "not planned" on 3 January after 60 days without activity. All four related reports are now closed by the same bot — the most recent the day before publication — and none received a reply from Anthropic, the researchers said.
Apiiro's advice, in order: search the organisation for both settings files and check git history even where the file is gone; rotate every credential the files have ever held before cleaning anything up; `git rm --cached` the local file and add it to the project's `.gitignore`; delete every rule containing a secret from your own copy; pass secrets as variables such as `$DB_URL` instead of literals; and approve command patterns like `Bash(npm run:*)` rather than single commands.
Copies that never reach GitHub still matter. The file is plain JSON in the project folder, and it can end up inside an npm package, a Docker image, a zip archive or a synced directory. For security teams the recommendation is to treat `.claude/`, `.cursor/`, `.gemini/` and `.specstory/` folders and agent memory files as secret-bearing like a `.env`, and to extend pre-commit and CI scanning to cover them, git history included.
