TL;DR
Apiiro says 1,122 public copies of Claude Code’s .claude/settings.local.json file contained at least one password, token or key. The researchers did not test whether most secrets remain usable, though one notified company confirmed its key was live. Removing a file from a repository does not erase older copies in Git history or forks.
Apiiro found 1,122 public copies of a Claude Code settings file containing at least one password, token or other secret, after the coding assistant saved some user-approved commands word-for-word. The findings matter because the files were available in public GitHub repositories, and deleting a copy from the current project version does not remove it from Git history or repository forks.
Get privacy and security gear delivered free with Prime
- Fast, free delivery on millions of items
- Prime Video, Amazon Music and more included
- Member-only deals all year
The file at issue is .claude/settings.local.json. According to Anthropic’s permissions documentation, Claude Code can save an allow rule when a user selects “Yes, and don’t ask again” for a command. Later, matching commands can run without another approval prompt. Apiiro says that if the saved rule contains an exact command with a password or token in it, the secret can be stored in plain text as part of that command.
Apiiro’s research write-up counted 104,185 copies of the file across 103,617 public GitHub repositories. The researchers identified at least one secret in about 1.1% of the copies: 1,122 files containing 1,379 different secrets. Their identification method combined known key formats and passwords or tokens appearing alongside public server addresses, with review by an AI system. The report does not establish that every identified value was valid or accessed by anyone.
The reported secrets included 379 database passwords, 43 SSH logins for public servers, 42 tokens for GitHub, GitLab or npm, and 23 AWS keys. Apiiro said 63 organizations were among the affected file owners. One company that researchers notified confirmed its key had been live; the researchers said they did not test whether the other exposed secrets still worked.
Why Git History Keeps the Risk
The exposure can persist after a developer deletes the file because Git history retains earlier committed versions, while forks can preserve copies independently. Apiiro found 734 additional secrets in older versions across 509 repositories that were absent from current copies. It also identified 211 forks of 74 repositories carrying the same secrets as their originals. A cleanup of the visible file alone may not address those copies.
The issue also challenges routine secret-scanning defenses. In tests across the 1,122 files with identified secrets, gitleaks flagged 564 and TruffleHog flagged 643; neither flagged 215. Apiiro attributed many misses to passwords embedded in ordinary-looking command lines, which may not resemble recognizable key formats. That means organizations relying only on automated scanners could miss some exposed credentials, according to the researchers.
The potential consequences depend on whether a secret is still active and what it can access. A working database password or cloud key could expose systems or data, but the report does not say that attackers used the discovered values. Apiiro described some cases as particularly sensitive, including an administrative cloud key belonging to a database vendor and the owner password for a medical-records database.
Products Worth Considering

Samsung 27-Inch Odyssey G5 QHD Gaming Monitor (G51F)

Bose QuietComfort Wireless Bluetooth Noise-Cancelling Headphones, Sandstone

DJI Osmo Mobile 7P 3-Axis Smartphone Gimbal with Mic Mini Transmitter, Infinity Black
As an affiliate, we earn on qualifying purchases.
How the Command Becomes a File
Claude Code generally asks before running shell commands. When a user chooses “Yes, and don’t ask again,” the assistant records an allow rule in the project’s local settings file, according to Anthropic’s documentation. A rule may cover a command pattern, such as a test command, or an exact command. Apiiro says the risk arises when a secret is included in that exact command and consequently saved alongside it.
Claude Code’s documentation says the tool adds the local settings file to the user’s global Git excludes when it first writes the file in a Git repository. That setting applies to Git on that user’s computer; it does not protect files already committed, and it does not add a rule to the project’s own .gitignore for other contributors. Apiiro found that in 539 of 1,105 repositories it traced, a commit listing Claude as a co-author changed the file. The researchers interpreted this as evidence that Claude often commits it, but the count alone does not establish how each commit happened.
Apiiro also found secrets in other locations. Its report counted 298 copies of the shared .claude/settings.json file with secrets, as well as secrets in older file versions and saved agent chat logs. Including those categories, the researchers reported 2,539 secrets across 1,994 repositories. In a comparison of documentation for 16 coding agents, Apiiro said Claude Code was the only one it confirmed saved the full approved command in a project file by default.
“The researchers found saved commands with the secret still inside.”
— Apiiro researchers
Validity and Use Remain Unknown
The report does not establish how many of the 1,379 identified secrets remain active, whether anyone outside the repository owners obtained or used them, or whether affected organizations have completed remediation. Apiiro said it did not test the secrets’ validity. One company notified by researchers confirmed its key was live, but that case does not establish the status of the others.
The findings cover public copies located by Apiiro’s search and the categories its analysis examined. The source material does not give a complete account of how many files may exist in private repositories, local machines, package archives, Docker images or synced folders. Apiiro warned that copies outside GitHub can also persist, but the scale of those copies is not quantified in the report.
Rotate Credentials Before Cleanup
Apiiro recommends that developers and security teams first rotate every password, token and key that may have appeared in the files, including values in older versions, before removing or rewriting repository history. Teams should search repositories and Git history for .claude/settings.local.json and .claude/settings.json, then remove tracked local settings, add the local file to the project’s .gitignore, and delete rules containing secrets from developers’ machines.
To reduce the chance of repeat exposure, the researchers advise keeping credentials out of command text. Commands can refer to variables such as $DB_URL that are populated from a secrets manager, and users can approve suitable command patterns rather than exact commands containing credential values. Teams should also consider copies in agent folders, archives, containers and synced directories, since removing a public GitHub copy does not remove those other locations.
The source report does not describe an announced Anthropic fix or a deadline for changes. The next key developments are whether affected organizations rotate exposed credentials, whether Anthropic changes how approved commands are stored, and whether additional affected copies or confirmed misuse are reported.
Key Questions
What file did Apiiro find on GitHub?
The main file was .claude/settings.local.json, a Claude Code project settings file that can store command allow rules. Apiiro also reported secrets in some shared .claude/settings.json files, older versions and saved agent chat logs.
How can a password end up in the file?
When a user approves a command with “Yes, and don’t ask again,” Claude Code can save an allow rule. If the rule records an exact command that contains a password or token, Apiiro says that secret can be retained in plain text.
Were all the exposed credentials still valid?
That is not known. Apiiro said it did not test whether the identified secrets still worked. One company notified by the researchers confirmed its key had been live.
Does deleting the file remove the exposure?
No. A committed file may remain in Git history and repository forks after it is deleted from the current version. Apiiro also warned that copies may remain in local folders, archives, containers or synced storage.
What should developers do first?
Apiiro recommends rotating affected credentials before cleanup, then searching repositories and their history, removing tracked settings files, adding the local file to the project’s .gitignore, and deleting secret-containing rules from local copies.
Source: thehackernews.com
