BriefingDev tools

Claude Code's 'don't ask again' option is leaking secrets into public GitHub repos

Apiiro found over 100,000 public Claude Code settings files on GitHub, about 1,100 of them containing secrets such as passwords and API keys; Anthropic's Boris Cherny says the team is looking into fixes.

Image: Ars Technica
Curated by Javier DíazWritten with Claude · Thu 5 Nov, 23:17 · 3 min read · briefed from 4 sources

In context

  1. 01Apiiro found over 100,000 public GitHub repos containing Claude Code's local settings file; about 1,100, from 63 organizations, held secrets such as API tokens, database passwords or private keys.
  2. 02Choosing 'Yes, and don't ask again' stores the approved command in .claude/settings.local.json, often verbatim, including any embedded credentials.
  3. 03Of the roughly 1,100 exposed secrets, 215 were missed by the scanners gitleaks and TruffleHog, according to Apiiro.
  4. 04Claude Code's Boris Cherny said the team is 'looking into what we can do to prevent this' and is considering built-in secret scanning.
  5. 05A separate GitHub issue claims Claude Code put users' email addresses in User-Agent headers; a contributor says a built-in privacy mod in v2.1.317 and later blocks this.

What happened

Security researchers at Apiiro have found that Claude Code's permission system is leaving sensitive credentials in public GitHub repositories. The firm found more than 100,000 cases where the tool's local settings file had been uploaded to a public repo. About 1,100 of those, from 63 organizations, contained secrets including public API tokens, database passwords and private keys.

The mechanism is the 'Yes, and don't ask again' option, which Claude Code offers when a user approves a shell command. That choice is saved as a rule in .claude/settings.local.json. The rule is sometimes written as a pattern, but the command is often stored as is, along with any secret embedded in it.

Anthropic's documentation says this file is added to the developer's global .gitignore, which normally keeps it out of repos. Per Ars Technica's summary of Apiiro's report, that protection is not applied at the repo level, so the file can be uploaded if a repo is cloned elsewhere or a folder becomes a repo later. Apiiro says Claude Code itself often commits changes to the file without user input. Secrets can also persist in forks after removal.

Why it matters

The exposure is hard to catch with standard tooling. Apiiro found that 215 of the roughly 1,100 secrets were not flagged by gitleaks and TruffleHog, two popular secret scanners, so teams relying on them alone could miss leaked credentials.

“looking into what we can do to prevent this”
Boris Cherny, Claude Code team

The problem is also not new. Ars Technica reports it was flagged in a Claude Code bug report as early as August 2025, and other reports noted the file was sometimes not added to .gitignore or that sensitive commands could land in another unprotected file. Those reports were closed without action after 60 days of inactivity.

Boris Cherny of the Claude Code team said on Hacker News that these files should almost never be checked in and that problems seemed to arise when 'the files were manually created and checked in.' He recommended auto mode, which uses classifiers instead of allow and deny lists, but acknowledged when a user pointed out that sensitive commands can still be saved to settings files in that mode.

What to watch

Cherny said the team is thinking through improvements and is considering building secret scanning into Claude Code. No timeline was given. Users who have committed the settings file should check their repos and forks and rotate any credentials that may have been exposed.

Claude Code faces a second privacy complaint on GitHub, where a user says the tool sent his email address in a User-Agent header. A contributor says a built-in mod, enabled by default in v2.1.317 and later, blocks this, though another commenter reported a gap on 2.1.319 involving shell commands.

Sources

  1. 01Claude Code sends your email address to websitesgithub.com · 5 Nov
  2. 02Claude Code's "Don't Ask Again" exposes passwords in 1,122 public GitHub filesapiiro.com · 7 Nov
  3. 03Claude Code is accidentally exposing secrets all over GitHubArs Technica · 9 Nov
  4. 04Grok Build coding agent leaks oodles of confidential info, some belonging to SpaceXSIArs Technica · 10 Nov

This briefing was written by Claude from the sources above. Check the original reporting before relying on it. How we work

Three times a week

The Context Briefing.

The most important AI news, analysis and ideas, briefed and sourced.