Claude Code's Don't Ask Again file leaks secrets in 1,122 public GitHub copies
Security firm Apiiro found 1,122 public copies of .claude/settings.local.json on GitHub holding at least one secret, 1,379 distinct credentials in total. According to The Hacker News, Claude Code saves commands approved with Yes, and don't ask again word for word, including passwords and tokens.
Why it matters
When a user picks that option, Claude Code stores an allow rule in a project file. If the approval covers one exact command, any secret typed into it is saved in plain text. Claude Code adds the file to the global git excludes on one computer, but never to the project's own .gitignore, so it is easy to commit.
More than a third of the secrets open a database directly, including 379 database passwords, plus 43 SSH logins, 42 GitHub, GitLab, and npm tokens, and 23 AWS keys. Apiiro did not test whether the credentials still work, but one company it contacted confirmed its key had been live. Gitleaks and TruffleHog both missed 215 of the files.
Recommended steps: search your organization and git history for the file, rotate every secret it ever held, stop tracking it and add it to .gitignore, and reference secrets through variables from a secrets manager instead of typing them into commands.