Act nowAI agents

Claude Code can save your passwords in a settings file: check your repos for .claude/settings.local.json and rotate what you find

Apiiro found 1,994 public GitHub repositories holding real secrets in Claude Code's local settings file, which records the exact command you approve with "Yes, and don't ask again". Anthropic's head of Claude Code says the team is looking at fixes. What we verified and what to do.

How urgent

Act now

Who is affected

People who use Claude Code and commit the project folder to GitHub, or share it in a zip, package or image. Risk is highest if you ever approved a command that contained a password, token or connection string. We did not test other coding agents

What to do

Search your repos and their git history for .claude/settings.local.json, rotate every secret the file ever held, then stop tracking it and delete rules that contain secrets

Published 8 Nov 2026 · Sources last checked 8 Nov 2026No. 65 / 87

What happened

Claude Code asks before it runs most shell commands. If you choose "Yes, and don't ask again", it can save a permission rule in .claude/settings.local.json. When the rule covers one exact command, the command is saved word for word, including any password, token or connection string typed into it, in plain text.

Security company Apiiro searched public GitHub and says it found 2,539 real secretsSecret (API key, token, password) Any piece of text that proves to a service that you are allowed in, such as an API key, a database password or an access token. Tap again to open the glossary in 1,994 public repositories (current files and older versions in git history). The Hacker News reports that 1,122 public copies of the file hold at least one secret. The secrets include database passwords, cloud keys, tokens and SSH logins, and Apiiro lists 63 affected organizations, from student groups to software vendors. One company the researchers contacted confirmed its key had been live. Apiiro did not test whether the other secrets still work.

Deleting the file does not undo the leak: older versions stay in git history and in forks.

What the maker said

Anthropic's head of Claude Code, Boris Cherny, answered on Hacker News on 7 November. According to Apiiro, he said the team is looking into ways to prevent this, such as making sure auto mode catches it and adding basic secret scanning, and that they will prototype some before shipping. He also said Claude Code gitignores the file when it creates it, so in his view the exposed copies were created manually and committed. Apiiro says four earlier reports on the issue were closed without a reply from Anthropic. We did not check the Hacker News thread ourselves.

Who is affected

  • Anyone who uses Claude Code and pushes the project folder to a public repository. Apiiro's examples include a database vendor's own cloud key and the owner password of a medical-records database.
  • Anyone who shares the folder in other ways. The file is plain JSON, so it can end up in an npm package, a Docker image, a zip or a synced folder.
  • Copies on your own computer too. The file exists locally even if you never committed it.
  • Not shown: other coding agents. We did not test them.

What to do

  1. Search your repositories for .claude/settings.local.json, including git history, even where the file is gone today.
  2. Rotate first, clean up second. Change every password, token and key the file has ever held.
  3. Stop tracking the file: git rm --cached .claude/settings.local.json, and add it to the repository's own .gitignore. Git's global ignore on one computer does not travel with the project.
  4. Open the file on your own computer and delete every rule that contains a secret.
  5. Keep secrets out of commands. Refer to them as variables from a secrets manager, and approve patterns instead of single exact commands.
  6. For teams: treat agent folders (.claude/, .cursor/, .gemini/) like .env files, add them to secret scanning, and check that your scanner catches passwords typed inside commands, not only known key formats.

What we could not confirm

We read Apiiro's report and The Hacker News directly. We did not open the earlier GitHub issues the researchers cite, the Hacker News thread, or any of the affected repositories. We cannot say how many of the secrets were still valid, whether anyone has used them, or how many of the files were created by Claude Code rather than by hand, as Anthropic's head of Claude Code argues. Apiiro and The Hacker News give different counts (1,122 file copies versus 2,539 secrets in 1,994 repositories) because they measure different things; we quote each as reported.

Watch the short video

The video loads from YouTube (privacy-enhanced mode) only when you press play.

Comments

No account needed. Add a nickname if you like, or leave it empty to comment anonymously. Comments are reviewed before they appear. Links are not allowed.

    We store your comment, your nickname and a scrambled form of your connection that we use only to limit spam. We do not store your IP address or set cookies. Cloudflare Turnstile checks that you are not a bot.

    Sources and verification

    We use primary sources first and say when we rely on a news report. Dates are the day we last checked each source.

    Spotted a mistake? Email [email protected] and we will correct it and note the change.

    Get the free runbooks

    One-page security checklists for founders who build with AI. You get a confirmation email first, then the runbooks.

    Send me the runbooks