If your team ran Claude Code with a key directly in a terminal command, check `.claude/settings.local.json`, repository history, and published Docker images. Choosing “Yes, and don’t ask again” saved the approved command as a rule; if its command line contained an API key or password, that value could end up in the settings file.

The November 12 release of Claude Code version 2.1.323 changed how this confirmation works: a rule that appears to contain a secret, or a rule for a Git-tracked settings file, applies only to the current session and is not saved. This limits the creation of new entries of this kind. The update does not automatically clean old commits, clones, or container images.
How a command ended up in settings
When a command is approved for ongoing use, Claude Code writes a rule to `.claude/settings.local.json` at the repository root. For example, a `curl` command with a token in a header may be saved along with the token itself. According to the Claude Code documentation, these permissions also apply in later sessions in that repository.
Claude Code adds the local file to the global Git exclusion list on the computer where it is created. That exclusion does not become a project-level rule: another computer, a file already tracked by Git, or a copy accidentally added to the repository can bypass the local protection. GitGuardian separately notes that the Docker instruction `COPY . .` copies files from the working directory, not just files added to the Git index. So a Git-ignored file can end up in an image if the directory is not excluded through `.dockerignore`.
What the investigations found
In a November 22 article, InfoQ summarized Apiiro’s investigation: the company reported secrets in local settings, Git history, shared settings, and agent transcripts. A separate GitGuardian analysis covered public GitHub commits from January 2025 through November 7, 2026. According to researcher Guillaume Valadon’s count, 31,088 unique secrets were found in `.claude/settings.local.json` across 23,276 repositories; 5,343 secrets passed automated validity checks when detected.
GitGuardian also found 613 unique secrets in public Docker Hub images, 99 of which were active when checked. These are findings from an analysis of public repositories and images, not an estimate of the number of all Claude Code users affected. For a project owner, the practical takeaway is specific: treat old permission files and build artifacts as potential places where credentials may be stored.
Some leaks may be harder for ordinary secret scanners to detect when a value is embedded in command text rather than formatted like a recognizable key from a particular provider. As a result, checking only the current versions of files or searching for typical key prefixes leaves gaps: traces may remain in history, transcripts, or an already published image.
What to check in your repository and build
Start with the current `.claude/settings.local.json` and shared `.claude/settings.json`, then check whether Git tracks the local file and whether it has appeared in commit history, branches, or tags. Also review transcripts and other saved agent artifacts if commands may have used passwords, tokens, or connection strings. For builds, check `.dockerignore` and published images: a rule in `.gitignore` alone does not exclude a file from the Docker build context.
If a secret value made it into a file, commit, or image, revoke and replace it with the issuing service. Removing a file from the current branch does not invalidate the key or remove old copies. After rotating the credential, you can stop tracking the local permissions file and add it to the project’s own `.gitignore`; add a separate exclusion to `.dockerignore` for builds. It is safer to construct a command rule using an environment variable such as `$SERVICE_TOKEN` than to include the literal secret value.
The 2.1.323 update helps prevent some new risky rules from being saved: it limits writing a rule when a command appears to contain a secret or when the target file is tracked by Git. For operations teams, this is a reason to update and audit old copies at the same time. The fix changes future permission storage; keys already exposed in Git or Docker Hub need to be revoked separately.