Researchers at Apiiro discovered that Anthropic's Claude Code AI coding assistant is inadvertently exposing sensitive credentials on public GitHub repositories through its local settings file, ".claude/settings.local.json." The issue arises when users select "Yes, and don't ask again" to approve automated shell commands; this approval creates a rule stored in the local file that often captures the raw command string, including embedded secrets such as database passwords, API tokens, and private keys. While Anthropic configures a global .gitignore entry to exclude this file by default, the protection fails at the repository level. Consequently, the file is frequently committed accidentally when a repository is cloned to a new machine, a folder is initialized as a repo later, or when Claude Code itself commits changes autonomously. Apiiro identified over 100,000 public GitHub repositories containing the settings file, with approximately 1,100 instances across 63 organizations leaking active secrets. Remediation is complicated by the persistence of exposed credentials in repository forks even after deletion from the upstream source.

Read original