File of the day

A Claude Code script that finds passwords left in plain text in your files

Slava Sazhin 9 October 2026 3 min read

Protect your accounts and money: Claude Code finds files with your passwords in plain text, so you remove them in time.

Today's file is a script for Claude Code. A bank password in a note, the Wi-Fi password in meeting minutes, a table of logins in Excel, an API key in a project's .env file: whoever gets a copy of that folder gets the accounts too, from a lost laptop, a shared drive or a backup in the wrong place. The script finds such files, so you can take the passwords out of them first.

How it works

Claude runs find_secrets.py on a folder you name. The script reads every file in it, Word documents (.docx), Excel spreadsheets (.xlsx) and CSV files included, and prints the path of each file that holds a password, an access key or a private key, with what it found there. It never prints the password itself, so the values do not end up in the chat, and it changes nothing. A password counts when a word for password stands next to it, in English, Russian, Portuguese or Serbian (password, пароль, senha, lozinka); a column called Password in a spreadsheet is enough too. A password with no such word nearby is not found. Keys are recognised by their shape: private keys, AWS and GitLab keys, JWT tokens, Google service account files. It skips .git, node_modules and venv folders, and reads only the first 2 MB of a large file.

In our test it named all 21 files we planted: notes with passwords in the four languages, a password table in Word and in Excel, a browser export in CSV, a .env file, a private key, AWS, GitLab and JWT tokens, a database connection string. It passed over placeholders like changeme, ${DB_PASSWORD} and os.environ, and over a sentence like "never share your password". Then we asked Claude, in all four languages, to run it on a test Documents folder and show what it found. In 6 runs out of 6 Claude listed the files and what was in them, opened none of them and offered to look inside only if asked.

What to change

We changed no logic. Two dash characters inside one search pattern became escape codes, so the English file is plain ASCII; it finds exactly the same. Point the script at the folder with your documents, not your whole home folder: a big folder takes minutes, up to a second for each large file, and the home folder also has files that are meant to hold a key, such as the ones in ~/.ssh. To catch a password next to a word in another language, say Passwort, ask Claude to add it to the LABELS line of the script. When it names a file, open the file yourself and move the password to a password manager, and change it if the folder was ever shared. If you ask Claude to open the file, the password goes into the chat.

Install

The note below has the exact requests. The first puts the script into ~/.claude/scripts and checks that python3 is on the computer. That folder holds Claude's own settings, so Claude asks before it writes there: answer Yes. The second runs it on your Documents folder. The check from the note: a test folder with note.txt holding the line Email password: Kofe2026sad. The script names note.txt and the word password, and does not print Kofe2026sad.

The files

find_secrets.py 5 KB
how-to-install.md 2 KB

Files of the day are for paying subscribers: any plan opens every one. Already subscribed? Then sign in.

See the plans

Was this article worth your time?

Read next

Give Claude a computer of its own

Your own Linux machine with Claude Code on it, working around the clock while your laptop is shut. From $3.49 a month.

Contact the Combobulating team