The password was saved with the permission
Claude Code approval files expose passwords and keys in public GitHub repositories
Claude Code can save an approved command with its password or key still inside; publishing that settings file exposes the secret. Apiiro did not test the credentials, although one notified organisation confirmed its key had been live. The research does not establish whether attackers used them.
What to do this week
- Ask for a repository check.Have developers inspect .claude/settings.local.json and .claude/settings.json, including their history and deleted copies. Ask for a written result covering work done by contractors too.
- Replace exposed credentials first.Revoke exposed keys and tokens, change exposed passwords, and update the services using them. Deleting a file alone leaves older copies available. GitHub recommends revocation or rotation before cleanup[6].
- Stop the local file being published again.Have developers remove it from Git tracking and add it to the project’s .gitignore. Review the shared settings file separately because teams intentionally publish it.
- Keep passwords out of saved commands.Use a secrets manager or environment variables instead of embedding credentials. Add checks before publishing code, and review the actual changes being committed. GitHub’s prevention guidance explains these controls[6].
What happened
If developers use Claude Code for your business, ask them to check what they have published on GitHub. Apiiro found passwords and access keys in 1,122 public copies of the tool’s local settings file. Its wider investigation counted 2,539 secrets across 1,994 repositories, including older file versions, shared settings and saved agent conversations. Apiiro’s research[1] describes the findings.
The route out is a saved permission. Anthropic’s documentation says choosing “Yes, and don’t ask again” can save an approval in .claude/settings.local.json for future sessions. When the saved rule contains an exact command with a password or key, the secret goes into the file too. Publishing that file makes the secret public. Anthropic explains saved approvals[2]; The Hacker News describes the exposure[3].
- HARD assessment
- High Check business development projects
- Local settings files
- 1,122 contained secrets
- Wider investigation
- 2,539 secrets across 1,994 repositories
- Credential validity
- Not tested by the researchers
The full story2 more sections
Why a local file reached GitHub
Anthropic says Claude Code adds the local settings file to the developer’s global Git exclusion list when it first writes it inside a repository. That is a setting on the developer’s computer. The shared .claude/settings.json file, by contrast, is intended to travel with the project. Anthropic documents both files[4].
Git’s rules explain the gap: an exclusion does not stop tracking a file already committed. Rules that should travel with a project belong in its own .gitignore file. Calling a file “local” does not itself keep it private. Git’s documentation sets out these limits[5].
Who is affected
The immediate check belongs with developers and the businesses employing them, including outside agencies. Apiiro identified 63 organisations with exposed secrets. For a business owner or family office, the practical question is whether anyone building your software has published credentials belonging to you.
The researchers did not try the credentials. One notified organisation confirmed that its key had been live, but the reporting does not establish malicious use. Exposure is reason to replace a credential; it is not proof that customer records were stolen. The Hacker News reports those limits[3].
Timeline
-
HARD publishes its article, at High.
References8
- ^ Apiiro (). “Coding Agents Copy Your Secrets to a Hidden File. Thousands Are on GitHub”. Primary research, counts, methodology and remediation; page includes a later 8 November update.
- ^ Anthropic. “Configure permissions”. Persistent approvals are stored in the project's local settings file.
- ^ The Hacker News (). “Claude Code's “Don't Ask Again” File Exposes Passwords and Keys in 1,122 Public Copies on GitHub”. Contemporaneous reporting on the mechanism, credential validity and recommended checks.
- ^ Anthropic. “Settings files and precedence”. Local and shared settings behaviour, saved approvals and global Git exclusions.
- ^ Git. “gitignore documentation”. Ignore rules do not affect tracked files; project rules can travel with clones.
- ^ GitHub. “Removing sensitive data from a repository”. Credential replacement takes priority over cleanup; prevention and history-removal guidance.
- Anthropic. “Claude Code changelog”. Checked for a relevant fix; no general credential-scrubbing fix was identified.
- Ars Technica (). “Claude Code settings files expose thousands of secrets on GitHub”. Read through search retrieval; later developments excluded from the 7 November draft.
Situation Room articles are updated as events develop: updates are added to the timeline, and never edited away. Follow them by email or RSS.

