redact

redact is a command for Claude Code from coltonbearden/carrel. It costs 45 tokens per session (827 once invoked), scanned A, original, MIT.

A command-line tool that removes matching sensitive text from text files and PDFs. It supports common data such as email addresses, phone numbers, Social Security numbers, IP addresses, card numbers, and custom patterns.

In plain words
What is it for?
Use it to create redacted copies of text files or PDFs, replacing matches in text files and painting over matched words in PDFs.
Why use it?
It helps prevent private data from being shared accidentally. PDF pages are rasterized and their text layer is removed, rather than merely covered with a visible box.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the carrel-documents plugin — 1 skill, 5 commands, 1 agent shipped together

Good fit Use it to create redacted copies of text files or PDFs, replacing…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/coltonbearden/carrel/redact
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/coltonbearden/carrel

Made for: Claude Code.

Or install carrel-documents, the plugin that ships this one along with the rest of its 1 skill, 5 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for redact

README.md
[![agentmods](https://agentmods.dev/badge/commands/coltonbearden/carrel/redact.svg)](https://agentmods.dev/commands/coltonbearden/carrel/redact)
Your own site
<a href="https://agentmods.dev/commands/coltonbearden/carrel/redact"><img src="https://agentmods.dev/badge/commands/coltonbearden/carrel/redact.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 827 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.00827
Opus 5 $0.00023 $0.00413
Sonnet 5 $0.00009 $0.00165
Haiku 4.5 $0.00005 $0.00083

Measured yesterday against content hash d5eb93a8482d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

redact scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/carrel-documents/commands/redact.md · 42 lines

What it actually says

Redact the file the user asked about: $ARGUMENTS

Run the carrel CLI via Bash. Map the user's request onto the real flags in the --help block below (regenerated from the CLI by scripts/sync_plugins.py; if the installed carrel redact --help differs, trust the installed version — never invent flags):

Usage: carrel redact [OPTIONS] SRC

  Redact sensitive strings from a text file or PDF.

  Text files get regex replacement (JSON/XML are re-parsed afterwards so they stay valid). PDFs are
  truly redacted: pages are rasterized, matched words are painted over, and the output carries no
  text layer at all. Requires tesseract for PDFs.

Options:
  --pattern REGEX     Custom regex to redact (repeatable).
  --builtin LIST      Comma-separated builtins: email, phone, ssn, ipv4, cc.
  --replacement TEXT  Replacement text for matches (text files only).  [default: █]
  -o, --out PATH      Output file. Default: SRC.redacted.<ext>.
  --fail-empty        Exit 5 when nothing matched.
  --force             Allow overwriting an existing output file.
  --json              Machine-readable JSON output.
  --help              Show this message and exit.
  • --builtin LIST: comma-separated email,phone,ssn,ipv4,cc — the fast path for "strip PII". --pattern REGEX (repeatable) for anything else (names, account numbers, project codenames). Combine both freely.
  • Text files (txt/md/html/csv/xml/json) get regex replacement with --replacement (default ); JSON/XML are re-parsed afterwards so they stay valid.
  • PDFs are truly redacted: pages are rasterized, matched words are painted over, and the output carries no text layer at all — nothing can be recovered by copy-paste or text extraction, but the file is also no longer searchable. Say this to the user; if they need a searchable result afterwards, run carrel ocr OUT.redacted.pdf --to pdf on the redacted copy. Needs tesseract (exit 3 → relay the install hint).
  • Output defaults to SRC.redacted.<ext> next to the source; the original is never modified. --force only when the user explicitly wants an existing output overwritten. --fail-empty exits 5 when nothing matched — useful when the user expects hits.

Use --json and report how many matches were redacted per pattern and the output path. Verify before declaring success: for text outputs, grep -c the original pattern in the output (expect 0) or run carrel diff SRC OUT; for PDFs, carrel convert OUT --to txt should yield no text at all. If matches were zero, say so plainly and suggest patterns rather than reporting "done". For a full redact → verify → sign workflow use this plugin's document-clerk agent and redaction-and-provenance skill.

Requires the carrel CLI on PATH. If carrel is not found, tell the user to install it with uv tool install carrel (see the repo's INSTALL notes), or run it as uv run carrel ... from the carrel repo root.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 42 lines · 0 tokens per session scan A d5eb93a8482d

Subscribe to this mod's changes

redact is a command published in the GitHub repository coltonbearden/carrel (1 stars, last pushed 2d ago), licensed MIT. It adds 45 tokens to every session and 827 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.