Skip to main content
skill CX Codex

session-anonymizer — Claude Code skill: what it does, how to install

session-anonymizer redacts client PII from therapy, coaching, and mentoring session transcripts using a local three-tier pipeline.

MIT 159 installs ★ 414 updated 2026-10-23

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add glebis/claude-skills --skill session-anonymizer -a claude-code
Open on GitHub

What session-anonymizer does

The skill sanitizes transcripts and notes containing personal identifiers before further analysis. Detection relies on a chained approach: Natasha handles Russian names and locations, OpenAI Privacy Filter targets contact details and addresses, while an Ollama instance catches drug names, dates, and contextual markers. Overlapping entity spans are resolved into a single masked output.

All tasks execute through a local Python runner, keeping raw client discussions on your machine. You can pass inputs via files or stdin, process directories in batches, replace real identities with pseudonyms, and protect exports with AES-256 encryption.

Each layer acts independently; the script continues with available components if one is missing. Drug and medication detection relies solely on Layer 3, which fails to work if Ollama is absent.

What it helps with

  • strip client identifiers from session notes before feeding text into models
  • mask Russian and English transcripts locally without network calls
  • swap real names for consistent pseudonyms across a document
  • encrypt sanitized transcripts with AES-256 passwords

Example prompts for the agent

  • Redact PII from session.txt and assign pseudonyms to participants
  • Anonymize this transcript via stdin and return detected spans as JSON
  • Process all session logs in ~/sessions/ and output clean copies to ~/sessions_clean/

How to install session-anonymizer

1Skills CLI (Vercel)

npx skills add glebis/claude-skills --skill session-anonymizer -a claude-code

2Manually: put the files in place

~/.claude/skills/session-anonymizer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/session-anonymizer/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about session-anonymizer

How to install session-anonymizer in Claude Code?

Run npx skills add glebis/claude-skills --skill session-anonymizer -a claude-code in your terminal.

What does session-anonymizer do?

It masks sensitive personal records in transcripts by combining the Natasha NER engine, OpenAI Privacy Filter, and a local Ollama model.

What dependencies are necessary to run all detection stages?

You need Python libraries natasha, setuptools, pymorphy2-dicts-ru, the git package opf, and an Ollama service with qwen3:4b installed.

Source text

SKILL.md · MIT
---
name: session-anonymizer
description: Three-layer PII anonymization for session transcripts (therapy, coaching, consulting, mentoring). Runs Natasha (Russian NER), OpenAI Privacy Filter, and local LLM (Ollama) in sequence for maximum coverage. Fully local by default. This skill should be used when anonymizing session transcripts, notes, or any text containing client PII before AI analysis. Triggers on "anonymize", "redact PII", "anonymize session", "protect client data", "strip personal data", "anonymize transcript".
---

# Therapy Anonymizer

Three-layer PII detection and anonymization for therapy session transcripts. Supports Russian and English. Fully local by default — no data leaves the machine.

## Architecture

Three detection layers run in sequence, each catching what others miss:

| Layer | Tool | Catches | Size | Speed |
|-------|------|---------|------|-------|
| 1 | Natasha | Russian names, locations, organizations | 27 MB | instant |
| 2 | OpenAI Privacy Filter (opf) | Phones, accounts, addresses, emails | 2.8 GB | ~1.5s |
| 3 | Ollama LLM | Medications, dates, contextual IDs | 2.5-7 GB | ~10s |

Spans from all layers are merged, overlaps resolved, and a unified redacted output is produced.

## Prerequisites

```bash
pip install natasha setuptools pymorphy2-dicts-ru
pip install 'opf @ git+https://github.com/openai/privacy-filter.git'
ollama pull qwen3:4b
```

Each layer is optional — the script gracefully skips unavailable layers and warns.

## Usage

### Single file

```bash
python3 ~/.claude/skills/therapy-anonymizer/scripts/anonymize.py session.txt
```

### Stdin pipe

```bash
cat session.txt | python3 ~/.claude/skills/therapy-anonymizer/scripts/anonymize.py
```

### Batch processing

```bash
python3 ~/.claude/skills/therapy-anonymizer/scripts/anonymize.py --batch ~/sessions/ -o ~/sessions_clean/
```

### JSON report

```bash
python3 ~/.claude/skills/therapy-anonymizer/scripts/anonymize.py session.txt --json
```

### Pseudonyms instead of tags

```bash
python3 ~/.claude/skills/therapy-anonymizer/scripts/anonymize.py session.txt --pseudonyms
```

### Select layers / model

```bash
# Fast — Natasha only
python3 ~/.claude/skills/therapy-anonymizer/scripts/anonymize.py session.txt --layers natasha

# LLM only — maximum coverage
python3 ~/.claude/skills/therapy-anonymizer/scripts/anonymize.py session.txt --layers ollama --model gemma4:e2b
```

### Encrypt output (AES-256)

```bash
python3 ~/.claude/skills/therapy-anonymizer/scripts/anonymize.py session.txt -o clean.txt --encrypt "password"
```

## Invoking from Claude Code

To anonymize text already in context, pipe it through the script:

```bash
echo '<text>' | python3 ~/.claude/skills/therapy-anonymizer/scripts/anonymize.py --json
```

For files, pass the path directly. Always recommend manual review after automated anonymization.

## Limitations

- Contextual identifiers ("the only red-haired architect in Kostroma") are NOT detected by any automated tool
- OPF is English-focused — Russian coverage is partial
- Medications detected only by Layer 3 (requires Ollama)
- Does not assess re-identification risk from combinations of non-PII fields

## Guardrails

- NEVER send raw transcripts to cloud services
- Cloud verification only on already-anonymized text
- Always recommend manual review for therapy data
- Never log original PII values

© glebis · MIT · glebis/claude-skills

Similar skills

All skills for Security →

From the same set51

The whole set →

Project sponsors

Companies that keep this analytics open