cd /news/ai-tools/show-hn-redacted-stop-handing-claude… · home › topics › ai-tools › article
[ARTICLE · art-170236] src=github.com ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Show HN: Redacted - Stop Handing Claude Your Secrets

A developer released Redacted, an open-source tool that scrubs secrets from tool output before an AI coding assistant reads it, distributed via a curl install script, Homebrew, Cargo and pre-built binaries for Linux, macOS and Windows. Redacted runs as a Claude Code PostToolUse hook, scanning locally with no network calls, and ships 46 built-in vendor patterns covering AWS, GitHub, Stripe, OpenAI, Anthropic, database URLs and private keys, plus a `redacted init` command that learns values from .env files by storing only a SHA-256 hash, length and optional shape. The tool matters because secrets persist in the on-disk transcript and every later request once they enter context, and its documented limits include whole-token-only matching for learned secrets, possible false positives on high-entropy identifiers when the entropy heuristic is enabled, and unscrubbed output from commands typed with `!` at the Claude Code prompt.

read3 min views1 publishedNov 16, 2026
Show HN: Redacted - Stop Handing Claude Your Secrets
Image: Michielbdejong (auto-discovered)

Removes secrets from tool output before your AI coding assistant reads it.

Tool output:

DATABASE_URL=postgres://admin:secret@db.example.com:5432/prod
AWS_ACCESS_KEY_ID=AKIAEXAMPLEKEYID0001
SMTP_PASS="Qf7mZp2kLw9vTx4nRb2024"
APP_NAME=myapp

What the model reads (the third line needs SMTP_PASS learned by redacted init):

DATABASE_URL=[REDACTED:database_url ...prod]
AWS_ACCESS_KEY_ID=[REDACTED:aws_access_key ...0001]
SMTP_PASS="[REDACTED:smtp_pass ...2024]"
APP_NAME=myapp

Secrets reach the model through normal work, not only through cat .env:

  • Ordinary output carries them: a committed key in git diff , a token in a log, a stack trace that prints the environment.
  • Some commands exist to print them: heroku config ,kubectl get secret -o yaml ,aws secretsmanager get-secret-value .
  • Deny lists check the command string. An npm script, a make target or a wrapper CLI changes the string, not the output.
  • Once in context, a secret stays in the transcript on disk and in every later request.

redacted does not judge commands. It scrubs the output, whatever produced it.

  • Runs as a Claude Code PostToolUse hook: redacted scrub reads each tool result on stdin.
  • Scanning happens on your machine. No network calls.
  • A secret is replaced inline by a marker that keeps its last 4 characters.
  • Clean output passes through unchanged.
curl -sSL https://raw.githubusercontent.com/svn-arv/redacted/main/install.sh | sh
redacted init

Homebrew, Cargo and pre-built binaries for Linux, macOS and Windows are in the reference.

  • Learns the secrets in your .env files, so the hook catches them even when no vendor pattern knows their format.
  • Stores a SHA-256 hash, the length and an optional shape for each value. Never the value.
  • You pick the values to learn and confirm the config before anything is written.
  • Registers the hook in your Claude Code settings. Safe to run again.

Full walkthrough and flags: Setup: redacted init.

Tier What it catches Default
Vendor signatures Keys with a known format: 46 built-in patterns covering AWS, GitHub, Stripe, OpenAI, Anthropic, database URLs, private keys and more. on
Learned secrets The values redacted init learned from your.env , matched by hash, plus rotated keys with the same prefix. on once init writes entries
Entropy heuristic Random-looking values in KEY=value lines that no other tier knows. off

Email addresses and phone numbers can be scrubbed too. Each is off until you turn it on in the config.

Every pattern and what it matches: What it detects.

  • Claude Code, through the PostToolUse hook.
  • OpenCode, through the plugin that redacted init --format opencode writes.

Other assistants, and whether their hooks can replace tool output, are listed under Other tools.

  • Learned secrets match as whole tokens. One embedded mid-token, such as in a URL path, passes unless a vendor pattern catches it.

  • A learned shape also matches a non-secret with the same prefix and similar length. Check the shape init shows before confirming.

  • With the heuristic on, a high-entropy identifier that mixes case and digits (some tool or request ids) may be redacted. The 4-character hint makes these easy to spot.

  • Every pattern scans the full output in turn, after a substring prefilter. Multi-megabyte output adds noticeable latency per call.

  • Commands typed at the Claude Code prompt with ! are not tool calls. Their output reaches the model unscrubbed.

  • Reference : install methods,init , every pattern, configuration and commands.

  • Architecture : how the code fits together.

  • Benchmark : recall and precision on the test corpus.

  • Contributing : development, adding a detection rule and releasing.

MIT

── more in #ai-tools 4 stories · sorted by recency
── more on @redacted 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-redacted-sto…] indexed:0 read:3min 2026-11-16 · —