A simple "don't ask again" in Claude Code can save your passwords and API keys in a project file—and over 1,000 public GitHub repos are exposing them. Here's what you need to know.
You know that little checkbox in Claude Code—"Yes, and don't ask again"? It's supposed to save you time. But lately, it's been saving something else: your passwords and API keys, right where anyone can find them.
Here's the deal. When you approve a command and tell Claude Code not to ask again, Anthropic's AI assistant can store that command—word for word, including any secrets you typed—in a project settings file. And if that file ends up in a public GitHub repo, well, your secrets are now public too.
Security firm Apiiro dropped a report yesterday: they found 1,122 public GitHub repositories where this exact thing happened. That's over a thousand copies of sensitive data just sitting there, readable by anyone with an internet connection.
### Why This Keeps Happening
It's not that developers are careless. It's that the feature is designed for convenience, and convenience often comes at the cost of security. You're in the flow, you type a command with an API key, you check the box to avoid the prompt, and you move on. The last thing on your mind is that the command is being saved to a file that might get committed.
But that's exactly what's happening. The settings file—typically something like `.claude/settings.json`—can contain the full command, secrets and all. And if you're working in a public repo, that file goes right along with your code.
### What You Can Do About It
First, don't panic. But do take action. Here are a few practical steps:
- **Audit your repos**: Search for `.claude` directories or settings files in your public repositories. If you find one, check for any sensitive data.
- **Use environment variables**: Instead of hardcoding secrets in commands, use environment variables that aren't stored in the settings file.
- **Review your approvals**: Think twice before checking "don't ask again" for commands that include secrets. It's a small inconvenience for a big security win.
- **Rotate your keys**: If you suspect a key was exposed, rotate it immediately. Don't wait.
> "The line between convenience and vulnerability is often just a checkbox away."
### The Bigger Picture
This isn't just about Claude Code. It's a reminder that AI coding assistants are powerful tools, but they're not magic. They don't inherently know what's sensitive and what's not. As developers, we need to stay vigilant about what we're approving and where that information goes.
Anthropic hasn't commented publicly on the report yet, but it's likely they'll review the feature. In the meantime, it's on us to be careful. So next time you see that "don't ask again" option, take a second. Your future self—and your security team—will thank you.
And if you're one of the 1,122, don't beat yourself up. It happens. Just fix it, learn from it, and maybe share this with a colleague who might be in the same boat.