Claude Code's “Don't ask again” button saves passwords to a file — 2,539 secrets leaked on GitHub
When users select “Yes, don't ask again,” Claude Code saves the entire command, including any embedded passwords and keys, to .claude/settings.local.json. If that file ends up in a public repository, the secrets become visible to everyone. Apiiro found 2,539 secrets across 1,994 repositories, and deleting the file does not help because Git retains its history.
AI-processed from TG: @neuraldvig (Нейродвиж); edited by Hamidun News
The “Yes, don't ask again” button saves a few seconds, but it could end up costing you your cloud keys. Apiiro researchers discovered that, after receiving this confirmation, Claude Code writes the approved command in full to a settings file. If the command contains secrets, they remain there in plaintext.
How it happens
Imagine asking the agent to connect to a database. It constructs a command such as psql, with the password directly in the connection string, or runs curl with a token in the header. Claude Code asks for permission, you click “Yes, don't ask again,” and, to avoid asking again in the future, the agent saves an allow rule in .claude/settings.local.json. The rule contains the command literally, including the password.
Then ordinary human inattention takes over. The file sits inside the project, a developer runs git add . and git push, and the secret lands in a public repository. The word local in the filename creates a false sense that the file will never leave the machine, but in practice it is often not excluded from the index.
The scale of the problem
Apiiro found 2,539 secrets across 1,994 repositories. They included database passwords, SSH credentials, and AWS keys. This is not a theoretical scenario: these leaks have already occurred, and harvesting bots find this kind of data in public repositories very quickly.
Another problem is that deleting the file in a subsequent commit solves nothing. Git retains the full history, so the secret remains accessible in older commits. The only reliable course is to treat the key as compromised, revoke it immediately, and issue a new one. Cleaning the history with filter-repo is necessary, but only as an additional measure.
What to do right now
- Check your repositories for .claude/settings.local.json and inspect what has been saved in it.
- Add the file to .gitignore, or preferably to the machine's global gitignore.
- Enable pre-commit hooks and secret scanners such as gitleaks, or enable push protection on GitHub.
- Do not pass secrets in commands: use environment variables, secret managers, and AWS profiles.
- If the file has already been published, rotate every key and password listed in it immediately.
Limitations and conclusion
There is no malicious intent on the model's part here. This is a design flaw in a convenience feature: the permission is remembered as a complete command line. The remaining question is how quickly Anthropic will change the behavior—for example, by saving a template without arguments or masking sensitive values. Until that happens, responsibility rests with the team.
For product teams and founders, the broader lesson is that any tool with a “remember my decision” feature creates a new artifact containing sensitive data. It must be included in the threat model alongside logs, dumps, and .env files. We are granting agents increasingly broad access, while hygiene around their settings files is lagging behind. Spend ten minutes on an audit today, before someone else does it for you.
- Nov 8, 2026Sutskever, Silver and LeCun Leave the Big Labs: What the Neolabs Are Betting On
- Nov 8, 2026Kimi K3.1 Pro Works in vLLM from Day One: 1M Tokens and 65.7% on Terminal-Bench 4.0
- Nov 8, 2026GPTunneL Put Its Voice Assistant GROM on a Live Broadcast: What Broke in 3 Hours of a Hackathon
- Nov 8, 2026METR: AI has roughly doubled the pace of model development at Anthropic
Key Questions Answered
How it happens?
Imagine asking the agent to connect to a database. It constructs a command such as psql, with the password directly in the connection string, or runs curl with a token in the header. Claude Code asks for permission, you click “Yes, don't ask again,” and, to avoid asking again in the future, the agent saves an allow rule in .claude/settings.local.json. The rule contains the command literally, including the password. Then ordinary human inattention takes over.
What are the key details on The scale of the problem?
Apiiro found 2,539 secrets across 1,994 repositories. They included database passwords, SSH credentials, and AWS keys. This is not a theoretical scenario: these leaks have already occurred, and harvesting bots find this kind of data in public repositories very quickly. Another problem is that deleting the file in a subsequent commit solves nothing. Git retains the full history, so the secret remains accessible in older commits.
What to do right now?
Check your repositories for .claude/settings.local.json and inspect what has been saved in it. Add the file to .gitignore, or preferably to the machine's global gitignore. Enable pre-commit hooks and secret scanners such as gitleaks, or enable push protection on GitHub. Do not pass secrets in commands: use environment variables, secret managers, and AWS profiles. If the file has already been published, rotate every key and password listed in it immediately.
Build & Ship Production AI Agents Without Boilerplate Code
Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.