Convenience Became a Credential Store: Claude Code's 'Don't Ask Again' Problem
The UX affordance is innocent: the agent asks permission, and because you're going to approve it again, you click "Yes, and don't ask again." The storage decision behind that click is less innocent. Apiiro's Shmulik Cohen and Matan Giladi have documented that when you pick that option in Claude Code, the agent writes the full approved command — exactly as typed, including any password or token on the command line — into .claude/settings.local.json in your project folder. Then a lot of those folders show up on public GitHub.
What Apiiro found
Scanning public GitHub for the file, Apiiro reports:
- 104,185 copies of
.claude/settings.local.jsonacross 103,617 public repositories. - 1,122 of those files (about 1.1%) contain at least one live secret. Those files hold 1,379 distinct current secrets.
- Including older versions, forks, chat logs, and the shared companion file
.claude/settings.json, the sweep rises to 2,539 secrets across 1,994 repositories at 63 owning organizations. - The breakdown includes 379 database passwords, 43 SSH logins, 42 GitHub/GitLab/npm tokens, and 23 AWS keys.
- Half of the affected repositories had the file for at least 217 days.
- 539 of 1,105 traced repositories had commits co-authored by Claude that changed the file — the agent itself wrote the allow-rule into the file that was then committed.
- 211 forks of 74 repositories carry the same secrets, and one organization Apiiro notified confirmed that its leaked key was still live.
Apiiro reproduced the behavior on current models — Opus 5.5 and Fable 5.1 — and reviewed 16 coding agents. Per Apiiro via The Hacker News, Claude Code is the only one confirmed to save the full approved command in a project file by default.
Why the mitigation Anthropic shipped doesn't hold
Anthropic documents the file and tells users the agent adds the path to the user's global git excludes so commits don't pick it up. Two gaps are visible in the public record:
- The user's global excludes don't help a repo that already committed the file. Public GitHub is full of repos that committed
.claude/settings.local.jsonbefore the global exclude existed, or committed it on a machine where it was never added. - The agent does not add the path to the project's own
.gitignore. A repo's own.gitignoreis what another developer on that project inherits when they clone, and it's what CI-side pre-commit hooks read. Leaving the exclude to a per-user setting pushes the burden onto every clone of the repo for the life of the repo.
A pre-existing bug report in the public Claude Code tracker — GitHub issue #5544, filed August 11, 2025 — flagged the behavior and was closed as "Not Planned" by an automated bot on January 3, 2026. Four related reports have since been closed by the same bot. The Hacker News reports no response from Anthropic to the Apiiro disclosure.
It fits a pattern
AI coding tools have shown a lot of trust surfaces this year: the project file the agent reads (the Rules File Backdoor against AGENTS.md/CLAUDE.md), the agent's release channel (the Oct 30 trojanized Claude Code Cursor Marketplace extension), and the agent's rendered-output and inter-device-coordination surfaces (ChatGPT Lockdown Mode bypass and the Claude Dispatch "ThisBash" chain).
"Don't Ask Again" adds the approval-persistence file — the one the agent uses to remember what you let it do. In Claude Code's current shape it stores not just "allow psql" but the exact command string you typed, which for a developer debugging a connection is routinely psql postgresql://user:password@host/db with the password in the URL.
A Nov 4 arXiv paper, Zhou and Zhang's "Rethinking Access Control for AI Agents", names this failure mode in its second principle: "Context is not authority." A one-time operator approval is context — the user wanted that one invocation to proceed. Persisting it into a project file turns that moment of context into standing authority, and the moment the repo is public, the authority is readable by everyone.
What this changes for operators
Three practical steps while this is still a fresh disclosure:
- Check your repos.
.claude/settings.local.jsonand.claude/settings.jsonin any public repository — including forks — are worth auditing. Gitleaks flagged 564 of the 1,122 files Apiiro found and TruffleHog flagged 643; neither flagged 215 of them. Secret-scanning coverage is per-tool-gap, so treat the file as a thing to grep directly rather than a thing your scanner will catch. - Scrub history, not just HEAD. GitHub's own guidance is the reference. Deleting the file in the current commit doesn't remove it from the history, and Apiiro found 734 additional secrets across 509 repositories when it scanned older versions.
- Rotate what was there, not what you think is interesting. For every leaked credential, treat the key as burned. A rotation is cheap; assuming it wasn't harvested is not.
What this changes for how we think about AI-tool safety features
A "don't ask again" button in an AI tool is not a UX choice. It's a persistence primitive. Where it writes the approval, how long it holds it, and what the agent's next collaborator (human or model) sees of it are security decisions. Every time the repo is cloned, forked, or opened in a new workspace, the approval travels with it, carrying whatever was typed next to the command.
For AI-coding-tool vendors, safety features need the same threat model the execution paths get. For defenders running these tools in production, the project folder is now a credential container unless proven otherwise.
The attackers didn't do the work on this one. The tool did it for them, and the repos were already public.
SPR{K3 is a security research operation that pairs offensive vulnerability research with runtime behavioral defense. Defend is our runtime agent. To talk about a deployment, reach us at support@sprk3.com.