AILINCOM 
Crius
A cybersecurity study has uncovered the leak of thousands of passwords, API keys, and other credentials through public GitHub repositories. The root cause was a feature in Anthropic’s Claude Code tool, which saves approved shell commands—including sensitive data—in a local settings file.
Claude Code stores user-approved shell commands in the .claude/settings.local.json file. If a command contains a password or token, that information is also written to the file. Ideally, this file should remain only on the developer’s local device, and the tool adds it to the global .gitignore to prevent it from being uploaded to repositories. However, this protection doesn’t always work—for example, when cloning a project to another computer or later converting a folder into a repository. In some cases, the tool itself may have committed changes to this file.
Analysis revealed over 104,000 copies of the settings file in public GitHub repositories, with 1,122 containing real secrets. Researchers identified 2,539 unique credentials across nearly 2,000 repositories, including database passwords, cloud service keys, API tokens, and private SSH keys. Some affected repositories belonged to companies, software developers, and service providers.
Current security scanners like Gitleaks and TruffleHog failed to detect 215 out of 1,122 files containing secrets. Detecting passwords embedded in regular command lines proved especially challenging.
Anthropic is considering changes to prevent further leaks, such as implementing built-in secret scanning and modifying how command approvals are handled. Developers are advised to use security scanners and ensure that local settings files are not included in repositories.
It is recommended to check whether the .claude/settings.local.json file was accidentally committed to public repositories and to remove any exposed credentials. Simply deleting the file is not enough, as information may remain in the Git history or project forks. If a leak is discovered, all potentially compromised passwords and keys should be changed immediately.