On November 22, 2026, InfoQ highlighted security research from Apiiro (originally published November 5) alongside follow-up public scans from GitGuardian showing how Claude Code's convenient 'Yes, and don't ask again' command approval has leaked thousands of live credentials into public GitHub repositories and Docker Hub images.

Root Cause: Why .claude/settings.local.json Escapes into Public Repos

**Global Exclude vs. Repo .gitignore & Scanner Blind Spots: **When a developer clicks 'Yes, and don't ask again' on a shell command containing inline API keys, production passwords, or npm tokens, Claude Code saves the full command string as a permanent rule in .claude/settings.local.json. Although Claude Code adds that path to the developer's local global git exclude list, it never adds it to the repository's own .gitignore—so protection breaks if a folder is initialized as a Git repo later, cloned onto another machine, already tracked, or committed by Claude Code itself. Apiiro reported 1,122 secrets in .claude/settings.local.json files plus another 1,160 across Git history, shared settings.json files, and committed agent transcripts (impacting 63 organizations), noting that generic scanners like gitleaks and TruffleHog missed many credentials embedded inside shell arguments. GitGuardian corroborated the scale with 31,088 secrets found in .claude/settings.local.json on public GitHub (5,343 still valid at detection) and 613 more inside Docker Hub images. Even without a public push, storing plaintext credentials at the exact same path across every local project creates an easy target for workstation malware.

Figure 1 How Claude Code's 'Don't Ask Again' persists secrets and why generic scanners miss them (Apiiro & GitGuardian data)
Figure 1 How Claude Code's 'Don't Ask Again' persists secrets and why generic scanners miss them (Apiiro & GitGuardian data)

Image source: compiled by DigIntoAI from InfoQ (November 22, 2026) citing Apiiro and GitGuardian.

Four-Step Emergency Audit, Cleanup & Prevention Checklist

**Untrack, Rotate Every Historical Secret, Purge Local Rules & Switch to Env Vars: **Developers and teams using Claude Code should execute four concrete steps immediately: first, run git rm --cached .claude/settings.local.json, commit .claude/settings.local.json into the repository's own .gitignore (and exclude .claude/ in .dockerignore), and audit committed settings.json or transcript files; second, inspect both current files and full git log history and immediately revoke and rotate every credential that ever appeared—untracking alone never invalidates secrets already scraped from Git history or forks; third, open .claude/settings.local.json across local projects and delete any saved rule containing inline passwords or tokens, reserving 'Don't ask again' strictly for secret-free commands; and fourth, stop typing plaintext credentials into shell commands altogether—reference environment variables, secret managers, or short-lived OIDC/MCP gateways while suppressing verbose secret echoes from agent logs.

Figure 2 Four-step audit, credential rotation, and prevention checklist for Claude Code and AI coding agents
Figure 2 Four-step audit, credential rotation, and prevention checklist for Claude Code and AI coding agents

Image source: compiled by DigIntoAI from Apiiro and InfoQ remediation guidance.