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. 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 https://github.com/svn-arv/redacted/blob/main/docs/REFERENCE.md install . - 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 https://github.com/svn-arv/redacted/blob/main/docs/REFERENCE.md 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 https://github.com/svn-arv/redacted/blob/main/docs/REFERENCE.md 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 https://github.com/svn-arv/redacted/blob/main/docs/REFERENCE.md 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 https://github.com/svn-arv/redacted/blob/main/docs/REFERENCE.md : install methods, init , every pattern, configuration and commands. - Architecture https://github.com/svn-arv/redacted/blob/main/docs/ARCHITECTURE.md : how the code fits together. - Benchmark https://github.com/svn-arv/redacted/blob/main/docs/BENCHMARK.md : recall and precision on the test corpus. - Contributing https://github.com/svn-arv/redacted/blob/main/CONTRIBUTING.md : development, adding a detection rule and releasing. MIT