What’s to be done?

Although this security issue is getting more attention now, it was flagged in a Claude Code bug report as far back as August 2025. Other bug reports also noted that the sensitive settings file was sometimes not added to the user’s .gitignore list or that Claude Code could add the sensitive commands to another file that was not protected from git sharing. These bug reports were all closed without action after 60 days of inactivity.

In a comment thread on Hacker News over the weekend, Claude Code’s Boris Cherny said the team is “looking into what we can do to prevent this.” That said, he noted that these settings files should pretty much never be checked in to a user’s git source control and that cases like these seemed to come up only when “the files were manually created and checked in.”

In the meantime, Cherny recommended using Claude Code’s auto mode, which uses classifiers to automatically route “routine permission prompts” without requiring what Cherny calls “manually maintaining finicky allow/deny lists.” But when another user noted that sensitive commands can still be saved to settings files in auto mode, Cherny said that was a “good catch” and added that the team is “thinking through what we can do to improve this.”

Cherny also recommends Claude Code users make use of secret scanners—which can trawl files for sensitive information and scrub it out—and said that the team was considering building this kind of secret scanning into Claude Code itself in the future. That said, the Apiiro researchers found that 215 of the roughly 1,100 public secrets it found in Claude Code settings files were not flagged by two popular secret scanners, gitleaks and TruffleHog.

This is far from the only case of an AI agent unintentionally leaking sensitive information. Last month, Meta suspended the sharing feature on its Muse agent after security researchers found the URLs for those links could be easily guessed.