Claude Code's "Don't Ask Again" exposes passwords in 1,122 public GitHub files
An incident with Anthropic’s Claude Code agent highlights how its “Don’t Ask Again” permission feature can end up saving shell commands containing passwords or API keys into `.claude` settings files that some users then commit to GitHub, exposing secrets in at least 1,122 public repositories. Commenters argue over how much blame lies with the tool versus poor developer hygiene, noting that secrets have long been leaked via version control but that AI agents amplify the risk by automating complex, opaque actions. The thread widens into a broader debate on whether to rely on Claude’s “auto mode” and similar safeguards, or to insist on stricter sandboxing, explicit permission rules, secret scanners, and other deterministic controls around AI-assisted coding.
What the leak involves
- Leak path: “Don’t ask again” stores full approved commands (including inline secrets) in
.claude/settings.local.jsoninside the project tree. - If that file (or
.claude/settings.json) is committed and pushed to a public repo, secrets become globally accessible; in private repos they still spread internally and can leak if the repo later goes public. - Thread notes 1,000+ such files found in public GitHub repos, often with real API keys, DB passwords, etc.
- Some confusion over “public”: one comment points out the files are only public if the repo is.
Is this a Claude bug or user error?
- One side: this is mostly classic user error — checking secrets into source control.
.claude/settings.local.jsonis documented as “local only” and is auto-added to global.gitignorewhen created by the tool; many leaked files were apparently created or committed manually. - Other side: writing secrets into a project file at all is a dangerous design; relying on gitignore is fragile (new machines, copies, tracked files). “One click shouldn’t put passwords in files people commit.”
- Unclear: extent to which Claude itself added/committed the files vs users; the article claims hundreds of commits co-authored by the agent.
Git practices and secret management
- Recurrent themes:
- Don’t use
git add ./ “commit everything”. - Review diffs and do PR reviews.
- Use secret scanners (GitHub Advanced Security, git-secrets, gitleaks) and/or encrypted storage (git-crypt, Turbocrypt).
- Don’t use
- Some argue professionals should already know “never put secrets in repos”; others note many new “vibe coders” and non-experts don’t.
Auto mode vs manual permissions
- Vendor messaging: permission rules are “old hat”; auto mode is claimed safer due to reduced “approval fatigue” and static/dynamic checks.
- Pushback:
- Auto mode is probabilistic, with no clear threat model or guarantees; can both block safe commands and miss dangerous ones.
- Some report auto mode deleting backups or blocking routine ops; others find it over-cautious around prod.
- Several want deterministic, configurable allow/deny rules plus sandboxing, not just an ML classifier.
Sandboxing and operational security
- Many advocate strong isolation: containers/VMs, separate system user, read-only
.git, no access to$HOME, env, or network, and secrets only via password-manager CLIs or dedicated “egress proxy” services. - Others argue most people will not sandbox heavily and instead rely on permissions, auto mode, and secret scanning.
Broader reflections
- Consensus that LLM agents greatly increase the blast radius of poor hygiene that already existed.
- Tension between the productivity dream of “hands-off agents” and the need to babysit them for security and correctness.