Claude Code leaked passwords GitHub repositories, Digi Mart USA News: Clicking “Yes, and don’t ask again” in Claude Code can save time, but for many developers it has also published database passwords, cloud keys and SSH logins. When a permanent approval is granted, Claude Code saves the full command as a rule in .claude/settings.local.json, so any password or token inside that command is stored in plain text.
According to a GitGuardian analysis published on November 9, the company found 31,088 distinct secrets in these files on GitHub since January 2025, across 23,276 repositories. Of those, 5,343 were still valid when detected.
Leaks peaked in April 2026 at 12,535 in a single month and fell to 959 in October, and the files also turned up inside images on Docker Hub.
Anthropic responded on November 12 with version 2.1.323. The release notes say a “don’t ask again” rule that looks like it holds a secret, or that would be saved to a git-tracked settings.local.json, “lasts for the session only and isn’t saved.” The update also fixes the file not being ignored globally when a folder later becomes a git repository or is used on a new machine.
It does not remove anything already in the file or already pushed, and Anthropic has not said how Claude Code decides that a rule looks like a secret. Users can run claude –version to check their version and claude update to install the latest one.
Developers can search GitHub code for path:.claude/settings.local.json with their username or organisation to find affected repositories, and should run the same search for .claude/settings.json, where Apiiro reportedly found secrets in 298 shared files, according to The Hacker News. Code search only shows current repository contents, however.
Of the secrets Apiiro found, 734 existed only in commit history after the file had been deleted, so each repository’s history should also be checked with git log –all –full-history — .claude/settings.local.json.
Automated scanners such as Gitleaks and TruffleHog can help, but according to Apiiro both tools missed 215 of the 1,122 files that held real secrets, mostly passwords embedded in ordinary command lines. GitHub scans public repositories for known key formats, and push protection is on by default for personal accounts, but generic passwords are only detected by AI and push protection for them is still in public preview, according to GitHub’s documentation.
The absence of an alert does not confirm that nothing was exposed.
GitHub’s guidance puts rotation first: any secret that has been public should be treated as compromised, so a new database password, API key or SSH key should be issued and the old one revoked before any cleanup. Deleting the file is not enough, because it remains in history, forks and copies others have already pulled.
The Hacker News reports the same secrets appeared in 211 forks of 74 repositories.
To remove the file from history, GitHub recommends git-filter-repo with –sensitive-data-removal –invert-paths –path .claude/settings.local.json, followed by a force push. That does not reach forks, and old commits can remain reachable by hash for a time, so GitHub Support can help with cached views.
Afterwards the file should be removed from version control with git rm –cached, added to .gitignore and verified with git check-ignore -v, and also added to .npmignore and .dockerignore if packages or images are published.
Longer term, passwords belong in environment variables or a command-line password manager rather than in commands an agent runs. Approvals can use narrower patterns such as Bash(npm run test:*) instead of full command lines.
Anthropic’s documentation and other tools’ documentation, including Codex and Cursor permission files, show that whatever sits in such files can be published with the next push.










