mod-claude

secret-scrub

Redacts tokens, keys and passwords from tool results before they reach the model or the session transcript

Install

Paste into a Claude Code session in your terminal, one line at a time.

/plugin marketplace add funkadelic/claude-secret-scrub
/plugin install secret-scrub@claude-secret-scrub

secret-scrub

A Claude Code mod that redacts tokens, keys and passwords from tool output before the model reads it and before it is written to your session transcript (~/.claude/projects/).

When a command prints a token, or Claude reads a file holding one, the secret is replaced with [REDACTED:<kind>]. Output with nothing to redact passes through untouched.

Install

At the prompt of a terminal session:

/plugin install secret-scrub --marketplace funkadelic/claude-secret-scrub

Answer y to add the marketplace, then pick a scope.

From a shell:

claude plugin install secret-scrub --marketplace funkadelic/claude-secret-scrub

In the desktop app, where /plugin does not run: click + next to the prompt box, then Plugins, Add marketplace with funkadelic/claude-secret-scrub, then Add plugin.

What it catches

  • GitHub, GitLab, Slack, Stripe, Anthropic, OpenAI, AWS and Google keys
  • JWTs and PEM private key blocks
  • Passwords in URLs (https://user:pass@host)
  • api_key=, secret:, token=, password= style assignments whose value looks like a secret

It covers every tool, including subagents and MCP tools. If a tool fails and its error text holds a secret, the error is withheld and a scrubbed copy is shown instead. If scrubbing itself fails, the output is withheld rather than passed through.

Limits

  • Only tool results are scrubbed. A secret you type into a prompt, or one Claude writes into a command, is not touched.
  • Files holding token-shaped test fixtures read back redacted, so an edit aimed at that exact line will not match.
  • Pattern matching is not a guarantee. Keep running a secret scanner such as gitleaks on anything you sync or share.