Claude Code saves approved commands word for word, and Apiiro found 1,379 secrets in copies left public on GitHub
On 5th Nov'26 the security firm Apiiro published research on Claude Code's "Yes, and don't ask again" option, which stores the approved command exactly as typed as a rule in a project file, .claude/settings.local.json. When a command carries a password or key, such as a database login, the secret goes into the file with it. Apiiro scanned 104,185 public copies of the file on GitHub and found 1,379 distinct secrets in 1,122 of them, including 379 database passwords, 122 Supabase service-role keys and 23 AWS keys; counting git history and other Claude files, the total reached 2,539 across 1,994 repositories. Claude Code adds the file to the user's own git ignore list, but that does not cover a clone on another machine, a folder that later becomes a repository, or a file already committed. Neither TruffleHog nor gitleaks flagged 215 of the files. Apiiro did not test whether the secrets still work, and says Anthropic did not reply.
What it actually means
Most teams treat secret leaks as a code problem and scan what engineers write. This file is written by the tool rather than a person, and it records whatever passed through the terminal, so a password someone typed once to test a database connection sits in a settings file nobody reviews. The protection Claude Code adds lives on one laptop, which is why it fails as soon as the project moves to a second machine or a fork.
If your team uses Claude Code, add .claude/settings.local.json to each repository's own .gitignore today, then search your organisation's GitHub, including history, for the file. Rotate any credential you find in it rather than deleting the file, because forks and clones keep the old copies. After that, keep secrets out of commands altogether by reading them from environment variables, so the approval saves the variable's name rather than its value.
A coding agent's approval list is a file like any other, and it keeps every password you typed into a command.
1,379secrets Apiiro found in public Claude Code settings files
Source: GBHackers · Sunday, 8 November 2026