Skip to content
AI Learning Ground Start learning

News ·

Claude Code is accidentally exposing secrets all over GitHub

Claude Code's local settings file, which stores approved commands containing embedded credentials, has been pushed to public GitHub repos, exposing over 1,100 secrets across 63 organizations.

Claude Code is accidentally exposing secrets all over GitHub
Image: Ars Technica

Security researchers at Apiiro found Claude Code settings files uploaded to public GitHub repositories, with roughly 1,100 files from 63 organizations containing secrets like API tokens, database passwords, and private keys. Over 100,000 instances of the settings file appearing publicly were identified overall.

The problem stems from how Claude Code records user approvals. Choosing 'Yes, and don't ask again' saves a rule to the local .claude/settings.local.json file, and the approved command is often stored verbatim, including any credentials it contained. Anthropic's documentation says this file is added to the developer's global .gitignore, but that protection does not apply at the repo level. If a repo is cloned elsewhere, a folder later becomes a repo, or Claude Code itself commits the file, the settings can end up on GitHub. Even removal from a repository does not fully help, since secrets can persist in forks.

Claude Code lead Boris Cherny said on Hacker News that the team is looking into prevention measures, noting these cases appeared to involve files that were manually created and checked in. He recommended using auto mode and secret scanners, though Apiiro found 215 of the exposed secrets were missed by gitleaks and TruffleHog. Related bug reports, some dating to August 2025, were closed after 60 days of inactivity. Anthropic is considering adding built-in secret scanning. Builders using agentic coding tools should verify that local approval and settings files are excluded from version control and scan repos for embedded credentials.

References

Read the full story at Ars Technica ↗Like, save or discuss on Buzz

#industry #analysis