Reversible redaction for Claude Code: the model sees placeholders, you and your local tools see real values. Free, no API gateway. Try: /plugin install redact-restore --marketplace isandrel/redact-restore
See the codeRedacted for the model. Restored for you.
Use Claude Code on private projects without handing your secrets to the model.
Private values become placeholders before they leave your machine, and come back the moment they return.
Every prompt you type, every file Claude reads and every command output goes to the model. Customer names, internal hostnames, API keys, the email in your git config: all of it is context.
Redact Restore sits inside Claude Code as a native Mod:
{{PRIVATE:EMAIL#3fa1c09e8b2d}}, never the value.Bash, Edit, Write, Grep and local MCP tools receive the real values, so builds, scripts and file edits are correct.sequenceDiagram
autonumber
actor You
participant RR as Redact Restore<br/>(on your machine)
participant Model as Claude model API
participant Tools as Local tools
You->>RR: Email [email protected] about Project Phoenix
RR->>Model: Email {{PRIVATE:EMAIL#35;3fa1…}} about {{PRIVATE:CUSTOM#35;9c2e…}}
Model-->>RR: Run a command with {{PRIVATE:EMAIL#35;3fa1…}}
RR->>Tools: Command runs with [email protected]
Tools-->>RR: Output (may contain originals)
RR->>Model: Output masked again
Model-->>RR: Reply with placeholders
RR-->>You: Reply shown with the original values
flowchart LR
subgraph Local["🖥️ Your machine"]
P[Your prompts]
C[CLAUDE.md and account email]
A[Mentioned files and reminders]
S[System prompt]
R[Tool results]
M{{"Mask<br/>your values · email · 240+ detectors"}}
AU{"Pre-send audit"}
P --> M
C --> M
A --> M
S --> M
R --> M
M --> AU
end
AU -->|placeholders only| API[("Claude API")]
AU -.->|value still visible| X["⛔ Request refused"]
flowchart TD
Call["Tool call from the model"] --> Kind{"Where does its input go?"}
Kind -->|"To another model or service:<br/>Agent, WebFetch, WebSearch, Workflow, …"| Keep["Placeholders kept"]
Kind -->|"Stays on this machine:<br/>Bash, Edit, Write, Grep, local MCP"| Mode{"restore_mode"}
Mode -->|"all (default)"| Real["Original values restored"]
Mode -->|"files"| Files["Only file edits restored"]
Mode -->|"none"| Refuse["Placeholders kept; file edits refused"]
| Feature | What it does |
|---|---|
| 🎯 Your own values | List names, codenames, hosts or any exact string. In a form: pick a label (PROJECT → {{PRIVATE:PROJECT#…}}) or set a fixed alias (CODENAME_X). |
| 🔎 240+ detectors | 200+ API key and token formats (Anthropic, OpenAI, AWS, GitHub, Stripe, Google, …, including the gitleaks rule set), JWTs, private keys, passwords, cards, IBANs, and Chinese ID, mobile and company codes, with checksum and entropy validation. |
| 🧱 Defense in depth | Masks prompts, context, attachments, the system prompt and every stored row; audits each request before it is sent; withholds images it cannot scan. |
| 🔁 Reversible by design | Same value, same placeholder within a session. Restored on screen, optionally while streaming, and in local tool inputs. Unknown placeholders are refused, never guessed. |
| ⚙️ Configurable | Placeholder format, which tools get originals, which detectors run, status line content: all options, all with safe defaults. |
| 🗂️ Rules pane and scan | /redact-restore rules to add, update or remove values; /redact-restore scan to find your name, coworkers, hosts and .env values locally; import and export to move them between machines. Values are shown only on your screen, masked until you ask. |
| 📊 Visible | A status line such as 4 private values masked, a Session tab with this session's counts and placeholders, a template, and a status file your own statusLine script can read (counts only, never values). |
| 🧪 Tested | Unit and integration suites through the engine's own dispatch, live tests in a real Claude Code session, and a regression test for every reviewed leak. |
| Capability | API gateway or proxy | One-way redaction hooks | Redact Restore |
|---|---|---|---|
| Keeps the official Claude login and endpoint | ❌ | ✅ | ✅ |
| Model never sees configured values | ✅ | ✅ | ✅ |
| Shows you the original values | ✅ | ❌ | ✅ |
| Local commands and file edits get real values | ✅ | ⚠️ some | ✅ |
| Model-bound tools kept on placeholders | ➖ | ➖ | ✅ |
| Checks every request before it is sent | ⚠️ varies | ❌ | ✅ |
1. Install from isandrel/redact-restore. At a Claude Code prompt, in the terminal or the desktop app's Code tab (answer y to add the marketplace, then pick a scope):
/plugin install redact-restore --marketplace isandrel/redact-restore
Or from a shell:
claude plugin marketplace add isandrel/redact-restore
claude plugin install redact-restore@redact-restore
2. Tell it what is private, without typing values in chat:
/redact-restore scan finds your git identity, coworkers, remotes, machine and account names, and .env values. Pick Add or Ignore in the pane./redact-restore rules adds your own in a form: the private value (Acme Corp), then a label (CUSTOMER) or a fixed alias (CLIENT_A), with a preview of what the model sees./plugin → Installed → redact-restore → Configure options → Exact private values.3. Start clean and check. Run /clear, then /redact-restore session or look at the status line under the prompt. Ask Claude to spell a protected value character by character: it can only spell the placeholder.
Update later with claude plugin update redact-restore@redact-restore. The plugin also ships skills you can ask for by name: /redact-restore:protect, :scan, :status, :policy, :placeholders, :troubleshoot, :import and :export.
Requires Claude Code 2.1.287 or newer with Mods support (the desktop app's Code tab from 2.1.286). A user-scope install is active in every CLI and Desktop Code session;
--scope locallimits it to one folder.
| Document | What it covers |
|---|---|
| Configuration | Every option, placeholder formats, labels and aliases, status fields |
| Detectors | What is detected, how it is validated, how to turn detectors on or off |
| Security model | Coverage of every path to the model, review findings, known limitations |
| Compatibility | CLI and Desktop Code test matrix |
| Test plan | Automated and live test steps |
| Changelog | Release notes |
Redact Restore is experimental. It is tested live in the Claude Code CLI 2.1.287 (including subagents, compaction, /resume and concurrent sessions); In the desktop app's Code tab the status line is confirmed; the rest is kit-tested only so far. It is not a data-loss-prevention product: it protects the paths described in the security model, and tools that run locally act on real values by design. Try it with synthetic data first.
Contributions are welcome: new detectors, false-positive fixes, docs and tests. Read the contributing guide, and report leaks privately through SECURITY.md, never in a public issue. This project follows a Code of Conduct.
Thanks to LINUX DO for supporting open-source developers and community sharing.
GNU Affero General Public License v3.0. The vendored gitleaks rules in hooks/vendor/ are MIT-licensed; see hooks/vendor/LICENSE-gitleaks.txt.
Reversible redaction for Claude Code: the model sees placeholders, you and your local tools see real values. Free, no API gateway. Try: /plugin install redact-restore --marketplace isandrel/redact-restore
See the codeRedacted for the model. Restored for you.
Use Claude Code on private projects without handing your secrets to the model.
Private values become placeholders before they leave your machine, and come back the moment they return.
Every prompt you type, every file Claude reads and every command output goes to the model. Customer names, internal hostnames, API keys, the email in your git config: all of it is context.
Redact Restore sits inside Claude Code as a native Mod:
{{PRIVATE:EMAIL#3fa1c09e8b2d}}, never the value.Bash, Edit, Write, Grep and local MCP tools receive the real values, so builds, scripts and file edits are correct.sequenceDiagram
autonumber
actor You
participant RR as Redact Restore<br/>(on your machine)
participant Model as Claude model API
participant Tools as Local tools
You->>RR: Email [email protected] about Project Phoenix
RR->>Model: Email {{PRIVATE:EMAIL#35;3fa1…}} about {{PRIVATE:CUSTOM#35;9c2e…}}
Model-->>RR: Run a command with {{PRIVATE:EMAIL#35;3fa1…}}
RR->>Tools: Command runs with [email protected]
Tools-->>RR: Output (may contain originals)
RR->>Model: Output masked again
Model-->>RR: Reply with placeholders
RR-->>You: Reply shown with the original values
flowchart LR
subgraph Local["🖥️ Your machine"]
P[Your prompts]
C[CLAUDE.md and account email]
A[Mentioned files and reminders]
S[System prompt]
R[Tool results]
M{{"Mask<br/>your values · email · 240+ detectors"}}
AU{"Pre-send audit"}
P --> M
C --> M
A --> M
S --> M
R --> M
M --> AU
end
AU -->|placeholders only| API[("Claude API")]
AU -.->|value still visible| X["⛔ Request refused"]
flowchart TD
Call["Tool call from the model"] --> Kind{"Where does its input go?"}
Kind -->|"To another model or service:<br/>Agent, WebFetch, WebSearch, Workflow, …"| Keep["Placeholders kept"]
Kind -->|"Stays on this machine:<br/>Bash, Edit, Write, Grep, local MCP"| Mode{"restore_mode"}
Mode -->|"all (default)"| Real["Original values restored"]
Mode -->|"files"| Files["Only file edits restored"]
Mode -->|"none"| Refuse["Placeholders kept; file edits refused"]
| Feature | What it does |
|---|---|
| 🎯 Your own values | List names, codenames, hosts or any exact string. In a form: pick a label (PROJECT → {{PRIVATE:PROJECT#…}}) or set a fixed alias (CODENAME_X). |
| 🔎 240+ detectors | 200+ API key and token formats (Anthropic, OpenAI, AWS, GitHub, Stripe, Google, …, including the gitleaks rule set), JWTs, private keys, passwords, cards, IBANs, and Chinese ID, mobile and company codes, with checksum and entropy validation. |
| 🧱 Defense in depth | Masks prompts, context, attachments, the system prompt and every stored row; audits each request before it is sent; withholds images it cannot scan. |
| 🔁 Reversible by design | Same value, same placeholder within a session. Restored on screen, optionally while streaming, and in local tool inputs. Unknown placeholders are refused, never guessed. |
| ⚙️ Configurable | Placeholder format, which tools get originals, which detectors run, status line content: all options, all with safe defaults. |
| 🗂️ Rules pane and scan | /redact-restore rules to add, update or remove values; /redact-restore scan to find your name, coworkers, hosts and .env values locally; import and export to move them between machines. Values are shown only on your screen, masked until you ask. |
| 📊 Visible | A status line such as 4 private values masked, a Session tab with this session's counts and placeholders, a template, and a status file your own statusLine script can read (counts only, never values). |
| 🧪 Tested | Unit and integration suites through the engine's own dispatch, live tests in a real Claude Code session, and a regression test for every reviewed leak. |
| Capability | API gateway or proxy | One-way redaction hooks | Redact Restore |
|---|---|---|---|
| Keeps the official Claude login and endpoint | ❌ | ✅ | ✅ |
| Model never sees configured values | ✅ | ✅ | ✅ |
| Shows you the original values | ✅ | ❌ | ✅ |
| Local commands and file edits get real values | ✅ | ⚠️ some | ✅ |
| Model-bound tools kept on placeholders | ➖ | ➖ | ✅ |
| Checks every request before it is sent | ⚠️ varies | ❌ | ✅ |
1. Install from isandrel/redact-restore. At a Claude Code prompt, in the terminal or the desktop app's Code tab (answer y to add the marketplace, then pick a scope):
/plugin install redact-restore --marketplace isandrel/redact-restore
Or from a shell:
claude plugin marketplace add isandrel/redact-restore
claude plugin install redact-restore@redact-restore
2. Tell it what is private, without typing values in chat:
/redact-restore scan finds your git identity, coworkers, remotes, machine and account names, and .env values. Pick Add or Ignore in the pane./redact-restore rules adds your own in a form: the private value (Acme Corp), then a label (CUSTOMER) or a fixed alias (CLIENT_A), with a preview of what the model sees./plugin → Installed → redact-restore → Configure options → Exact private values.3. Start clean and check. Run /clear, then /redact-restore session or look at the status line under the prompt. Ask Claude to spell a protected value character by character: it can only spell the placeholder.
Update later with claude plugin update redact-restore@redact-restore. The plugin also ships skills you can ask for by name: /redact-restore:protect, :scan, :status, :policy, :placeholders, :troubleshoot, :import and :export.
Requires Claude Code 2.1.287 or newer with Mods support (the desktop app's Code tab from 2.1.286). A user-scope install is active in every CLI and Desktop Code session;
--scope locallimits it to one folder.
| Document | What it covers |
|---|---|
| Configuration | Every option, placeholder formats, labels and aliases, status fields |
| Detectors | What is detected, how it is validated, how to turn detectors on or off |
| Security model | Coverage of every path to the model, review findings, known limitations |
| Compatibility | CLI and Desktop Code test matrix |
| Test plan | Automated and live test steps |
| Changelog | Release notes |
Redact Restore is experimental. It is tested live in the Claude Code CLI 2.1.287 (including subagents, compaction, /resume and concurrent sessions); In the desktop app's Code tab the status line is confirmed; the rest is kit-tested only so far. It is not a data-loss-prevention product: it protects the paths described in the security model, and tools that run locally act on real values by design. Try it with synthetic data first.
Contributions are welcome: new detectors, false-positive fixes, docs and tests. Read the contributing guide, and report leaks privately through SECURITY.md, never in a public issue. This project follows a Code of Conduct.
Thanks to LINUX DO for supporting open-source developers and community sharing.
GNU Affero General Public License v3.0. The vendored gitleaks rules in hooks/vendor/ are MIT-licensed; see hooks/vendor/LICENSE-gitleaks.txt.