ToolNavs Find Useful AI Tools
Submit Sign in
Back to AI Q&A
Did Claude Code Write Your Password Into a Project File? Check Whether You Clicked 'Don't Ask Again'

Did Claude Code Write Your Password Into a Project File? Check Whether You Clicked 'Don't Ask Again'

AI Q&A • Admin • • 6 views

Claude Code can write a password into a project file, but it does not leak it automatically — it only happens when two conditions are met at the same time: the password is written in plain text in a command, and you clicked "Don't ask again". Once clicked, Claude Code writes the entire command verbatim as an allow rule into the project's .claude/settings.local.json. A report published on November 5, 2026 by the security company Apiiro found that of 104,185 such files publicly visible on GitHub, 1,122 contained real credentials; counting Git history and agent conversation logs, the total is 2,539 credentials across 1,994 public repositories, including 379 database passwords and 43 SSH login credentials — even server root passwords.

Check first whether you are affected

Open a terminal and run git ls-files | grep .claude/ in the project root to see whether .claude/settings.local.json is already under version control. Then open that file and .claude/settings.json directly and search for words such as password, token, secret and key. Also check the Git history: deleting the file now does not mean it is clean, because earlier commits may still contain it. Anthropic has not issued a formal blog response so far; only Claude Code lead Boris Cherny said on Hacker News that the file should never have been under version control and that the team is working on more safeguards.

If it has leaked, rotate first, then delete the file

The order matters: first rotate or revoke every leaked password, key and token, then delete the file and clean the history. Deleting the file alone does nothing — Apiiro found the same keys in 211 forked repositories, so even after you delete your own copy, other people's forks still hold them. After rotating, fix the repository: add .claude/settings.local.json to the project's own .gitignore, and for public repositories, turn on GitHub secret scanning as well.

How to avoid it in future

Keep credentials in environment variables or a secrets manager — never write them directly into a command. When Claude Code asks for permission, do not click "Don't ask again" just to save time, especially when the command contains a password. For commands you want permanently allowed, write the rule by hand and only allow commands that contain no sensitive information. The incident is also a reminder: the more capable an agent becomes, the less casually you should click through permission prompts — one click on "Don't ask again" hands that command a permanent pass.

Recommended Tools

More