Audit a laptop for every leaked secret and credential

A Redditor opened Claude Code in their home folder and had it hunt for keys, tokens and passwords; in about four minutes it reported 63, including still-working AWS keys from 2022.

Done withClaude Code· Oct 28, 2026

What they did

After a public key-leak incident, a Redditor (u/notomarsol) opened Claude Code directly in their home directory and gave it three rules: find anything that looks like a key, token or password; report file paths and variable names only, never print a value; and don't modify anything, just report. The agent then walked the filesystem on its own, reading files to judge whether each one held a secret.

How it went

It finished in about four minutes and reported 63 secrets: 31 in .env files across old side projects, working AWS credentials in ~/.aws dating to 2022, an OpenAI key and a GitHub token sitting in plain text in an MCP config, npm and Docker tokens, and four API keys in shell history. The poster then spent the evening rotating the live keys, deleting dead projects' .env files, and moving active secrets into a vault.

Worth knowing

The agent followed the no-print rule, but the poster notes that to classify each file it had to read it, so many secrets passed through the context window anyway, with no permission prompt, because reading files in the opened folder is normal behaviour. They conclude a 'never read .env' line in CLAUDE.md is a request, not a lock, and warn that opening the agent in your home folder is itself the risk.

Try it

With Claude Code· 1 part to fill in

Open your coding agent in [the folder you want audited] and tell it: scan recursively for anything that looks like a key, token, password or credential. Report only the file path and the variable or field name, never the value itself. Do not modify, move or delete anything. Group the findings by type and give me a count. When you are done, list which files I should clean up first.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related