Security company Apiiro has identified 2539 valid, authenticated credentials in publicly accessible Claude Code settings, Git histories, and chat logs, spanning 1994 code repositories and 63 organizations. The exposure did not begin with an accidental disclosure: after a user selected “Yes, and don’t ask again,” passwords, tokens, and private keys embedded in commands were written into local settings alongside the authorization record, then carried into public repositories by Git commits. A few saved confirmation prompts came at the cost of long-lived secrets.

It is like leaving a record of access-card use posted at the entrance: the log was meant to save developers from swiping their cards, but it also left the card’s code outside. Worse, a drawer that was once securely locked may lose its protection when it is moved or placed in a different cabinet.
Incident

2,539 Real Credentials Leaked Into Public Repositories

Apiiro found usable, real-world credentials in public Claude Code configurations, Git histories, and chat logs.

Researchers at security company Apiiro cross-checked public Claude Code local configuration files, Git histories, shared configuration files, and agent chat logs. They identified 2,539 real credentials across 1,994 code repositories and 63 organizations. These passwords, tokens, or keys can authenticate external users; they are not merely strings that resemble passwords in ordinary files.

2539Real credentials identified
1994Affected code repositories
63Affected organizations

The affected list includes student teams, startups, software agencies, and established vendors. Public repositories have exposed Azure database passwords, Square production tokens, SSH root login details, and owner credentials for medical record databases. Because the same configuration, Git history, or chat log may contain multiple secrets, the number of credentials cannot be directly equated with the number of exposed files.

These files were supposed to remain local, but were later uploaded to GitHub along with passwords and tokens embedded in command histories. Once a version control system—a system that records every change made to a file—ingests sensitive information, deleting the file later does not mean the secret is gone.

Why It Matters

A Single Confirmation Can Leave a Long-Term Key Behind

Claude Code saves the long-term execution permissions users grant it, along with secrets embedded in commands. Skipping the confirmation dialog also creates a path to a public repository.

Claude Code is an AI coding agent from Anthropic—a software agent that performs development tasks on a user's behalf. Before running Shell commands (command interpreters for operating systems), users can select “Yes, and don't ask again,” allowing similar commands to bypass confirmation in the future.

This permission is written to the project's local .claude/settings.local.json file. The full commands that were approved may also be saved, including any passwords, tokens, or keys in the command line.

Apiiro researchers examined more than 100,000 Claude Code local settings files uploaded to public repositories and found roughly 1,100 containing secrets such as database passwords, API Tokens (credentials used to access external services), private keys, or root login information.

The ratio is close to one percent. The sample came from public settings files that had been uploaded, so it cannot directly represent all Claude Code users.

Nor is .gitignore (a set of rules specifying which files Git should not track) necessarily a reliable safeguard. The settings file is supposed to be added to global ignore rules by design, but global rules may not apply to an individual repository.

That protection may fail if the code is cloned onto another computer or if an ordinary folder is later initialized as a Git repository. The research also says that Claude Code sometimes commits changes to settings files without user confirmation, meaning its “local memory” can become a public record with a single push.

2539
Real credentials identified
Source: IT Home·Artificial Intelligence
1994
Repositories involved
Source: IT Home·Artificial Intelligence
63
Organizations affected
Source: IT Home·Artificial Intelligence

Deleting the file does not necessarily contain the damage. If someone else has already created a fork (a copied version of a repository), the key may remain in the copy and its history. Permission records accumulated over the years can also link together several secrets that should have remained only in the terminal. Personal practice projects, small studios, and temporary repositories may likewise lack anyone dedicated to checking ignore rules and commit history.

With one click, users add another layer of meaning: they avoid a few prompts, but the agent may retain execution permissions indefinitely and preserve the original commands containing secrets. Boris Cherny, a member of the official team, said the team is exploring safeguards and is also considering building key-scanning capabilities into Claude Code. The issue remains under investigation, and security teams have previously found signs of it.