Security firm Apiiro found that when a Claude Code user approves a shell command with 'Yes, and don't ask again', the exact command is saved to .claude/settings.local.json in the project, including any password or token typed into it. Scanning 104,185 public copies of the file, Apiiro found 1,122 containing 1,379 live-looking secrets, including 379 database passwords and 23 AWS keys; with older versions and transcripts the total reached 2,539 secrets across 1,994 repositories. Claude Code head Boris Cherny said on Hacker News that Anthropic is looking into it and that the tool has not historically scrubbed secrets.
SecurityTreat agent configuration folders (.claude, .cursor, .gemini) and agent memory files as secret-bearing, like .env. Add them to pre-commit and CI scanning, including history, because Gitleaks and TruffleHog each missed hundreds of these.
DevelopersSearch your org for .claude/settings.local.json in git history, rotate anything it ever contained, then untrack it and approve command patterns (Bash(npm run:*)) instead of literal commands with credentials in them.
ExecutivesThis is what 'shadow AI' looks like in practice: a convenience feature, not a breach, and the fix is a policy plus a scanner rule. Ask whether your coding-agent rollout included either.
ML engineersOf 16 coding agents Apiiro compared, Claude Code was the only one confirmed to persist full approved commands in a project file by default. Agent UX decisions are security decisions.