extracting-pii-entities

extracting-pii-entities is a skill for Claude Code from maziyarpanahi/openmed. It costs 141 tokens per session (1,840 once invoked), scanned A, original, Apache-2.0.

A tool for locating private or identifying details in clinical text, such as names, dates, medical record numbers, phone numbers, and addresses. It reports their labels and positions without changing the original text.

In plain words
What is it for?
Use it to audit clinical text, preview what a de-identification step would affect, or pass detected spans to another redaction tool. It detects identifiers but does not redact them.
Why use it?
It lets you inspect or route sensitive spans before choosing how to remove or mask them, while preserving the source text for review.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the openmed-skills plugin — 74 skills shipped together

Good fit Use it to audit clinical text, preview what a de-identification step would affect, or pass detected spans to another redaction tool. It detects identifiers but does not redact them.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/maziyarpanahi/openmed/extracting-pii-entities
About the project

OpenMed is local-first healthcare AI software that extracts clinical information and removes personally identifying details from clinical text on hardware controlled by the user. Healthcare developers use its Python runtime, Apple Silicon and mobile SDKs, and browser support for on-device clinical NER and PII de-identification.

maziyarpanahi/openmed · 5,290 stars · on GitHub · openmed.life

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.

Any agent
npx skills add maziyarpanahi/openmed --skill extracting-pii-entities
Clone the repo
git clone --depth 1 https://github.com/maziyarpanahi/openmed

Made for: Claude Code.

Or install openmed-skills, the plugin that ships this one along with the rest of its 74 skills.

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 extracting-pii-entities

README.md
[![agentmods](https://agentmods.dev/badge/skills/maziyarpanahi/openmed/extracting-pii-entities/github.svg)](https://agentmods.dev/skills/maziyarpanahi/openmed/extracting-pii-entities)
Your own site
<a href="https://agentmods.dev/skills/maziyarpanahi/openmed/extracting-pii-entities"><img src="https://agentmods.dev/badge/skills/maziyarpanahi/openmed/extracting-pii-entities/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for extracting-pii-entities

Your own site · 80×15
<a href="https://agentmods.dev/skills/maziyarpanahi/openmed/extracting-pii-entities"><img src="https://agentmods.dev/badge/skills/maziyarpanahi/openmed/extracting-pii-entities.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 141 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,840 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00141 $0.01840
Opus 5 $0.00071 $0.00920
Sonnet 5 $0.00028 $0.00368
Haiku 4.5 $0.00014 $0.00184

Measured 12d ago against content hash a96084543874, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

extracting-pii-entities 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 12d ago.

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.

skills/extracting-pii-entities/SKILL.md · 168 lines

How it starts

The opening of the file, as written. The whole thing — 168 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Extracting PII Entities

openmed.extract_pii finds PHI/PII spans and returns them without changing the text. Use it when you need to see the identifiers — to audit, route to a custom redactor, or decide a policy — rather than produce redacted output. It runs on-device.

When to use

  • You want the spans and labels of identifiers, with the original text intact.
  • You need a preview of what deidentify would act on before committing.
  • You are feeding detected spans into a downstream redactor (your own, Presidio, or deidentify).
  • You want to normalize model labels to a stable canonical taxonomy.

If you instead want redacted/masked output directly, use deidentifying-clinical-text (openmed.deidentify). If you need reversible masking, see reidentifying-text.

extract_pii vs deidentify

extract_pii deidentify
Changes the text? No Yes (mask/remove/replace/hash/shift)
Returns PredictionResult (spans) DeidentificationResult (redacted text)
Default threshold 0.5 0.7 (safety-biased)
Use for detection, audit, routing producing safe output

Install

pip install "openmed[hf]"

Quick start

import openmed

note = "Patient John Doe (MRN 00481726), DOB 1970-01-15, phone 617-555-0142."

result = openmed.extract_pii(note, confidence_threshold=0.5)

for ent in result.entities:
    print(f"{ent.label:10} {ent.text!r:18} {ent.confidence:.2f} [{ent.start}:{ent.end}]")

extract_pii(...) returns a PredictionResult. Its .entities are PIIEntity objects (synthetic example fields shown):

ent.text            # the identifier surface string, e.g. "617-555-0142"
ent.label           # detected label, e.g. "PHONE"
ent.confidence      # model score in [0, 1]   (NOTE: .confidence, not .score)
ent.start / ent.end # character offsets into the original note
ent.canonical_label # label mapped to OpenMed's canonical taxonomy (if set)
ent.entity_type     # same as label

Read the full file on GitHub · 168 lines

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. 12d ago First seen · 168 lines · 141 tokens per session scan A a96084543874

Subscribe to this mod's changes

extracting-pii-entities is a skill published in the GitHub repository maziyarpanahi/openmed (5,290 stars, last pushed yesterday), licensed Apache-2.0. It adds 141 tokens to every session and 1,840 once invoked, about $0.0007 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-08-30.

Related

Other skills, from other repositories

add-new-model

Use this skill when the user wants to add or port a new model architecture to MLX-VLM — mapping a Hugging Face modeltype to a new file under mlxvlm/models, writing the ModelConfig, matching layer/weight names, reusing a similar existing model, adding a test class, and validating the port. Covers vision-language…

Blaizzy/mlx-vlm · 83 tokens

benchmarking

Use this skill when the user wants to benchmark an MLX-VLM change and present the numbers in a PR — fork-vs-main A/B comparisons, isolated-module micro-benchmarks, median-of-N timing with warmup, peak-memory reporting, correctness checks, parameter sweeps, and self-contained reproducible bench scripts to paste into a…

Blaizzy/mlx-vlm · 74 tokens

convert-quantize

Use this skill when the user wants to convert a Hugging Face model to MLX or quantize/dequantize one with mlxvlm.convert, including bits and group size, quant modes (affine, mxfp4, nvfp4, mxfp8), RTN vs AWQ, mixed-bit recipes, dtype casts, calibration (text or multimodal), local vs Hub paths, revisions, uploading to…

Blaizzy/mlx-vlm · 99 tokens

server-inference

Use this skill when the user wants to run or debug MLX-VLM server inference, including uv run mlxvlm.server, /v1/models, /v1/chat/completions, /v1/responses, streaming, OpenAI-compatible clients, health checks, metrics, model unload/reload, adapters, trust-remote-code, and server request/response failures.

Blaizzy/mlx-vlm · 80 tokens

cli-inference

Use this skill when the user wants to run or debug MLX-VLM inference from the command line, including uv run mlxvlm.generate, image/audio/video inputs, local model paths, Hugging Face model IDs, deterministic repro commands, and CLI errors around processors, prompts, model loading, or missing weights.

Blaizzy/mlx-vlm · 67 tokens

contributing

Use this skill when the user wants to contribute to MLX-VLM — opening a PR, where model code/config/tests go, backward-compatible config args, running the test suite, code formatting and the pre-commit hooks (black, clang-format), and PR expectations (tests, review, perf evidence). Use it to set up a change so it…

Blaizzy/mlx-vlm · 76 tokens