Discover ALTREVA → (ALTREVA is a store owned by the owner of NEXOTECH.)
Skip to content
NEXOTECH
Artificial intelligence

Clicking "don't ask again" in Claude Code has ended up leaking passwords on GitHub: what happened and how to avoid it

Apiiro researchers found 1,122 public GitHub files containing passwords and keys saved by Claude Code. How it happens and how to protect yourself.

By Nacho MasedaPublished 2 min readLeer en español
In this article

Apps and services change often. The steps in this guide were reviewed on the date shown; if a menu doesn't match, check the official sources linked at the end. Information reviewed on .

Claude Code, Anthropic's coding assistant, asks permission before running commands. To avoid repeating themselves, many developers click "Yes, and don't ask again". According to research by Apiiro, that button has ended up causing passwords and private keys to appear on GitHub for anyone to see.

How it happens

According to Xataka:

  1. When you approve a command with "don't ask again", Claude Code saves that command exactly as written so it can recognise it next time.
  2. If the command included a password or key, it's stored in plain text in the project's .claude/settings.local.json file.
  3. That file should stay only on your computer, but if it ends up in the repository, it gets pushed to GitHub with the rest of the code.

What was found

Apiiro found 1,122 public files on GitHub containing secrets, including:

  • Database passwords.
  • Login credentials for SSH servers.
  • Private keys.
  • GitHub tokens and AWS keys (Amazon's cloud services).

What Anthropic says

It hasn't issued an official statement, but Boris Cherny, who leads Claude Code, responded on the Hacker News forum:

  • He acknowledged the tool has never scrubbed secrets from what it stores.
  • He explained that Claude Code excludes that file from Git when it creates it, so the leaked cases would be files created or uploaded manually.
  • The team is testing two improvements: auto mode detecting data leaks and a basic built-in secret scanner. No dates given.

How to protect yourself if you use Claude Code (or any agent)

  1. Never type passwords directly into commands. Use environment variables or a secrets manager.
  2. Check whether .claude/settings.local.json is in your repository and, if so, remove it and add it to .gitignore.
  3. If it was already pushed with a key inside, rotate that key as soon as possible: deleting the file isn't enough, because it stays in the history.
  4. Turn on GitHub secret scanning for your repositories.
  5. Review what you push before every push.

It's another reminder that AI coding agents save a lot of time but demand good practices. And for your personal passwords, nothing beats a password manager.

Sources and documentation

  1. Pulsar «no vuelvas a preguntar» en Claude Code parecía inofensivo (Xataka, in Spanish) — Xataka
  • claude code
  • github
  • cybersecurity
  • programming
  • news
More in Artificial intelligence