AI coding helper saved passwords that ended up public on GitHub
On November 6, 2026, security firm Apiiro published research showing that Claude Code, Anthropic's AI coding assistant, can save passwords and keys in plain text inside a project. When a user answers “Yes, and don't ask again” to a command, Claude Code writes an allow rule to the file .claude/settings.local.json. If the rule records the exact command, any password or token typed into that command is saved with it. Apiiro found 1,122 public copies of this file on GitHub that held at least one secret, including 379 database passwords, 43 server logins and 23 AWS keys. On November 8, 2026, iTnews reported that Boris Cherny, head of Claude Code at Anthropic, acknowledged the issue on Hacker News. He said the team is looking into prevention, but the proposed fixes might not fully solve it.
Who is at risk
Anyone whose site or app was built with Claude Code, whether by you, a freelancer or an agency, and whose code is stored on GitHub. Claude Code keeps the file out of uploads only on the one computer where it runs. It does not add a rule to the project's own .gitignore file, so other computers, clones and forks can still upload the file.
Deleting the file today does not end the leak, because older versions stay in the project history and in forks. Apiiro did not test whether the secrets still work. One organization it notified confirmed that its key had been live.
What to do now
- Check the project history. Ask your developer or agency whether an AI coding assistant ran commands on your project and whether the code is on GitHub. Then, in the project folder, run
git log --all --oneline -- .claude/settings.local.json .claude/settings.json. This works the same on macOS, Linux and Windows with Git installed. Any result means the file was saved into the history at some point. - Change every leaked key first. Change every password, key, token and server login the file ever held. Also change any secret that anyone typed into a command the assistant ran. That includes database passwords, GitHub tokens, AWS keys and payment keys such as Stripe or Square. Changing them is what closes the hole, because old copies remain in forks and clones.
- Stop the file from being uploaded again. Run
git rm --cached .claude/settings.local.json. Add the line.claude/settings.local.jsonto the project's own .gitignore file, then commit both changes. - Keep secrets out of commands. Store secrets as environment variables or in a password or secrets manager, and refer to them by name, for example
$DB_URL. A saved rule then holds only the name. When the assistant asks for permission, approve a general pattern such asnpm test *, not one exact command with a password in it. On every computer that works on the project, open .claude/settings.local.json and delete any saved rule that contains a secret. - Turn on secret scanning. In the security settings of each GitHub repository or organization, turn on secret scanning and push protection. Public repositories get them free; private repositories need GitHub's paid Secret Protection. Send the alerts to an email inbox someone actually reads. Do not rely on scanners alone: in this research, 215 of the 1,122 files with secrets slipped past both of the free tools gitleaks and TruffleHog.
Sources
- Apiiro: Coding agents leaking secrets on GitHub via “don't ask again”
- The Hacker News: Claude Code's “Don't Ask Again” File Exposes Passwords and Keys in 1,122 Public Copies on GitHub
- iTnews: “Don't ask again” in Anthropic's Claude Code leaks developer secrets
- AI Weekly: Apiiro: Claude Code 'Don't Ask Again' Leaks Keys in 1,122 Repos