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

Source: https://startwithidentity.com/blog/2026-11-06-claude-code-dont-ask-again-rules-left-1379-secrets-in-public-github-repos/
Last updated: 2026-11-06
License: content by Start with Identity. Cite the source URL.

---

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](https://apiiro.com/blog/coding-agents-leaking-secrets-github-dont-ask-again) 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](https://thehackernews.com/2026/11/claude-codes-dont-ask-again-file.html). 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](https://startwithidentity.com/glossary/secrets-management/) instead of typing them. The technique page is [secrets in repositories and CI](https://startwithidentity.com/techniques/secrets-in-repositories-and-ci/).

Source: [Apiiro](https://apiiro.com/blog/coding-agents-leaking-secrets-github-dont-ask-again), [The Hacker News](https://thehackernews.com/2026/11/claude-codes-dont-ask-again-file.html)
