extracting-clinical-entities

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

A tool for finding medical terms in text, such as diseases, medicines, body parts, genes, and proteins. It returns the terms' positions and confidence scores in formats such as JSON, HTML, or CSV.

In plain words
What is it for?
Use it to build a clinical text pipeline, inspect exact text spans, or extract biomedical entities from notes. Clinical text should be de-identified first when it contains private information.
Why use it?
It turns unstructured clinical notes into labeled data that other parts of a medical text-processing workflow can use.

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 build a clinical text pipeline, inspect exact text spans, or extract biomedical entities from notes. Clinical text should be de-identified first when it contains private information.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/maziyarpanahi/openmed/extracting-clinical-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,781 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-clinical-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-clinical-entities

README.md
[![agentmods](https://agentmods.dev/badge/skills/maziyarpanahi/openmed/extracting-clinical-entities/github.svg)](https://agentmods.dev/skills/maziyarpanahi/openmed/extracting-clinical-entities)
Your own site
<a href="https://agentmods.dev/skills/maziyarpanahi/openmed/extracting-clinical-entities"><img src="https://agentmods.dev/badge/skills/maziyarpanahi/openmed/extracting-clinical-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-clinical-entities

Your own site · 80×15
<a href="https://agentmods.dev/skills/maziyarpanahi/openmed/extracting-clinical-entities"><img src="https://agentmods.dev/badge/skills/maziyarpanahi/openmed/extracting-clinical-entities.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 118 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,918 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.00118 $0.01918
Opus 5.5 $0.00047 $0.00767
Sonnet 5.5 $0.00024 $0.00384
Haiku 4.5 $0.00012 $0.00192

Measured 2mo ago against content hash 59394e842bd7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

extracting-clinical-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 2mo 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-clinical-entities/SKILL.md · 201 lines

How it starts

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

Extracting Clinical Entities

openmed.analyze_text runs a token-classification model over medical text and returns structured entities with character offsets and confidence scores. It runs on-device after a one-time model download.

When to use

  • Pull diseases, medications, anatomy, genes, proteins, etc. out of clinical text.
  • You need exact character spans (start/end) plus confidence per entity.
  • You want output as objects, JSON, an HTML highlight view, or CSV.
  • You are building the "extract entities" stage of a clinical NLP pipeline.

To choose a model, see choosing-openmed-models. To load it once and reuse it, see loading-openmed-models. In a PHI workflow, de-identify first (see deidentifying-clinical-text), then run NER on the redacted text.

Install

pip install "openmed[hf]"

Quick start

import openmed

note = (
    "Patient prescribed 500 mg metformin for type 2 diabetes mellitus. "
    "Reports intermittent chest pain; ruled out myocardial infarction."
)

result = openmed.analyze_text(
    note,
    model_name="disease_detection_superclinical",  # registry key, HF id, or local path
    output_format="dict",                           # dict | json | html | csv
    confidence_threshold=0.5,
)

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

With output_format="dict" you get a PredictionResult. The fields you use most:

result.text          # the original input text
result.entities      # list of entity objects
result.model_name    # which model produced these
ent.text             # the surface string
ent.label            # entity type, e.g. "DISEASE"
ent.confidence       # model score in [0, 1]   (NOTE: .confidence, not .score)
ent.start / ent.end  # character offsets into result.text

Output formats

analyze_text(...) returns different types depending on output_format:

output_format Return type Use for
"dict" (default) PredictionResult object Programmatic access via .entities.
"json" str (JSON) Logging, APIs, writing to disk.
"html" str (HTML) A highlighted preview of the note.
"csv" str (CSV) Spreadsheet / quick review.

Read the full file on GitHub · 201 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. 2mo ago First seen · 201 lines · 118 tokens per session scan A 59394e842bd7

Subscribe to this mod's changes

extracting-clinical-entities is a skill published in the GitHub repository maziyarpanahi/openmed (5,781 stars, last pushed yesterday), licensed Apache-2.0. It adds 118 tokens to every session and 1,918 once invoked, about $0.0005 per session on Opus 5.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

extracting-clinical-entities compared with skills from other repositories

extracting-clinical-entities next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
extracting-clinical-entitiesmaziyarpanahi/openmedSkill5.8kyesterdayApache-2.0A118Claude Code
saelensNousResearch/hermes-agentSkill261kyesterdayMITA14Claude Code, Codex
sglang-diffusion-cache-ditsgl-project/sglangSkill39kyesterdayApache-2.0A161Claude Code
ml-training-recipesOrchestra-Research/AI-Research-SKILLsSkill14k26d agoMITA88Claude Code
add-new-modelBlaizzy/mlx-vlmSkill5.7k4d agoMITA83Claude Code
torch-geometricsynthetic-sciences/openscienceSkill4.3k2d agoApache-2.0A41Claude Code, Codex
zarr-pythonsynthetic-sciences/openscienceSkill4.3k2d agoApache-2.0A42Claude Code, Codex