Short answer: Security firm Apiiro found Claude Code local settings files in more than 100,000 public GitHub repositories. About 1,100 of them, from 63 organizations, contained secrets like API tokens, database passwords or private keys. If you use Claude Code, check your repos for .claude/settings.local.json.
When you approve a shell command with "Yes, and don't ask again", Claude Code saves a rule in .claude/settings.local.json. Sometimes the rule is a pattern. Often the full command is saved as is, including any password or token written in it.
Anthropic's documentation says this file is added to your global .gitignore. But that setting lives on your machine, not in the repo. If the repo is cloned to another computer, or a folder becomes a repo later, the file can be committed. Apiiro says Claude Code sometimes commits changes to this file on its own.
Boris Cherny from the Claude Code team said on Hacker News that the team is looking into prevention. He said the file should almost never be checked into git, and that the cases seem to come from files created and committed by hand. He suggested auto mode, though another user noted that sensitive commands can still be saved there, and Cherny said the team is thinking about it. Built-in secret scanning is being considered.
The issue was reported as a bug as early as August 2025, and those reports were closed after 60 days without activity.
Source: Ars Technica