# Claude Code settings files leak secrets on public GitHub repos

Digest AI · Generative AI & Models · published 2026-11-09T17:24:26Z · updated 2026-11-10T10:46:00Z

Canonical: https://digestai.news/story/claude-code-settings-files-leak-secrets-on-public-github-repos

## Summary

AI security researchers at Apiiro have identified a significant security flaw in Anthropic's Claude Code. The tool stores user approvals for automated shell commands in a local file named `.claude/settings.local.json`. When users select "Yes, and don't ask again" for a command, the full command text, including any embedded sensitive data like API tokens or database passwords, is saved to this file.

Although Anthropic's documentation states that this file should be added to the global `.gitignore` list to prevent public sharing, this protection does not apply at the repository level. Consequently, if a developer clones a repository to another machine or converts a folder into a new repository, the settings file can be accidentally committed and pushed to public GitHub instances. Apiiro notes that Claude Code often commits these changes automatically without explicit user input for each commit.

The researchers found over 100,000 instances of this local settings file uploaded to public GitHub repositories. Of these, approximately 1,100 files from 63 different organizations contained active secrets, including private keys and root logins. Even after the original files are removed, the sensitive data may persist in forks of the affected projects, posing a continued risk to the involved organizations.

## Key points

- Apiiro found over 100,000 Claude Code settings files uploaded to public GitHub repositories.
- About 1,100 files from 63 organizations contained secrets like API tokens and database passwords.
- The global .gitignore setting does not prevent accidental commits at the repository level.

## Why it matters

This vulnerability exposes sensitive credentials for hundreds of organizations, highlighting a gap in how AI coding assistants handle local configuration files and version control integration.

## Sources

1. [Claude Code is accidentally exposing secrets all over GitHub](https://arstechnica.com/ai/2026/11/claude-code-settings-files-expose-thousands-of-secrets-on-github) (Ars Technica AI, 2026-11-09)
2. [AI Coding Agents Leak Thousands of Secrets to GitHub](https://darkreading.com/cyber-risk/ai-coding-agents-leak-secrets-github) (darkreading.com, 2026-11-10)
3. [Claude Code's "don't ask again" button is leaking passwords and API keys to public GitHub repos](https://techspot.com/news/114500-claude-code-dont-ask-again-button-leaking-passwords.html) (techspot.com, 2026-11-10)
4. [Claude Code’s “don’t ask again” button leaked secrets to GitHub](https://tbreak.com/claude-code-secrets-github) (tbreak.com, 2026-11-10)

Part of the developing story: [Claude Code Security Flaws and Data Leaks](https://digestai.news/thread/github-flags-9-fake-claude-codex-npm-packages) (5 stories)

## Cite

Digest AI, "Claude Code settings files leak secrets on public GitHub repos", 9 November 2026, https://digestai.news/story/claude-code-settings-files-leak-secrets-on-public-github-repos

---

Written by Digest AI's editorial model from the linked sources; the sources are the record. Headlines, digests and key points are written by Digest AI and may be quoted with a link to the story page. Linked articles belong to their publishers. Terms: https://digestai.news/terms#reuse
JSON: https://digestai.news/story/claude-code-settings-files-leak-secrets-on-public-github-repos.json
