devwithcoffee

Is there a secret in your Claude Code settings?

Paste .claude/settings.local.json or pick your project folder. It finds API keys, tokens and passwords saved by “Don’t ask again” and gives you a cleaned copy. Your file stays in this tab.

Your settings file

Project files: .claude/settings.local.json and .claude/settings.json. Your user file: ~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json). On a Mac, press Cmd+Shift+. in the picker to see hidden folders. If your browser says “upload”, that is its standard wording: the files are read in this tab and nothing is sent.

How a secret gets in there

Claude Code asks before it runs a command. If you pick “Yes, and don’t ask again”, it saves the whole command as an allow rule in .claude/settings.local.json. Approve curl -H "Authorization: Bearer ghp_…" once and the token sits in that file, inside your project folder.

A study discussed on Hacker News found passwords and keys in 1,122 public GitHub files made this way. A member of the Claude Code team replied that Claude Code has not done secret scrubbing and that they are looking into it.

I ran the scanner on every Claude settings file on my own machine: 7 files, 18 rules, no secrets. That is a small sample: most of my approvals are plain build and git commands.

If it finds something

Frequently asked

Why is there a password in my settings.local.json?

When Claude Code asks to run a command and you pick "Yes, and don't ask again", it saves that command as an allow rule. If the command had a token or password written in it, the rule has it too, in plain text.

Is my file uploaded?

No. The page reads the file in your tab with JavaScript and has no server code that could receive it. To check, open devtools and watch the Network tab while you scan, or load the page, go offline, and scan then.

Should settings.local.json be in git?

No. It is meant to stay on your machine. settings.json is meant to be shared with your team, so a secret in that file is worse: it is in git by design.

I removed the rule. Am I safe?

Only if the file was never committed, pushed or shared. Git keeps old versions, so a secret that was ever committed should be treated as public. Rotate it first, then clean the file.

What does it look for?

Known token formats (Anthropic, OpenAI, GitHub, GitLab, AWS, Slack, Stripe, Google, npm, Hugging Face, SendGrid, JWTs, private keys), Authorization and API key headers, passwords in URLs and curl -u, password flags, and variables named like PASSWORD, TOKEN or API_KEY. It reads allow, ask and deny rules and the env block.

What could it miss?

A secret in a shape it doesn't know, such as a short random password passed as a plain argument. Values that start with $ (like $GITHUB_TOKEN) are skipped on purpose, because that is the safe way to write them. Zero hits means none were found, not that there are none.

What does the cleaned file change?

It drops every allow and ask rule that had a secret in it and keeps everything else. Deny rules are flagged but never removed, because removing one would loosen your permissions. Secrets in env are flagged, not removed.


Built by Himanshu Srivastava, a backend engineer in Bengaluru. To check your transcripts too, try the Claude Code email leak checker. To see what your Claude Code usage would cost at API prices, try the usage cost calculator. To read a token without sending it anywhere, use the JWT decoder, or see all the tools.