
Key points
- Apiiro researchers identified over 100,000 public GitHub repositories containing Claude Code settings files.
- About 1,100 of those files from 63 organizations contained sensitive secrets like API tokens and passwords.
- The leak occurs because the tool saves approved shell commands, including embedded secrets, to a local file.
The figures
Apiiro security researchers reported finding more than 100,000 instances where Claude Code’s local settings file was uploaded to public GitHub repositories.reported Within that large set, approximately 1,100 files originating from 63 distinct organizations contained actual secrets.reportedThe tool saves your approved commands to a file that can accidentally get uploaded to the public web.The lack of repository-level .gitignore enforcement allows .claude/settings.local.json to be committed, exposing embedded secrets. These secrets included database passwords, API tokens, and root login credentials. The data comes from a report by Ars Technica, which cited findings from Apiiro.
Behind the figures
The exposure stems from how Claude Code manages user approval for automated shell commands. When a user selects the option to approve a command and not be asked again, the choice is stored in a local file named .claude/settings.local.json. This file often contains the command itself, including any sensitive information embedded within it. Anthropic’s documentation notes this file should be in the global .gitignore list, but that setting does not apply at the repository level.
The bottom line for teams
Teams face risks when repositories are cloned to other machines or when folders become repositories later, as the global ignore rule may not prevent uploads. Apiiro noted that Claude Code sometimes commits changes to the settings file without user input. Even after removal, secrets can persist in forks of the original project if users are not careful. This means simple deletion does not guarantee the secret is gone from the internet.
The open questions
The core issue is whether the tool’s automatic behavior overrides standard security hygiene. The sources indicate that while Anthropic documents the file should be ignored, the implementation allows it to be committed. Bug reports from August 2025 flagged this issue, noting the file was sometimes not added to .gitignore or that commands were added to unprotected files.reported These reports were closed without action after 60 days of inactivity, suggesting the issue persisted despite early warnings.reported
Why it matters
- Startup founders must audit their GitHub repositories for .claude/settings.local.json files to prevent credential leaks.
- The persistence of secrets in forks means that removing a file from the main repo is insufficient for cleanup.
- Automatic commits by the AI tool can bypass manual checks, requiring stricter repository policies.
- The closure of prior bug reports without action highlights a gap in vendor response to configuration flaws.
Topics: Claude Code, Anthropic, GitHub, API security, configuration management
Updated
Then / now / next
Claude Code settings files were intended to stay local and be ignored by git.
Over 100,000 of these files have been uploaded to public GitHub repositories.
Teams should check for persisted secrets in forks after removing compromised files.
Story timeline
- Then Claude Code settings files were intended to stay local and be ignored by git.
- 09 Nov 2026 Claude Code is accidentally exposing secrets all over GitHub
- Now Over 100,000 of these files have been uploaded to public GitHub repositories.
- Next Teams should check for persisted secrets in forks after removing compromised files.
For readers
Developers
- Check your global .gitignore to ensure .claude/settings.local.json is excluded.
- Review committed history for accidental uploads of sensitive commands.
Business
- Audit GitHub repositories for exposed API tokens and database passwords.
- Implement policies to prevent AI tools from committing configuration files.
Researchers
- Note that secrets persist in forks even after removal from the main repo.
- Observe that bug reports from August 2025 were closed without action.
Ask the article
Local keyword search of this article; no generated answers.Did this article give you the evidence you needed?
Your choice stays on this device. No public tally.Questions readers ask
How does Claude Code leak secrets to GitHub?
It saves approved shell commands, including embedded credentials, to a local settings file that can be accidentally uploaded.
How many secrets were found in the study?
Apiiro found about 1,100 files with secrets from 63 organizations among over 100,000 uploaded settings files.
Did Anthropic fix this issue?
The source material does not confirm a fix; it notes bug reports were closed without action after 60 days.
Connected stories
Reading receipt
- Apiiro researchers identified over 100,000 public GitHub repositories containing Claude Code settings files.
- About 1,100 of those files from 63 organizations contained sensitive secrets like API tokens and passwords.
- The leak occurs because the tool saves approved shell commands, including embedded secrets, to a local file.
Still open: Will Anthropic update the tool to prevent automatic commits of settings files?
Still open: How many forks still contain the exposed secrets after initial removal?