Claude Code Security Flaw Exposes Developer Passwords
Developers who clicked Yes, and don't ask again in Claude Code may have been publishing their own passwords without knowing it. On , AI security researcher Shmulik Cohen detailed how the tool saves each approved shell command into a local project file named .claude/settings.local.json. Any password, bearer token, or administrative key typed into one of those commands is saved along with it.

Many of those files were then committed to public repositories. Cohen’s research found 2,539 distinct secrets across 1,994 repositories.

Detection is part of the problem. Open-source scanners such as gitleaks and TruffleHog missed roughly one in five of the real secrets, because they are built to spot prefixed API keys, not a raw password sitting in a command line. Anthropic shipped an update in mid-November that restricts suspicious commands to session-only permissions, but it does nothing for files already written to disk. Developers must audit their existing projects and rotate any credential that may have leaked.

Find and Clear What Is Already on Disk

Start with the projects you have already used Claude Code in:

  1. Open your terminal and move into your active development workspace.
  2. Search for the file by running find . -name settings.local.json.
  3. Open each result in your text editor.
  4. Look for database connection strings, API tokens, and hardcoded passwords inside the saved commands.
  5. Delete any line that holds a credential or a sensitive permission.
  6. Open your cloud provider dashboard or database console and rotate every secret you found, straight away.

Note: Deleting the local file does not remove the secret from earlier commits in your git history, from forks, or from remote clones. Treat anything that was ever committed as compromised.

Keep Secrets Out of Agent Commands

The fix going forward is to make sure a raw credential never appears in a command an autonomous coding assistant can log:

  1. Open your project configuration or environment file template.
  2. Define credentials as environment variables, such as $DB_URL, and reference the variable in commands instead of typing the password.
  3. Add .claude/ to your global and project .gitignore files.
  4. Run pre-commit hooks and CI scanners that are set up to catch plaintext passwords in command-line arguments.

Hashlytics Take

Nothing here is a break-in. The feature stores the command exactly as it was approved, so a password typed inline lands in a plain file inside the project folder, one careless git add from a public repository. The scanner gap makes it worse, since tools tuned for prefixed keys will wave a bare password straight through. Agent settings, memory folders, and chat transcripts are now places where secrets accumulate, and they deserve the same protection as .env files and production logs.

Follow Hashlytics on Bluesky, Facebook, LinkedIn , Telegram and X to Get Instant Updates