Claude Code's 'don't ask again' button left passwords in 1,122 public GitHub files
Security firm Apiiro found database passwords, cloud keys and SSH logins sitting in a Claude Code settings file across public repositories. If you use AI coding tools, here's how it happens and what to check.
In brief
Security firm Apiiro found 1,122 public Claude Code files holding real passwords
Choosing 'don't ask again' in Claude Code can save the full command, password included, in a settings file. Security firm Apiiro found 1,122 public copies on GitHub holding real secrets such as database passwords and cloud keys. Anyone affected should change those keys first.

If you use Claude Code, Anthropic's AI coding assistant, one convenient button may have put your passwords on the internet.
Researchers at security company Apiiro searched public GitHub between November 1 and 3 and published their findings on November 5. They found 104,185 public copies of a Claude Code settings file, .claude/settings.local.json. Of those, 1,122 files, about 1.1%, held a real secret: 1,379 distinct passwords, keys and tokens.
Nothing in the repo marks that file as private, so it gets committed with the rest of the code.
How a password ends up there
Claude Code asks before it runs most commands on your computer. One of the answers is "Yes, and don't ask again". Pick it, and Claude Code saves a rule so the same command runs without asking next time.
The catch is what gets saved. Often it's the exact command, and if you (or the AI) put a database password or API key straight into that command, the password is saved too. As Apiiro puts it:
Nothing in the repo marks that file as private, so it gets committed with the rest of the code.
Claude Code does try to hide the file from git, but only through a global ignore setting on your own computer. That doesn't travel with the project. A clone on another machine, a folder that becomes a repository later, or a file someone already committed will all slip through. And in 539 of the 1,105 affected repositories Apiiro traced, a commit co-written by Claude itself changed the file.
What leaked
Among the secrets in those 1,122 files: 379 database passwords, 122 Supabase service-role keys, 103 Supabase account tokens, 43 SSH logins (some with root access) and 23 AWS keys. Counting older versions in git history, a shared settings file teams commit on purpose, and saved agent chat logs, Apiiro's total reaches 2,539 secrets across 1,994 repositories.
Most belong to individual developers, but 63 organizations were affected, from student groups to software vendors. Apiiro says one company it warned confirmed its key had been live. The median file had been public for 217 days.
What to do if you use Claude Code
- Search your projects and GitHub for
.claude/settings.local.jsonand.claude/settings.json, including git history. - If any secret was ever in them, change that password or key first. Deleting the file doesn't remove it from history or from forks.
- Add
.claude/settings.local.jsonto each project's own.gitignore. - Open the file on your computer and delete any rule that contains a secret. In Claude Code,
/permissionslists them. - Keep secrets out of commands. Use variables like
$DB_URLfrom a secrets manager, and approve patterns instead of single commands.
The bigger lesson
This isn't a hack. It's a convenience feature doing exactly what it says, in a setup where it's easy to forget a file exists. Apiiro's numbers cover only public repositories, so they say nothing about how often this happens in private ones. As more people let AI agents run commands for them, the files those agents quietly write deserve the same care as the code itself.
Sources
In this story
Source: apiiro.com