Full Report
IT之家 November 10 news, the tech media outlet Ars Technica published a blog post yesterday (November 9), pointing out that the AI coding agent Claude Code is accidentally exposing some developers' sensitive credentials to public GitHub repositories.
Researchers at the security firm Apiiro found that more than 100,000 Claude Code local settings files had been uploaded to public repositories, of which about 1,100 files contained confidential data such as database passwords, API tokens, private keys, or root login information. Combining Git history, shared settings files, and agent chat logs, a total of 2,539 real credentials were identified across 1,994 code repositories.
The affected parties include 63 organizations, covering student teams, startups, software agencies, and established vendors. The leaked content involves Azure database passwords, Square production tokens, SSH root login information, and even the owner password of a medical records database. IT之家 attaches the relevant information below:

Large allowlists drive up the leak rate. One in every ten files larger than 8 KB contains a real secret, while among files smaller than 500 bytes, that proportion is less than one in five hundred. The longer developers take to click "Don't ask again," the more secrets the files contain.

The root of the problem lies in how Claude Code handles authorization for "automatically executing commands." When the tool asks the user whether to allow a certain Shell command to run, if the user selects "Yes, and don't ask again," that authorization rule is written into the local .claude/settings.local.json file; and the original command text, including any passwords, tokens, or keys it may carry, may also be recorded along with it.

By design, this settings file should be added to the developer's global .gitignore and usually would not be committed along with the code. However, this setting does not necessarily apply to a specific repository: when a project is cloned to another computer, or when an ordinary folder is only later initialized as a Git repository, sensitive files may be mistakenly uploaded.

The research also claims that Claude Code sometimes commits settings file changes to the repository on its own without user confirmation. More troublesome still, even if the original repository deletes the leaked files, if other users have already created forks, the keys may continue to persist.
This risk is not the first time it has been discovered. As early as August 2025, bug reports for Claude Code pointed out that the relevant settings files might not be correctly added to .gitignore, or that sensitive commands were written into other files not protected by Git rules; these reports were later closed due to 60 days of inactivity.
Boris Cherny of the Claude Code team responded on Hacker News on November 7, saying that the team is working on preventive measures and that settings files should never have been committed to version control. He also recommended that users use secret-scanning tools to clean up sensitive information, and said that the team is considering building secret-scanning functionality into Claude Code.
