Get the daily emailDaily email
  1. Home
  2. Agents
  3. This story

Claude Code's 'don't ask again' has been leaking secrets into public repos

According to Apiiro research that GitLab also wrote about, 104,185 copies of .claude/settings.local.json were found in public repositories, and 1,122 contained a secret. When a user approves a shell command with 'Yes, and don't ask again', Claude Code saves…

Published Read the original

Why it matters

If you use Claude Code or a similar agent, check your repos for this file today and rotate any leaked secret.

What happened

1 min read

According to Apiiro research that GitLab also wrote about, 104,185 copies of .claude/settings.local.json were found in public repositories, and 1,122 contained a secret. When a user approves a shell command with 'Yes, and don't ask again', Claude Code saves the exact command, including any token or password typed into it, under permissions.allow. The file is excluded only via the user's global git excludes, not the project .gitignore, so collaborators can end up committing it.

inscraper analysis

Our analysis

This isn't a classic bug but an unintended interaction between saved permissions and git configuration, and the same pattern exists in Cursor, Copilot and Gemini tooling. The right fix is rotating the key at the provider, since deleting the line doesn't remove the value from git history. Adding .claude/settings.local.json to the project .gitignore and keeping secrets out of commands (use environment variables) closes the hole. The poster promotes their own open-source scanner, but a manual check works too; the figures come from Apiiro and GitLab and weren't independently verified here.

More in Agents