Skip to content
Ars Technica·

🔐Claude Code Leaks Secrets From 100,000+ Public GitHub Repos Via Settings Files

Check your .claude folder before your next push

TL;DR

Claude Code saves approved shell commands into a local settings file, and that file keeps getting pushed to public GitHub repos. Researchers found over 100,000 uploads, with about 1,100 exposing real secrets from 63 organizations. If you use Claude Code, audit your repos today.

Claude Code is leaking sensitive data onto public GitHub, and the cause is a settings file most developers assume is safe. When you pick "Yes, and don't ask again" on a shell command, Claude Code writes that command into .claude/settings.local.json, often with API tokens or passwords still inside it. Here's the trap. Most people add that file to their global .gitignore, but the protection doesn't carry over to the repo level, so it slips into commits. Claude Code will also commit changes to that file on its own in many cases. If you use Claude Code on any project that touches public GitHub, this is your problem, even if you never meant to share anything. Researchers at Apiiro found more than 100,000 repos with the local settings file uploaded publicly. About 1,100 of those contained real secrets, including public API tokens, database passwords, and private keys, spread across 63 organizations. Worse, 215 of those secrets slipped past two popular scanners, gitleaks and TruffleHog. Deleting the file doesn't fully fix it either, since forks can keep the secrets alive. The kicker: this was flagged in a Claude Code bug report back in August 2025. Those reports were closed without action after 60 days of inactivity. Claude Code says it's considering built-in secret scanning, but nothing is shipped yet. Its newer auto mode doesn't solve it either, since it can still save sensitive commands to settings files.

Claude Code Leaks Secrets From 100,000+ Public GitHub Repos Via Settings Files — Ars Technica

Key Points

1

Researchers found over 100,000 public GitHub repos containing Claude Code's local .claude/settings.local.json file, many of them uploaded without the developer noticing or intending it.

Keep reading — it's free

Enter your email to keep reading — plus the best of AI & tech, daily. Free, forever.

Also get
or

Already a member? Sign in

Claude CodeGitHubSecrets ManagementSecret ScanningAI Agents

Comments

Subscribe to join the conversation...

Be the first to comment