# Claude Code's 'Don't Ask Again' File Exposes Passwords and Keys in 1,122 Public Copies on GitHub

DevFeed: [Claude Code's 'Don't Ask Again' File Exposes Passwords and Keys in 1,122 Public Copies on GitHub](<https://devfeed.tech/articles/claude-code-s-don-t-ask-again-file-exposes-passwords-and-keys-in-1-122-public-copies-on-github-122613.md>)

Original publisher: [Read original article](<https://it.slashdot.org/story/26/11/08/1758242/claude-codes-dont-ask-again-file-exposes-passwords-and-keys-in-1122-public-copies-on-github>)

Author: EditorDavid

Published: 2026-11-08T18:34:00Z

Content type: news

Language: en

Sources: [Slashdot](<https://devfeed.tech/sources/slashdot.md>)

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

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [api-keys](<https://devfeed.tech/tags/api-keys.md>), [claude-code](<https://devfeed.tech/tags/claude-code.md>), [github](<https://devfeed.tech/tags/github.md>), [keys](<https://devfeed.tech/tags/keys.md>), [passwords](<https://devfeed.tech/tags/passwords.md>), [public](<https://devfeed.tech/tags/public.md>), [secrets](<https://devfeed.tech/tags/secrets.md>), [security](<https://devfeed.tech/tags/security.md>)

## AI overview

When a Claude Code user approves a command with "Yes, and don't ask again," the command may be saved verbatim in .claude/settings.local.json, including passwords or API keys. Apiiro found secrets in 1,122 of 104,185 public copies it searched; it did not check whether they were still valid. The excerpt reports database credentials, SSH logins, GitHub, GitLab and npm tokens, and AWS keys among the findings. Claude Code adds the file to that user's global git excludes when it creates it, but this does not protect files already committed or travel with a project. Removing a committed file also leaves exposure in Git history and forks. Researchers advise rotating every secret the file contained before cleaning up. Anthropic's Claude Code lead said secret scrubbing had not historically been performed and cited planned prototypes for secret scanning and improving auto mode; he also recommended enabling source-host secret scanning.

## Source excerpt

Be careful with the file .claude/settings.local.json, warns The Hacker News: Passwords and API keys that developers typed into commands they approved in Claude Code are sitting in public GitHub repositories, where anyone can read them. When a user selects "Yes, and don't ask again," Anthropic's AI coding assistant can save the command, word-for-word, including the secret, in a project settings file. Software security company Apiiro said that 1,122 public copies of that file hold at least one secret, though it did not test whether any still work. One company the researchers notified earlier this week confirmed its key had been live... Removing [the file] from a project does not undo the leak, because older versions stay in git history and in forks of the repository. The researchers' advice is to rotate first: change every password, token, and key the file has ever held, then clean up... Claude Code tries to keep the file out of git. The first time it writes the file in a git repository, it adds the file to the user's global git excludes, its settings documentation says. Git on that computer then ignores the file in every repository. That protection stays in one user's git settings on one computer. It does nothing for a file that was already committed, the researchers say. Claude Code never adds the file to the project's own .gitignore, so the protection does not travel with the project. In 539 of the 1,105 repositories the researchers traced, a commit listing Claude as a co-author changed the file. They take this to mean Claude often commits the file itself. Apiiro's search of public GitHub found 104,185 copies of the file in 103,617 repositories, its research write-up shows. About 1.1% of them, or 1,122 copies, hold at least one secret. Together they hold 1,379 different secrets... ]And "in half of those repositories it had been there for at least 217 days."] More than a third of the secrets open a database directly, including 379 database passwords. Others include