Skip to content

Instantly share code, notes, and snippets.

@ruvnet
ruvnet / redaction.md
Last active November 4, 2025 14:56
Redaction hooks for Claude Code

A drop-in redaction hook wired through settings.json for Claude Code.

It masks secrets before tools run and censors sensitive fields in transcripts.

what is it?

Data leakage for enterprises using Ai coding is a ███ . Redaction hooks solve ██ problems by catching secrets before they leak. Here’s how I do it.

A redaction hook sits between your agent and the outside world. Every time Claude Code reads a file, runs a shell command, or fetches a web resource, the hook scans for sensitive patterns like API keys, tokens, or passwords. If it sees something dangerous, it either masks it with a placeholder or blocks the request outright. That way, your logs and transcripts remain useful but never expose private values.