"Don't ask again" saves the secret too
Claude Code saves each command you approve with "Yes, and don't ask again" to a file in your project, secrets included, and Apiiro found more than a thousand of those files on public GitHub holding one. Omnodex now checks that file when a session starts and flags git commands that would commit it.
When you approve a command in Claude Code with “Yes, and don’t ask again,” Claude Code saves that exact command as an allow rule in .claude/settings.local.json, inside your project, so it won’t ask next time. If the command had a token or password typed into it, the file now holds that token or password in plain text.
On November 6, Apiiro published what that looks like at scale. Of 104,185 copies of the file in public GitHub repositories, 1,122 held at least one secret: 1,379 distinct secrets, including 379 database passwords, 43 SSH logins and 23 AWS keys. Counting older versions in git history and a few related files, the total reached 2,539 secrets across 1,994 repositories (The Hacker News; CSA research note). Apiiro did not test whether the secrets still worked.
Why an ignored file ends up in git
The file is meant to stay on your machine, and Claude Code does try to keep it out of git. The first time it writes the file in a repository that doesn’t already ignore it, it adds the path to your global git excludes. That protects the machine it ran on, not the repository: the line is in your personal git config, not in the project’s .gitignore (CSA). A copied project folder, a container, a second laptop or a teammate’s machine doesn’t have it. And an ignore rule does nothing for a file git already tracks.
Anthropic’s first answer was that the leaked files had been “manually created and checked in.” Paweł Huryn checked his own laptop and found five repositories with the file, all written by Claude Code between March and August: “None ignored. 2 already committed.” Current versions do add the global ignore, he found, “but older files stay unprotected until Claude Code writes them again.”
In the Hacker News thread, the Claude Code team pointed people to auto mode and to secret scanning on their git host. Both are good advice. Neither tells you about the file already sitting in the project you opened this morning.
What Omnodex now checks
Claude Code writes this file itself, outside any tool call, so a rule that watches tool calls never sees the write. Omnodex already flags a recognized secret in the command an agent runs. What it couldn’t see was the copy that stayed behind. Version 0.16.0 adds two checks for that copy.
When a session starts. Omnodex reads the project’s .claude/settings.local.json. If it holds a credential Omnodex recognizes, you get a finding that names the kind of credential, never the value, and answers two questions: do the repository’s own ignore rules (its .gitignore files or .git/info/exclude) cover the file, and does git already track it?
Those answers set the severity:
- High when git already tracks the file, so the secret is in the repository.
- Medium when the project is in a repository whose own ignore rules don’t cover the file, so a broad
git addcan commit it. - Low when the repository ignores it, or the project isn’t in git.
Your global ignore deliberately doesn’t count, for the reason above. Each state is reported once per project rather than at every session, and you hear about it again if it changes, for example when the file gets committed.
In a command. A git add, commit, stash or rm that names the file is flagged high when an agent runs it.
The agent session is simulated; the output is real.
Try it
Both checks are in the free, open-source package:
npm install -g omnodex # or: omnodex update
omnodex install claude-code
Start a new Claude Code session in a project, and any finding shows up in the local dashboard.
If you get one, rotate the credential first. As CSA put it, deleting the file or rewriting history “does not undo a leak.” Then remove the entry from the file, add .claude/settings.local.json to the repository’s own .gitignore, and run git rm --cached .claude/settings.local.json if git tracks it. From then on, approve commands that read a secret from an environment variable, such as $TOKEN, so the saved rule holds the variable’s name instead of its value.
What it does not do
It reports after the fact. The check runs when a session starts, so a secret saved during a session shows up at the next one. Nothing here stops Claude Code from writing the file, and nothing removes a secret from the file or from git history.
It only finds credential formats Omnodex recognizes: provider and cloud API keys, GitHub and Stripe tokens, bearer tokens, and passwords in assignments, in database connection strings or after flags like mysql -p. A secret written some other way is missed.
The command rule only sees git commands that name the file. git add ., git add -A and git commit -a don’t, which is why the session-start check reports whether the repository ignores the file.
It reads Claude Code’s file only. Other agents’ settings are not checked.
The Risk Library page has the details, including false positives.
Sources
- Claude Code’s “Don’t Ask Again” File Exposes Passwords and Keys in 1,122 Public Copies on GitHub, The Hacker News, November 7, 2026
- Approved Once, Leaked Forever: Secrets in Claude Code Settings Files, Cloud Security Alliance, November 8, 2026
- Coding Agents Leaking Secrets to GitHub via “Don’t Ask Again”, Apiiro, November 6, 2026
- Paweł Huryn on X, November 7, 2026
- Hacker News discussion, November 2026
- Credentials saved in Claude Code’s local settings, Omnodex Risk Library