Skip to content

Code & dev Story

Claude Code settings files left over 1,000 secrets exposed on public GitHub repositories, Apiiro says

Security firm Apiiro reports that about 1,100 secrets from 63 organisations, among more than 100,000 Claude Code local settings files, were pushed to public GitHub repositories, as reported by Ars Technica in November 2026.

Published

This story was written with the help of artificial intelligence, checked automatically, then reviewed by an editor before publication, under our AI policy.

What Apiiro found

Security researchers at Apiiro discovered secrets in Claude Code settings files that had been published on GitHub. The material included database passwords, API tokens and root logins, according to Ars Technica's report.

Apiiro puts the scale at more than 100,000 instances of local Claude Code settings files sent to public GitHub repositories. Around 1,100 of them contained secrets, which came from 63 organisations. These figures are Apiiro's own findings; the report does not describe how the firm verified each secret.

How the files end up holding credentials

The mechanism is tied to a permission prompt. According to the Claude Code documentation, when a user picks "Yes, and don't ask again" for a Bash command, Claude Code writes the command to .claude/settings.local.json and records it as an allow rule.

The command can be stored as typed, which means any sensitive value embedded in it is saved with it.

The same documentation says the file is added to the global git exclusions the first time it is written, but only if the repository does not already ignore it. If a user creates the file by hand, they must add it to .gitignore themselves. The sources do not say which of these cases accounts for the exposed files.

Scanner gaps

Apiiro also says that 215 of the roughly 1,100 public secrets were not detected by the scanners gitleaks and TruffleHog. The report does not explain why those secrets escaped detection.

An earlier report and the vendor response

Ars Technica reports that the problem had been raised in a Claude Code bug report as early as August 2025. Those reports were closed without action after 60 days of inactivity.

Boris Cherny, of the Claude Code team, said on Hacker News that the team is "looking into what we can do to prevent this". According to Ars Technica, he also recommended Claude Code's auto mode, while acknowledging that sensitive commands can still be saved to settings files in that mode, which he called a "good catch".

No fix or timeline had been announced in the material available.

Wider context

Ars Technica places the finding alongside another agent-related exposure: Meta suspended sharing for its Muse agent the previous month after researchers showed that its link URLs could be guessed easily. The two cases are separate.

On the file itself, the Claude Code documentation says that a user who creates .claude/settings.local.json by hand must add it to .gitignore themselves.

Key figures reported by Apiiro on Claude Code settings files
MetricFigure
Local settings files sent to public GitHub reposMore than 100,000
Files containing secretsAbout 1,100
Organisations affected63
Secrets missed by gitleaks and TruffleHog215

FAQ

Which file is involved?

The local file .claude/settings.local.json, where Claude Code stores approved Bash commands as allow rules.

What triggers the storage of a command?

Choosing "Yes, and don't ask again" when approving a Bash command, according to the Claude Code documentation.

Does git ignore the file automatically?

Only partly: it is added to global git exclusions on first write if the repository does not already ignore it. A hand-created file must be added to .gitignore by the user.

Did secret scanners catch everything?

No. Apiiro says 215 of about 1,100 secrets were missed by gitleaks and TruffleHog.

Sources

  1. Claude Code is accidentally exposing secrets all over GitHub, Ars Technica,
  2. https://code.claude.com/docs/en/settings, code.claude.com, (primary source)

Plain text version (Markdown)