Claude Code's 'Don't Ask Again' Has Put Secrets in 1,122 Public GitHub Files
Claude Code saves each command approved with "don't ask again", secrets included, to a project settings file; Apiiro found real secrets in 1,122 public copies on GitHub.
3. Claude Code's 'Don't Ask Again' Has Put Secrets in 1,122 Public GitHub Files
Apiiro researchers found real secrets in 1,122 public GitHub copies of Claude Code's .claude/settings.local.json file, out of 104,185 copies checked. The mechanism is specific. When Claude Code proposes a shell command that contains a secret, such as a database password in a connection string, and the developer picks "Yes, and don't ask again", Claude Code saves that exact command string, secret included, as a permission rule in .claude/settings.local.json inside the project folder. Claude Code adds the file to the developer's global git ignore list, but not to the repo's own .gitignore, so it gets committed in folders that become repos later, in clones on other machines, or where the file is already tracked. Counting git history, shared settings.json files and saved agent transcripts, Apiiro counts 2,539 distinct secrets in 1,994 repos.
The frame is uncomfortable for Anthropic because Apiiro attributes the leak to Claude Code's own behavior: it reproduced it with current models, and in 539 of 1,105 traced repos a commit co-authored by Claude changed the file. Standard scanners catch only part of it. Of the 1,122 files, gitleaks flagged 564, TruffleHog 643, and 215 were flagged by neither, because a password typed after PGPASSWORD= or sshpass -p does not match a key format. Apiiro notes the same password-in-a-command pattern appears wherever an agent records what it ran, so other coding agents that log approved commands face the same question.
Boris Cherny, Anthropic's head of Claude Code, said on Hacker News that the team is "looking into what we can do to prevent this", including secret scanning. Teams using Claude Code should search their repos and git history for both settings files, read each allow list, and rotate any secret they find before cleaning up.
Source: Claude Code's "Don't Ask Again" exposes passwords in 1,122 public GitHub files