Claude Code's "Don't Ask Again" exposes passwords in 1,122 public GitHub files

460 points · 323 comments on HN · read original →

Points and comments are a snapshot, not live.

Claude Code's "don't ask again" feature stores secrets in a file that often gets committed to public repos.

Apiiro research found 1,122 public GitHub files containing real secrets due to Claude Code's permission settings. When users approve commands containing credentials with "don't ask again," the full command (including passwords, API keys, tokens) is saved to `.claude/settings.local.json`. Despite Claude Code adding this file to the global gitignore, it gets committed when repos are created after the file, or when Claude itself commits it (539 repos). Across all sources including history and chat transcripts, 2,539 distinct secrets were found in 1,994 repos. Standard secret scanners miss many because passwords inside commands (PGPASSWORD=, sshpass -p) don't match key-format patterns.

What commenters are saying

Several commenters noted this is not new-developers have leaked secrets in public repos long before AI agents. A key correction: the file is only public if the repository itself is public; private repos limit exposure but still spread secrets to all collaborators. Boris from Claude Code responded that the team is looking into solutions including secret scanning and promoting auto mode over manual approval. Some pushed back, arguing auto mode's threat model is undefined and not quantifiably safer. Others pointed to approval fatigue as the real cause: developers stop reading commands after repeated interruptions.