All writings
Essay · 4 min

Claude Code Saved Passwords to GitHub: Check Your Repos

Apiiro found live secrets in 1,122 public Claude Code settings files. What happened, what Anthropic has said, and a 20-minute check for your own projects.

By Peter Walters

Security firm Apiiro reported on November 7, 2026 that Claude Code's "Yes, and don't ask again" option can save a typed password or token in plain text in a project file called .claude/settings.local.json, and that 1,122 public GitHub copies of that file contain at least one real secret. Anthropic's Claude Code lead, Boris Cherny, has responded that Claude Code has not historically scrubbed secrets and that the team is looking at prevention.

What actually changed

Nothing was shipped or patched. This is a research finding about existing behavior. When you approve a command in Claude Code and choose "don't ask again," the tool remembers that exact command so it can run without asking next time. If the command had a password or key typed into it, the secret is saved along with it.

The numbers, per The Hacker News and iTnews: Apiiro found 104,185 copies of the file in 103,617 public repositories. Of those, 1,122 held at least one secret, 1,379 distinct secrets in total. That includes 379 database passwords, 122 Supabase service-role keys, 43 SSH logins, 42 GitHub, GitLab or npm tokens and 23 AWS keys. Counting older file versions, a shared settings file and saved chat logs, the total reaches 2,539 secrets across 1,994 repositories. Those two totals measure different things, so do not compare them.

There is a dispute. The Hacker News says the file is excluded globally but not in each project's .gitignore. iTnews reports that Cherny argued the file is gitignored on creation and that the exposed copies were likely added by hand. I could not confirm which is right. Either way, secrets in a public repo are exposed.

Common scanners also miss many of these. Gitleaks flagged 564 of the 1,122 files and TruffleHog flagged 643, while 215 slipped past both, mostly passwords typed inside a command rather than a recognizable key.

Why it matters if you run a small team

If anyone on your team, or a freelancer you hired, builds with Claude Code, this applies to you. It does not take a data breach or a clever attack. It takes one click on a convenient button and one push to a public repo.

What is overhyped: the headline count. About 1.1 percent of the files had a secret. Most Claude Code users are not leaking anything. Apiiro also did not test whether most of the secrets still work, and the article says only one notified company confirmed a live key.

What is not overhyped: the Supabase service-role keys. That key bypasses row-level security and gives full database access. If you have ever pasted one into a command, treat it like a house key you left in a public mailbox.

The lesson is bigger than one tool. Any AI coding agent keeps a memory folder in your project. Treat those folders as places where secrets can end up.

What I would do with it this week

Here is the 20-minute version.

First, search your repos for a folder named .claude and a file named settings.local.json. Check history too, not just the current branch. Ask your developer or agency to do the same on anything they built for you.

Second, if you find a secret, rotate it before you do anything else. Deleting the file does not help, because the old version lives in git history and in forks.

Third, add settings.local.json to the project .gitignore and stop tracking it with git rm --cached.

Fourth, stop typing secrets into commands. Keep them in environment variables or your host's secret manager, and approve command patterns instead of exact commands.

I have shipped 12+ apps in a year with Lovable, Claude Code, Vercel and Supabase, so this is the exact kind of thing I check on every handoff: where the keys live, who can see them, and what an AI tool writes to disk while it works. When I build for a client, secrets live in the host's settings and never in the repo, and I would rather say that out loud than assume it.

If you are not technical, the ask is simple. Send your developer one email: "Have you checked our repos for Claude Code settings files with secrets in them?" Their answer tells you a lot.

Sources

Want one practical AI move like this in your inbox each week? Join the letter.

If this landed

I build websites, apps, and AI tools for people who can't stop thinking about a specific thing. If that's you, let's talk.

Book a conversation