Claude Code settings files reveal thousands of secrets on GitHub
Apiiro found thousands of exposed secrets in Claude Code local settings files stored in public GitHub repositories. The leak begins when developers approve shell commands with Yes, and don't ask again, causing commands containing passwords, tokens, or root logins to be retained in .claude/settings.local.json. Although Anthropic says the file should be globally ignored by Git, real-world repositories still embedded it, turning a convenience feature into a credential exposure risk.
Key Takeaways
- Researchers found thousands of sensitive secrets in Claude Code settings files exposed through public GitHub repositories.
- The file `.claude/settings.local.json` can store approved shell commands verbatim, including database passwords, API tokens, and root logins.
- The “Yes, and don’t ask again” approval feature creates a leak path by retaining command text containing secrets.
- Although Anthropic says the file is normally ignored by Git, the reported cases show this protection is not absolute in practice.
Meta description: Apiiro researchers say Claude Code settings files can store approved shell commands with secrets, leaking them when repositories are published on GitHub.
Tags: Claude Code, Apiiro, GitHub, Secrets Management, AI Developer Tools
Featured image: Abstract technology-style composition of configuration files and redacted credential blocks, with no people, company logos, or text.
A Claude Code secrets leak has come to light after Apiiro’s AI security researchers reported discovering thousands of sensitive credentials in Claude Code settings files embedded in public GitHub repositories. The reported findings include database passwords, API tokens, and root logins. Those are the kinds of values that can grant access to databases, APIs, or privileged systems, which is why their presence in public code is a security concern rather than a minor configuration detail.
Background: a settings file becomes a credential carrier
Claude Code is an AI developer tool that can run automated shell commands after receiving user approval. Apiiro’s research centers on a partial oversight in how the tool’s settings files are handled, not on the underlying language model. The file at the center of the report is ".claude/settings.local.json", a local settings file created during use of the tool.
The research describes the issue as a leak path that depends on where that file ends up. If it remains only on the user’s machine, the report treats it as not really a significant security issue, assuming the machine itself is not compromised. The situation changes when the file is embedded in a GitHub repository, because repository content can become publicly visible.
How the exposure begins: approval rules preserve command text
The mechanism is tied to Claude Code’s approval flow for automated shell commands. When a developer selects "Yes, and don't ask again" to allow a command to run, the tool stores that decision as a rule inside ".claude/settings.local.json".
Some rules can be expressed as patterns, which may abstract away exact command text. But the report says the command itself is often written into the settings file as is. If that command line already contains a database password, an API token, or a root login, the sensitive value becomes part of the stored rule. The leak is therefore created by retention: the approval mechanism keeps what it saw in order to avoid future prompts.
Documentation and the role of .gitignore
Anthropic notes in its Claude Code documentation that ".claude/settings.local.json" is added to the developer’s global .gitignore list. A .gitignore list tells Git which paths should normally be excluded from version control. The documentation presents this as a safeguard that usually prevents the file from being shared publicly.
The Apiiro finding shows that the safeguard is not absolute in practice, because the researchers reported secrets amid settings files embedded in GitHub repositories. The available text does not describe the precise repository workflow that led to that outcome, so the key fact is the gap between intended local-only handling and observed public exposure.
What to watch next
The report establishes several concrete details: Apiiro as the source, thousands of secrets, specific credential types, the ".claude/settings.local.json" path, the "Yes, and don't ask again" approval option, and the .gitignore protection described by Anthropic. It does not, in the provided material, quantify affected repositories or identify a vendor response.
What to watch is whether further technical detail explains how the settings files became embedded in public GitHub repositories and whether additional guidance emerges from Anthropic or Apiiro. For readers, the episode is a practical illustration that developer tools can turn convenience features into security-sensitive artifacts when local configuration files move into shared code.
Comments
No comments yet. Be the first to comment.