# Claude Code's 'don't ask again' button has a secrets-spilling problem

DevFeed: [Claude Code's 'don't ask again' button has a secrets-spilling problem](<https://devfeed.tech/articles/claude-code-s-don-t-ask-again-button-has-a-secrets-spilling-problem-129005.md>)

Original publisher: [Read original article](<https://www.infoworld.com/article/4247344/claude-codes-dont-ask-again-button-has-a-secrets-spilling-problem-2.html>)

Author: Shweta Sharma

Published: 2026-11-11T12:03:25Z

Content type: news

Language: en

Sources: [InfoWorld](<https://devfeed.tech/sources/infoworld.md>)

Topics: [Secret Scanning](<https://devfeed.tech/topics/secret-scanning.md>), [Claude Code](<https://devfeed.tech/topics/claude-code.md>), [Secrets Management](<https://devfeed.tech/topics/secrets-management.md>), [GitGuardian](<https://devfeed.tech/topics/gitguardian.md>), [secret rotation](<https://devfeed.tech/topics/secret-rotation.md>), [code security](<https://devfeed.tech/topics/code-security.md>)

Tags: [api-keys](<https://devfeed.tech/tags/api-keys.md>), [claude](<https://devfeed.tech/tags/claude.md>), [claude-code](<https://devfeed.tech/tags/claude-code.md>), [code-security](<https://devfeed.tech/tags/code-security.md>), [code-security-development-tools-security-software-development](<https://devfeed.tech/tags/code-security-development-tools-security-software-development.md>), [commands](<https://devfeed.tech/tags/commands.md>), [commit](<https://devfeed.tech/tags/commit.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [credentials](<https://devfeed.tech/tags/credentials.md>), [curl-command](<https://devfeed.tech/tags/curl-command.md>), [development-tools](<https://devfeed.tech/tags/development-tools.md>), [docker](<https://devfeed.tech/tags/docker.md>), [git](<https://devfeed.tech/tags/git.md>), [gitguardian](<https://devfeed.tech/tags/gitguardian.md>), [github](<https://devfeed.tech/tags/github.md>), [language-en](<https://devfeed.tech/tags/language-en.md>), [local](<https://devfeed.tech/tags/local.md>), [passwords](<https://devfeed.tech/tags/passwords.md>), [permission](<https://devfeed.tech/tags/permission.md>), [permissions](<https://devfeed.tech/tags/permissions.md>), [public](<https://devfeed.tech/tags/public.md>), [repositories](<https://devfeed.tech/tags/repositories.md>), [secrets](<https://devfeed.tech/tags/secrets.md>), [security](<https://devfeed.tech/tags/security.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [storytype-news](<https://devfeed.tech/tags/storytype-news.md>)

## AI overview

Claude Code's "Yes, and don't ask again" approval can save an entire shell command, including embedded credentials, in .claude/settings.local.json. GitGuardian found 31,088 distinct secrets in the file across 23,276 public GitHub repositories; 5,343 were valid when detected. It also found 613 distinct secrets in public Docker Hub images, 99 valid. Claude Code adds the file to local Git ignore settings, but that protection may not transfer across clones, and Docker does not automatically respect .gitignore, so a broad COPY can include the file unless .dockerignore excludes it. GitGuardian recommends rotating exposed credentials, removing the file from Git and Docker build contexts, checking published images, scanning assistant configuration files, and using environment variables instead of hardcoding credentials. The excerpt says Anthropic was exploring safeguards; it does not establish whether they were implemented.

## Source excerpt

A configuration file meant to store local command permissions on Anthropic's Claude Code is exposing thousands of API keys, database credentials and other secrets, according to findings by GitGuardian. The code security firm identified 31,088 distinct secrets in Claude Code's ".claude/settings.local.json" files across 23,276 public GitHub repositories. Of those, 5343 were still valid when GitGuardian detected them. The exposed credentials include database connection strings, cloud provider tokens, SSH passwords, Google API keys, and AU service credentials. "Monthly leaks in settings.local.json peaked at 12,535 occurrences in April 2026, then fell to 959 by October, and we do not yet know what changed," GitGuardian researcher Guillaume Valadon said in a blog post. Apart from source code repositories, the exposure included secrets embedded in publicly accessible Docker Hub images. The problem, Valadon explained, lies with how Claude Code handles command approvals. Command approvals turn into credential storage Claude Code asks developers for permission before executing certain shell commands. When a developer selects the "Yes, and don't ask again" option, the tool saves an allow rule in .claude/settings.local.json, a project-level configuration file. The catch is that the saved rule contains the actual command string, including any credentials embedded in it. For instance, a developer asking Claude Code to interact with an API might approve a curl command containing an API key in its HTTP header. Claude Code then stores that entire command as an approved rule, leaving the credential in the configuration file. Although Claude Code automatically adds the file to its local Git ignore settings, that protection does not necessarily carry over to other machines or repositories, Valadon said. Developers can accidentally commit the file, particularly when working across different clones or when the file has already been tracked. Git Guardian found that 67% of the occurrences