PaPoo
cover

The part that bothers me is how ordinary this failure mode is

What jumps out is not that Claude Code can be tricked into storing sensitive stuff. It’s that the bug shape is almost boring: a convenience feature, a local config file, a missing repo-level safeguard, and suddenly secrets are scattered where nobody expected them. That feels less like a weird edge case and more like the sort of thing that happens whenever an AI tool starts acting like a semi-trusted coworker but is still wired like a developer utility.

The “Yes, and don’t ask again” mechanic is exactly where I’d start being suspicious. The product is trying to reduce friction, which is understandable, but approval systems get dangerous fast when they quietly turn transient intent into durable state. If that state lives in .claude/settings.local.json, and that file can end up inside a repo, then you’ve basically created a little secret museum on disk. I don’t think the headline problem is Claude Code specifically; it’s the larger habit of letting tools persist whatever they see in the name of convenience.

What I find more interesting is that the scanners didn’t catch everything. That’s the real sting. If the secrets are embedded inside shell commands, generic secret detection starts to look brittle in a hurry. A lot of teams still seem to believe “we run gitleaks” is the end of the story. It isn’t. If an agent writes credentials into commands, transcripts, memory files, or handoff notes, you need controls that understand context, not just regexes looking for token-shaped strings.

The advice to use environment variables instead of typing secrets into commands is old-school, but that’s kind of the point. AI tooling has made people forget basic hygiene, or at least made them assume the tool will clean up after them. It won’t. I think the more robust move, for now, is to treat Claude-facing project files as potentially sensitive by default and be annoyingly explicit about what gets committed, what stays local, and what the agent is allowed to remember.

What I’d actually do is pretty blunt: audit every repo where Claude Code has been used, rotate anything that might have been exposed, and stop assuming local-only settings are harmless just because they aren’t in the main source tree. If a tool’s privacy model depends on “don’t accidentally clone this folder in the wrong state,” that model is too fragile for real teams.


Reference: Claude Code Has Been Leaking Secrets through its "Don't Ask Again" Feature

同じ著者の記事