Skip to content
Zenteck
Latest
Analysis

Are Claude Code Settings Secretly Ditching Your Passwords on GitHub?

ByAlex Silva2 min read0 comments
claude-code-leaks-secrets-to-public-github
Photo: ZenteckClaude Code leaks secrets to public GitHub

Listen to article0:00 / 0:30

Using AI coding assistants can drastically speed up software development, but it also introduces quiet risks to your infrastructure. According to a report by Ars Technica, researchers at Apiiro discovered thousands of local settings files generated by Anthropic's Claude Code exposed on public GitHub instances, containing sensitive data like database passwords and API tokens.

Why is Claude Code leaking your data?

The core issue lies in how Claude Code handles user permissions for automated shell commands. When developers select the "Yes, and don't ask again" option, the tool logs the exact command and pattern into a local .claude/settings.local.json file on the user's machine.

While Anthropic instructs users to keep this file out of source control via global ignore lists, the protection frequently fails. The setting often does not apply at the repository level, or Claude Code itself automatically commits changes to settings files without active developer oversight. Out of more than 100,000 scanned public repositories containing these local config files, Apiiro identified roughly 1,100 instances across 63 organizations exposing active credentials.

How to protect your repositories on Monday morning

If your development team relies on AI agents in the terminal, you need to audit your project structures immediately to prevent credential leaks. Standard scanners may not catch every instance.

  • Manually check your repository root directories for hidden .claude folders or local settings files that might have been tracked.
  • Review your project-level .gitignore files and ensure local AI configuration files are explicitly excluded in every active repository.
  • Do not rely entirely on automated secret scanners; Apiiro found that popular tools like Gitleaks and TruffleHog failed to flag nearly 20% of the secrets hidden inside these specific settings structures.
  • Switch to cleaner permission workflows like Claude Code's auto mode to minimize manual rule logging, but remain vigilant about what gets stored in background system logs.

Is it time to ditch local AI coding agents?

Veredito: Claude Code remains a powerful utility for accelerating development tasks, but it demands strict operational hygiene. Security oversights in background config files prove that convenience can easily compromise perimeter defense if teams treat local AI outputs as completely safe by default.

Sources

  1. Claude Code is accidentally exposing secrets all over GitHub — arstechnica.com

Frequently asked questions

How do secrets end up in Claude Code settings files?
When you approve shell commands using the 'don't ask again' option, Claude Code frequently writes the raw command—including embedded passwords or API tokens—directly into local configuration files.
Do standard secret scanners catch these leaks?
Not always. Security researchers found that popular tools like Gitleaks and TruffleHog failed to detect a significant portion of the sensitive data stored inside these specific JSON settings files.

AI Briefing in 3 Minutes

Get what actually matters in AI & tech delivered free to your inbox. Zero spam, 1-click unsubscribe.

By subscribing, you agree to our Privacy Policy.