Skip to content
Sir CompareComparisons with evidenceYouTubeTelegram
United States · USD

News

Claude Code settings files: secrets found in over 100,000 public GitHub uploads

Updated

Illustrative photo: AI Tools & SaaS: Code on computer monitor (Unsplash)
Illustrative photo

What Apiiro found on public GitHub

Security researchers at Apiiro looked at Claude Code settings files sitting in public GitHub repositories. They found thousands of secrets inside them, including database passwords, API tokens and root logins. The researchers counted more than 100,000 cases where the local settings file had been uploaded to a public repo. Of those, about 1,100, spread across 63 organizations, held secrets such as public API tokens, database passwords or private keys. The file at the center of it is `.claude/settings.local.json`, stored on the user's own machine.

How a command ends up in the file

The leak traces back to how Claude Code handles approval for automated shell commands. When you pick "Yes, and don't ask again", that choice is saved as a rule in the local settings file. Sometimes the rule is written as a pattern. Often the command itself is written into the file as is, sensitive information included. On its own, that is not a big problem while the file stays on your machine. Anthropic's documentation says this settings file is added to the developer's global .gitignore list, which usually keeps it from being shared.

Why the .gitignore does not always hold

The global .gitignore setting is not reflected at the repo level. That means the sensitive file can still be uploaded by accident, for example if a repo is cloned to another machine or a folder becomes a repo later. Apiiro writes that in many cases Claude Code commits changes to the settings file without user input. Removing a file after it is found does not always end the exposure: the secrets can persist in forks of the original project if a GitHub user is not careful.

The bug reports and the team's response

The issue was flagged in a Claude Code bug report as far back as August 2025. Other reports noted that the sensitive file was sometimes not added to the .gitignore list, or that Claude Code could write the sensitive commands to another file not protected from git sharing. Those reports were closed without action after 60 days of inactivity. In a Hacker News thread, Claude Code's Boris Cherny said the team is looking into ways to prevent it. He said these files should almost never be checked in to git source control, and that such cases seemed to come up when files were created and checked in by hand.

What Cherny suggests, and where it falls short

Cherny recommended Claude Code's auto mode, which uses classifiers to route routine permission prompts without manually keeping allow and deny lists. When another user pointed out that sensitive commands can still be saved to settings files in auto mode, Cherny called it a good catch and said the team is thinking about improvements. He also suggests secret scanners, which trawl files for sensitive data and scrub it out, and said the team was considering building that scanning into Claude Code later. Apiiro found that 215 of the roughly 1,100 public secrets in these files were not flagged by two popular secret scanners.

Related coverage

Source: Ars Technica · AI

Hardware to try AI at home

Affiliate links: we may earn a commission from qualifying purchases, and it never changes our data or rankings. They open Amazon's search results: prices and availability are shown there.

Video

What changed

  • Page updated

How I put products in order

Sir Compare’s letter

Updates on AI tools & SaaS? I’ll send them your way.

Pick what you care about: I only write when something new comes out — a guide, a news story, a verified price that drops.

Step 1 of 2

What are you into?

Pick as many as you like. Pick none and you get what’s new in every section.

What you want to receive
  • Only what you pick
  • Never an empty email
  • One click to leave

Your assistant

Open full page →