Alert: Claude Code may have saved your keys in .claude/settings.local.json
Reported November 5, 2026 · Updated November 9, 2026 · By Arif Khan, AIVolve LLC
What happened: On November 5, 2026, the security company Apiiro reported that Claude Code's "Yes, and don't ask again" option can save the exact command you approved, including any password or API key typed into it, in .claude/settings.local.json inside your project. Apiiro found 1,122 public copies of that file on GitHub holding at least one secret, including 379 database passwords and 122 Supabase service-role keys. It did not test whether the secrets still work.
Who is affected
- You use Claude Code and have picked "Yes, and don't ask again" on a command that contained a password, token, key or database connection string.
- You are most at risk if your project is on GitHub, especially in a public repository, and
.claude/settings.local.jsonwas ever committed. - Even if it was never committed, the secret sits in plain text in the file on your computer until you remove it.
What to do now (5 steps)
- Check git. In your project folder run
git log --all --oneline -- ':(glob)**/.claude/settings*.json'. Any output means the file is, or was, in your history. - Rotate first. Change every password, token and key the file has ever held, at the provider. Deleting the file doesn't remove old copies from history, forks or clones.
- Stop tracking it. Run
git rm --cached .claude/settings.local.json, add.claude/settings.local.jsonto your project's.gitignore, commit and push. - Clean the local file. Open
.claude/settings.local.jsonand delete every allow rule that contains a secret. In Claude Code,/permissionslists your rules. - Keep secrets out of commands. Use environment variables like
$DATABASE_URL, and approve patterns such asBash(npm run *)instead of one-off commands.
Full walkthrough, with copy-paste commands and a prompt for your AI tool: Claude Code's "don't ask again" leaked your keys? Check .claude/settings.local.json
Sources: Apiiro research (Nov 5, updated Nov 8) · The Hacker News (Nov 7) · Claude Code permissions docs
Need help?
Start with a free X-ray: 2 minutes, no code or passwords. Your AI builder writes a read-only report that includes security red flags, and an AIVolve developer reviews every X-ray within 1 business day.
Get a free X-ray →