Claude Code secrets scanner
Free. Read-only. It runs on your own laptop and sends nothing anywhere.
Clicking "Yes, and don't ask again" in Claude Code can save the whole command, password included, into .claude/settings.local.json. This script finds those files and tells you if one holds a saved password or is tracked by git.
Download claude-secret-check.py
Run it
You need Python 3. Open a terminal in the folder you saved it to:
python3 claude-secret-check.py
It scans your home folder. To check one folder only, pass it in:
python3 claude-secret-check.py ~/projects
What it reports
- Saved commands that look like they hold a password, token or key. Values are masked.
- Settings files that git tracks, or that sit in a repo's history.
If it flags a file
- Remove it from git:
git rm --cached .claude/settings.local.json - Add it to
.gitignore. - Change every password that was in it, even if the repo was never public.
It matches patterns, so a clean result does not mean you are safe. Read the script before you run it, it is about 80 lines.