If you use Claude Code, there is a file in your project you should check today. Researchers at the cybersecurity company Apiiro have found 2,539 exposed secrets (passwords, keys and tokens) in public GitHub repositories, and the cause is a very convenient option in Anthropic’s coding assistant: “Yes, and don’t ask again”.
The essentials:
- When you approve a command “forever”, Claude Code saves it as is in
.claude/settings.local.json, passwords included if they were part of the command. - If that file is pushed to a public repository, anyone can read them.
- Apiiro reviewed 104,185 public copies of the file: about 1,122 (1.1%) contained at least one secret.
- Counting Git history, forks and other agent files, the figure rises to 2,539 secrets across 1,994 repositories.
- What to do: rotate the exposed keys, add the file to your project’s
.gitignoreand don’t type passwords into commands.
What exactly happened?
Claude Code asks for permission before running commands on your computer. So that you don’t have to approve the same thing over and over, it offers the option “Yes, and don’t ask again”. When you click it, it saves a permission rule in the .claude/settings.local.json file in the project folder.
The problem is that this rule stores the full command. If the command included a database password, a GitHub token or an AWS key typed by hand, it is saved in plain text. And if you then commit and push to a public repository, that password is visible to everyone.
According to the study published by Apiiro on November 5, the secrets found included 379 database passwords, 43 SSH credentials, 42 GitHub, GitLab or npm tokens and 23 AWS keys. They affected 63 organizations, and at least one confirmed that the key it was notified about was still working. The researchers did not check the rest, so they speak of exposure risk, not confirmed attacks.

Why isn’t deleting the file enough?
- Git remembers everything. Even if you delete the file, earlier versions remain in the repository history and in any forks others have made.
- The protection doesn’t travel with the project. Claude Code adds the file to your computer’s global Git exclusion list, but not to the project’s
.gitignore. If someone else on the team or your other computer doesn’t have that exclusion, the file can slip through. - Scanners don’t catch everything. Gitleaks and TruffleHog, two common tools for detecting secrets, left 215 of the 1,122 files with secrets unflagged, especially when the password was embedded inside a command.
In addition, according to The Hacker News, a report about this behavior opened in August 2025 was closed by an automated bot as “not planned”, as were four later ones. At the time of writing, Anthropic had not announced any change.
How to check whether you are affected (and what to do)
- Look for the file in your repositories:
git ls-files | grep .claude/. Ifsettings.local.jsonshows up, open it and check for passwords, tokens or keys. - If there is any secret and the repository is or ever was public, change that key NOW. This comes first: cleaning the history is pointless if the key still works.
- Stop tracking the file and add it to the project’s
.gitignore:git rm --cached .claude/settings.local.jsonand a line.claude/settings.local.jsonin the.gitignore. - Don’t type passwords into commands. Use environment variables or a secrets manager, and approve command patterns instead of full commands with the key inside.
- Treat the
.claude/folder the way you treat the.envfile: something that is never pushed.
Our take
This is not an exotic bug: it is what happens when a tool built for speed stores things without the user knowing. Coding agents like Claude Code, Cursor or Copilot will write more and more configuration files on their own, and each one is a new place where a password can slip in.
The simple rule: if an agent can write to your project, review what it writes before you push it. If you are just getting started with this kind of tool, you may like our guide on what AI agents are.
Frequently asked questions
Is this a hack of Claude or Anthropic?
No. Nobody has attacked Anthropic. These are passwords that users themselves pushed to public repositories without realizing it, because of how Claude Code stores permissions.
If my repository is private, am I safe?
Safer than with a public one, but not completely: anyone with access to the repository can see those keys. The best practice is to keep no passwords written in any project file.
Do I have to stop using “don’t ask again”?
Not necessarily. The problem only appears when the approved command has a password inside it. Use environment variables and check from time to time what is in settings.local.json.
Sources
- The Hacker News: Claude Code’s «Don’t Ask Again» file (Nov 7, 2026)
- iTWire: Claude Code approval files found exposing company secrets on GitHub
Featured image: code on a monitor, photo by Markus Spiske, CC0 (public domain), via Wikimedia Commons.