A Claude Code permission choice can save an approved shell command, including a password or API key typed directly into it, in .claude/settings.local.json. If that file is committed to a public GitHub repository, the command—and any literal credential inside it—can become public. Apiiro’s reported findings concern this specific command-permission path.
Keep literal credentials out of commands that Claude Code may save; use a secrets-manager variable instead.
How a saved command can expose a credential
When a user selects “Yes, and don’t ask again,” Claude Code can remember the approved command so it can run without asking permission again. The command may be stored in .claude/settings.local.json. If the command contains a literal secret, that value may be stored in the same file.
The described route concerns Claude Code’s command-permission flow. It is not a finding that ordinary Claude chat messages are automatically published to GitHub.
A global Git exclusion is a user-level setting, not a rule shared with every repository. It may not protect a file that is already tracked, or a project handled with a different Git configuration. A repository’s .gitignore template provides a project-level rule that teams can share, but it does not remove a file already recorded in Git history.
What Apiiro reported finding
Apiiro examined 104,185 publicly accessible copies of the settings file across 103,617 GitHub repositories. It classified 1,122 files—about 1.1% of the examined copies—as containing real secrets; those files held 1,379 distinct credentials. Apiiro also identified credentials associated with 63 organizations, including production database passwords, cloud-service keys and credentials for an application handling medical records.
A separate, broader count was 2,539 credentials across 1,994 public repositories. That analysis included historical versions and records from other AI coding tools, so it is not the count of credentials in the 1,122 settings files.
Apiiro said it did not test the credentials or attempt logins. One organization reportedly confirmed that an exposed key had been active; an active key does not by itself show that an attacker used it.
What teams can check and change
Apiiro recommended searching repositories for .claude/settings.local.json and .claude/settings.json, then checking Git history as well as the current files. Deleting a file from the latest version does not erase earlier commits, so credentials that may have appeared in that history should be rotated.
Teams can add .claude/settings.local.json to their shared .gitignore templates to help keep it out of future commits. For commands that need a credential, Apiiro recommended referring to a variable such as $DB_URL supplied by a secrets manager instead of typing the secret itself. That keeps the literal value out of the command saved in the permission rule.
Anthropic’s reported response
In remarks reported on November 7, 2026, Boris Cherny, Claude Code’s lead, said Anthropic was exploring credential scanning and additional safeguards for command permissions.