Redacta — a Claude/Agent Skill that pseudonymises medical documents before AI processing
git clone https://github.com/nickjlamb/redacta ~/.claude/skills/redacta1 items in this repository
Pseudonymises medical and clinical documents by replacing patient identifiers with labelled tokens (e.g. [PATIENT_NAME_1], [NHS_NUMBER_1], [DATE_OF_BIRTH_1]) so the text can be safely processed by AI or shared, with clinical meaning intact. Combines a deterministic pattern layer (NHS numbers with Modulus-11 validation, UK National Insurance numbers, dates of birth, UK postcodes, phone numbers, emails, hospital/MRN numbers) with contextual reasoning for patient names, postal addresses and identifying ages, then returns the redacted document plus a redaction report. Use when the user wants to redact, de-identify, anonymise or pseudonymise a medical letter, clinical note, discharge summary, referral or patient record, or before pasting clinical text into another AI tool. Can also re-identify (reverse the redaction) by restoring original values from a token map, and offers a stricter HIPAA Safe Harbor mode for US de-identification (all dates, ages, and the remaining HIPAA identifiers).
Skills overview
# Redacta Pseudonymise medical and clinical documents before they're processed by AI or shared. Redacta replaces patient identifiers with labelled tokens — `[PATIENT_NAME_1]`, `[NHS_NUMBER_1]`, `[DATE_OF_BIRTH_1]`, … — while leaving the clinical meaning intact, and returns a redaction report alongside the cleaned text. It's an [Agent Skill](https://agentskills.io) (the open standard used by Claude and other agents), so it drops into Claude Code, the Claude apps, or the API. ## How it works Two layers: - **Patterns (deterministic).** A bundled script (`scripts/redact_structured.py`, Python standard library only, no network) matches fixed-format identifiers: NHS numbers (Modulus-11 validated), UK National Insurance numbers, dates of birth, UK postcodes, phone numbers, emails, and hospital/MRN numbers. US SSN and ZIP codes are also handled. - **Reasoning (judgement).** The skill then has the agent handle what patterns can't: patient names (told apart from the clinicians treating them), relatives and carers, postal addresses, and identifying ages. - **Self-check.** A final pass re-reads the output for any identifier that slipped through before the report is written. It also works in reverse. **Re-identification** (`scripts/reinstate.py`) takes the token map from an earlier redaction and restores the original values — so you can redact a document, run it through another AI tool, and put the real details back locally. Redact → process → re-identify is a complete round trip, and identifiers only ever exist on your machine. **Safe Harbor mode.** Ask for HIPAA Safe Harbor (or "US de-identification") and Redacta applies a stricter pass: *all* dates (not just the date of birth), all specific ages, and the remaining HIPAA identifiers — fax, certificate/licence, device serial, VIN, and health-plan beneficiary numbers. ## Install **Claude Code** ```bash git clone https://github.com/nickjlamb/redacta ~/.claude/skills/redacta ``` Then invoke it with `/redacta`, or let it trigger automatically when you ask to redact or de-identify clinical text. **Claude apps / API** Zip the repository folder and upload it as a skill. ## Contents | Path | What it is | |------|------------| | `SKILL.md` | The skill — instructions plus metadata | | `reference.md` | Pattern specs, the Modulus-11 algorithm, NI prefix rules, the date-of-birth vs clinical-date rule, token vocabulary, limitations | | `scripts/redact_structured.py` | The deterministic pattern layer | | `scripts/reinstate.py` | The re-identification layer (restore originals from a token map) | | `scripts/test_redact_structured.py` | Tests for the pattern layer | | `scripts/test_reinstate.py` | Tests for the re-identification layer | | `evaluations.json` | Example evaluation scenarios | Run the tests: ```bash python3 scripts/test_redact_structured.py python3 scripts/test_reinstate.py ``` ## A note on limits Redacta is a strong first line of defence, not a guarantee. It won't catch every possible identifier and isn't a substitute for formal data-protection processes. Always review the redaction report before sharing text. ## License [MIT-0](LICENSE) (MIT No Attribution). Built by [PharmaTools.AI](https://www.pharmatools.ai/redacta).
What people ask about redacta
What is nickjlamb/redacta?
+
nickjlamb/redacta is skills for the Claude AI ecosystem. Redacta — a Claude/Agent Skill that pseudonymises medical documents before AI processing It has 2 GitHub stars and was last updated today.
How do I install redacta?
+
You can install redacta by cloning the repository (https://github.com/nickjlamb/redacta) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is nickjlamb/redacta safe to use?
+
nickjlamb/redacta has not been audited yet by our security agent. Review the original repository on GitHub before using it in production.
Who maintains nickjlamb/redacta?
+
nickjlamb/redacta is maintained by nickjlamb. The last recorded GitHub activity is from today, with 0 open issues.
Are there alternatives to redacta?
+
Yes. On ClaudeWave you can browse similar skills at /categories/skills, sorted by popularity or recent activity.
Deploy redacta to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/nickjlamb-redacta)<a href="https://claudewave.com/repo/nickjlamb-redacta"><img src="https://claudewave.com/api/badge/nickjlamb-redacta" alt="Featured on ClaudeWave: nickjlamb/redacta" width="320" height="64" /></a>More Skills
A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
omo/lazycodex: The coding agent for tokenmaxxers;the one and only agent harness for complex codebases. For your Codex, for your OpenCode
Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
Turn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 160,000+ scientists worldwide. 140 ready-to-use skills plus 100+ scientific databases covering biology, chemistry, medicine, and drug discovery. Compatible with Cursor, Claude Code, Codex, Antigravity, and the open Agent Skills standard.
A curated collection of 1000+ agent skills from official dev teams and the community, compatible with Claude Code, Codex, Gemini CLI, Cursor, and more.
No description provided.