Claude Code settings files leak 1,122 secrets on GitHub
2026-11-10 · The Hacker News
Security firm Apiiro published research on November 5 showing that passwords and API keys developers typed into commands approved in Claude Code are appearing in public GitHub repositories. As The Hacker News reports, choosing "Yes, and don't ask again" makes Claude Code save an allow rule in the project's .claude/settings.local.json. Sometimes the rule is a pattern such as npm test *, but sometimes it is the exact command, so any password or token typed into it is stored in plain text.
Apiiro found 104,185 copies of the file across 103,617 public repositories. About 1.1%, or 1,122 copies, hold at least one secret, 1,379 in total. A value counted when it matched a known key format, or sat beside a public server address, and an AI reviewer agreed. More than a third open a database directly, including 379 database passwords; others include 43 SSH logins, 42 GitHub, GitLab and npm tokens, and 23 AWS keys. Owners include 63 organizations. The researchers did not test whether the secrets still work, though one company notified said its key was live.
Why was it not stopped? The first time Claude Code writes the file in a git repo, it adds it to the user's global git excludes, but that protects only one computer and does nothing for an already-committed file; it is not added to the project's own .gitignore. In 539 of 1,105 repositories traced, a commit listing Claude as co-author changed the file. The researchers reproduced the behavior with Opus 5.5 and Fable 5.1 and say that, of 16 coding agents compared, Claude Code is the only one confirmed to save the full approved command in a project file by default.
Cleanup takes more than deleting the file: older versions in git history hold 734 more secrets, and 211 forks carry the same content. Including the shared settings.json, older versions and saved chat logs, the total is 2,539 secrets across 1,994 repositories. Common scanners also miss many: gitleaks flagged 564 files and TruffleHog 643, while 215 were flagged by neither, mostly passwords typed into commands.
The recommendations: rotate every credential the files ever held before cleaning up; stop tracking the file with git rm --cached and add it to the project .gitignore; refer to secrets as variables such as $DB_URL; and approve patterns rather than single commands. This summarizes Apiiro's research and media reports; check Anthropic's own announcements for its response and fixes.