Skip to content
Start with Identity
News

Claude Code's 'don't ask again' rules left 1,379 secrets in public GitHub repos

Apiiro found 1,122 public copies of Claude Code's .claude/settings.local.json holding 1,379 distinct secrets, including database passwords, SSH logins and AWS keys, saved when developers approved a command with 'Yes, and don't ask again.'

By SWI Community TeamNov 6, 2026

When a developer approves a shell command in Claude Code with "Yes, and don't ask again," the tool can save that exact command, including any password or token typed into it, as an allow rule in .claude/settings.local.json inside the project. Apiiro said on November 6 that it found 104,185 copies of that file on GitHub, and 1,122 of them held at least one secret: 1,379 distinct secrets, among them 379 database passwords, 43 SSH logins for public servers, 42 GitHub, GitLab and npm tokens, and 23 AWS keys. Claude Code adds the file to the user's global git excludes but not the project's .gitignore, so the protection does not travel with the repository. Gitleaks and TruffleHog together missed 215 of the files, mostly passwords inside commands, The Hacker News reports. An earlier bug report on the behavior was closed by a bot as "not planned."

Why it matters

This is a new place for an old leak: a credential typed into a command line ends up in a config file that gets committed. Agent folders such as .claude/, .cursor/ and .gemini/ now carry the same risk as .env files, and the two common open-source scanners together missed nearly a fifth of the files that held secrets.

Search your GitHub organization, including git history and forks, for .claude/settings.local.json and .claude/settings.json. Rotate every secret they ever held first, then run git rm --cached and add the file to each repository's .gitignore. Approve command patterns rather than exact commands, and pass secrets as variables from a secrets manager instead of typing them. The technique page is secrets in repositories and CI.

Source: Apiiro, The Hacker News

Last reviewed By SWI Community TeamSuggest a correctionHow we research
Independent analysis. No vendor sponsorship. Editorial policy · Report a correction