---
title: "Claude Code Leak: Over 104,000 Config Files Expose Live Secrets on GitHub"
date: 2026-11-12T15:45:00Z
modified: 2026-11-12T14:19:33Z
permalink: "https://worklumo.com/claude-code-settings-leak-github-secrets/"
type: post
status: publish
excerpt: Security research reveals active cloud tokens leaked by Claude Code inside GitHub repos. How to audit settings.local.json and rotate keys now.
wpid: 2998
categories:
  - Digital Trends
tags:
  - Digital Trends
  - AI Coding Agents
  - AI developer tools
  - Claude Code
  - Cybersecurity
  - GitHub Security
_wl_seo_title: Claude Code Leak Exposes Active Secrets on GitHub
_wl_meta_description: Security research reveals active cloud tokens leaked by Claude Code inside GitHub repos. How to audit settings.local.json and rotate keys now.
_wl_canonical_url: "https://worklumo.com/claude-code-settings-leak-github-secrets/"
featured_image: "https://worklumo.com/wp-content/uploads/2026/11/claude-code-settings-leak-github-secrets-scaled.webp"
author: Worklumo Editorial Team
timestamp: 2026-11-12T14:19:33Z
---

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](https://dev.to/cole_halton_42f71d71b809b/the-claudesettingslocaljson-gitignore-stops-working-the-moment-the-file-is-tracked-4acn) 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](https://code.claude.com/docs/en/settings), 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 standard `git add .` immediately stages the file.
- **Git Ignores Untracked Files Only:** As defined in the [official Git SCM specification](https://git-scm.com/docs/gitignore), gitignore rules have zero effect on files that are already tracked in the index. Once `.claude/settings.local.json` is 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](https://worklumo.com/best-ai-coding-agents/?output_format=md) and explore [enterprise PII and secret redaction tools](https://worklumo.com/best-ai-pii-redaction-tools-llm/?output_format=md) 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.json` or shared team `settings.json` files.
- **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](https://registry.npmjs.org/@anthropic-ai/claude-code) 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:

1. **Audit Tracked Settings Immediately:** Run `git ls-files --error-unmatch .claude/settings.local.json` at your repository root. If tracked, assume all credentials previously passed to Claude Code in that project are compromised.
2. **Revoke and Rotate at the Provider Level:** Deleting the file or running `git rm --cached` does not neutralize the threat. Automated scrapers mirror public GitHub commits within seconds. Revoke every exposed secret at the upstream cloud or database provider immediately.
3. **Enforce Repository-Level `.gitignore`:** Add `.claude/` explicitly to every project’s root `.gitignore` file. Never rely on individual workstation global ignores for corporate security.
4. **Adopt Ephemeral Secrets and Zero Trust Vaults:** Transition away from inline CLI tokens. Utilize centralized secrets management architectures—such as [enterprise credential vaults](https://worklumo.com/best-bitwarden-alternatives/?output_format=md) 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](https://worklumo.com/ai-developer-tools-innovation/?output_format=md) 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)](https://dev.to/cole_halton_42f71d71b809b/the-claudesettingslocaljson-gitignore-stops-working-the-moment-the-file-is-tracked-4acn)
- [Anthropic Claude Code Official Documentation: Settings & Global Excludes](https://code.claude.com/docs/en/settings)
- [Anthropic Claude Code Official Documentation: Permissions & Allow Rules](https://code.claude.com/docs/en/permissions)
- [Git SCM Documentation: gitignore Pattern Matching & Tracked Files Specification](https://git-scm.com/docs/gitignore)
- [npm Registry: @anthropic-ai/claude-code Version & Release History](https://registry.npmjs.org/@anthropic-ai/claude-code)