Approve once, leak forever: secrets in Claude Code settings files
Approved Once, Leaked Forever: Secrets in Claude Code Settings Files
A CSA research note summarizes Apiiro's scan results: of 104,185 public .claude/settings.local.json files on GitHub, 1,122 (about 1.1%) contained at least one secret, totaling 1,379 distinct secrets, including 379 database passwords, 43 public server SSH logins and 23 AWS keys. The cause is that when developers choose persistent approval in permission prompts, Claude Code writes the full command verbatim into that file, so inline passwords or tokens are retained in plaintext, and the built-in protection only adds the file to the user's local global git exclude. In half of the affected repositories the file had been present for at least 217 days, and git history contained another 734 secrets; gitleaks and TruffleHog together missed 215 files. According to Check Point research, 428 public npm packages carry the file, of which 33 contain credentials.
Apiiro's scan shows that in half of the affected repositories the file had been present for at least 217 days, which security teams can use to check their own repositories and npm packages for similar configurations.