Claude Code saved passwords into 1,122 public GitHub settings files. Rotate first, then clean up

By George Bailey   Published: 11/09/26   4 min read

When a developer picks “Yes, and don’t ask again” in Claude Code, the assistant can save the exact command as a permission rule in .claude/settings.local.json. If that command had a password or API key in it, the secret is now in a plain JSON file in the project.

Get the CyberExperts Daily Brief: the day's top security news in 5 minutes. Free.

Apiiro searched public GitHub and found 1,122 copies of that file holding at least one secret, 1,379 distinct secrets in all. More than a third open a database directly.

Claude Code’s settings.local.json can hold the exact command you approved, password and all. Rotate what it held before you delete it.

Claude Code saved approved commands, passwords included

Apiiro’s November 5 research found 104,185 copies of .claude/settings.local.json in 103,617 public repositories. About 1.1% held a secret. The haul includes 379 database passwords, 43 SSH logins for public servers, 42 GitHub, GitLab and npm tokens, and 23 AWS keys, across 63 organizations.

Claude Code adds the file to a user’s global git excludes the first time it writes it, according to its settings documentation. That protection lives on one machine. It does nothing for a file already committed, and Claude Code never adds the file to the project’s own .gitignore. In 539 of 1,105 repositories traced, a commit co-authored by Claude changed the file.

Teams whose repos carry .claude folders

This sits in repositories, but also in npm packages, Docker images, zip archives and synced folders, because the file is plain JSON in the project folder. Apiiro did not test whether the secrets still work. One company it notified confirmed its key had been live.

Common scanners look for known key formats. A password after PGPASSWORD=, sshpass -p or mysql -p looks like an ordinary word, so a clean scan does not clear these files.

Rotate first, then untrack the file

Forward this

For whoever owns our source code and developer tooling: Claude Code can save approved commands, passwords included, into .claude/settings.local.json, and Apiiro found more than a thousand public copies holding live-looking secrets. Can we search our repos and their history for that file, rotate anything it held, and add it to .gitignore?

Details

Hunt / verify

Source: Apiiro research; The Hacker News write-up

Sources

George Bailey

George Bailey is the byline of the CyberExperts editorial desk, the team behind the CyberExperts Daily Brief. The desk covers vulnerabilities, breaches and security news from vendor advisories, CISA alerts and other primary sources, and links those sources in every story. Questions or corrections: [email protected].