Anthropic’s terminal assistant, Claude Code, is facing technical scrutiny after security research revealed that over 104,000 configuration files containing thousands of live database credentials, cloud tokens, and private API keys have been inadvertently committed to public GitHub repositories.
As documented in a detailed technical breakdown by security researcher Cole Halton analyzing Apiiro’s initial audit findings, the exposure originates from a routine developer convenience feature: the “Yes, and don’t ask again” permission prompt. When a developer grants recurring approval for shell commands containing inline credentials, Claude Code saves the exact command literal into a local file named .claude/settings.local.json, which frequently escapes local machines into public source control.
The Mechanics: Why Claude Code Secrets Escape Git Excludes
According to Anthropic’s official settings documentation, the tool attempts to isolate local configurations by appending **/.claude/settings.local.json to the developer’s global Git excludes file (either core.excludesFile or $XDG_CONFIG_HOME/git/ignore). However, this design contains critical architectural limitations:
- The Exclusion Is Global, Not Repository-Level: Global excludes live exclusively on that specific workstation. When a teammate clones the project, or when code runs on a CI/CD runner, no ignore rule exists in the repository’s own
.gitignore. A standardgit add .immediately stages the file. - Git Ignores Untracked Files Only: As defined in the official Git SCM specification, gitignore rules have zero effect on files that are already tracked in the index. Once
.claude/settings.local.jsonis committed once, subsequent approvals containing new secrets are recorded as unstaged modifications that are swept into future commits. - Secret Scanner Blind Spots: In automated scans of 104,185 public copies, 1,122 files held confirmed real secrets. Standard detection engines—such as Gitleaks (flagged 564) and TruffleHog (flagged 643)—missed 215 of these files (over 19%) because credentials like
PGPASSWORD=...inside CLI command arrays lack conventional provider token shapes.
Technical Context: As autonomous coding assistants assume greater shell autonomy, traditional secret management boundaries blur. If your engineering team is evaluating developer agents, review our benchmark on the 5 best AI coding agents and explore enterprise PII and secret redaction tools to protect local development loops.
AI Coding Assistant Security Matrix: Local Persistence & Leak Risks
Different developer tools adopt radically different strategies for persisting command authorizations and tool permissions. The following matrix illustrates how leading assistants manage execution state:
| AI Coding Tool | Config & History File | Approval Persistence | Secret Storage Vector | Default Ignore Mechanism |
|---|---|---|---|---|
| Claude Code | .claude/settings.local.json | Persistent allow-rules via CLI dialog | Plaintext shell strings in JSON arrays | Global ~/.config/git/ignore (Fragile) |
| Cursor | .cursorrules / SQLite DB | Per-workspace permission prompts | Separated system keychain & memory | Project-level .gitignore enforced |
| GitHub Copilot CLI | Session memory / Ephemeral | Requires explicit interactive confirmation | No persistent shell allow-lists | Zero repo-level config footprint |
| Aider | .aider.conf.yml / Git commits | User-confirmed git commit boundary | Requires explicit environment export | Relies on standard repo .gitignore |
Incident Impact: Scale of the Exposed Credentials
An audit across public GitHub repositories reveals the breadth of the issue across engineering groups:
- 104,185 Exposed Repositories: Over 104,000 public GitHub repositories currently track
.claude/settings.local.jsonor shared teamsettings.jsonfiles. - 2,539 Verified Secrets Across 1,994 Repositories: Verified active credentials include production PostgreSQL and MySQL connection strings, AWS IAM credentials, GitHub personal access tokens, and staging Kubernetes tokens.
- Legacy Installations Carry the Risk: Anthropic’s npm registry history shows that version 2.1.211 moved local settings to the repository root in July 2026. Because older configurations remain tracked in git histories, deleting the file does not remove it from historical commits.
CISO & Engineering Playbook: 4 Immediate Remediation Steps
Engineering leaders and developers using Claude Code should implement the following remediation protocol immediately:
- Audit Tracked Settings Immediately: Run
git ls-files --error-unmatch .claude/settings.local.jsonat your repository root. If tracked, assume all credentials previously passed to Claude Code in that project are compromised. - Revoke and Rotate at the Provider Level: Deleting the file or running
git rm --cacheddoes not neutralize the threat. Automated scrapers mirror public GitHub commits within seconds. Revoke every exposed secret at the upstream cloud or database provider immediately. - Enforce Repository-Level
.gitignore: Add.claude/explicitly to every project’s root.gitignorefile. Never rely on individual workstation global ignores for corporate security. - Adopt Ephemeral Secrets and Zero Trust Vaults: Transition away from inline CLI tokens. Utilize centralized secrets management architectures—such as enterprise credential vaults or runtime environment injection—to ensure developer assistants never ingest plaintext keys into shell buffers.
As autonomous AI tools integrate deeper into production software pipelines, developer productivity cannot come at the expense of perimeter security. Review our deep-dive on modern AI developer tools and engineering stacks to establish secure execution boundaries across your infrastructure.
Verified Sources & Primary Documentation
- Cole Halton: The .claude/settings.local.json gitignore stops working the moment the file is tracked (DEV Community)
- Anthropic Claude Code Official Documentation: Settings & Global Excludes
- Anthropic Claude Code Official Documentation: Permissions & Allow Rules
- Git SCM Documentation: gitignore Pattern Matching & Tracked Files Specification
- npm Registry: @anthropic-ai/claude-code Version & Release History







