explainability

explainability is a skill for Claude Code from Aperivue/medsci-skills. It costs 150 tokens per session (1,563 once invoked), scanned A, original, MIT.

A review and analysis workflow for model explanations in medical imaging, including Grad-CAM, attention maps, saliency maps, and integrated gradients. These methods show which image areas may have influenced a model’s prediction.

In plain words
What is it for?
Auditing or producing explainability analyses, running model- and data-randomisation checks, and measuring how well highlighted regions match relevant findings.
Why use it?
A heat map can look convincing even when it is unrelated to the model’s learned knowledge or the correct labels. This workflow checks whether the explanation is trustworthy enough for a research paper.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the medsci-modeling plugin — 12 skills shipped together

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.

agentmods
npx agentmods add skills/aperivue/medsci-skills/explainability
Any agent
npx skills add Aperivue/medsci-skills --skill explainability
Clone the repo
git clone --depth 1 https://github.com/Aperivue/medsci-skills

Made for: Claude Code.

Or install medsci-modeling, the plugin that ships this one along with the rest of its 12 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 explainability

README.md
[![agentmods](https://agentmods.dev/badge/skills/aperivue/medsci-skills/explainability.svg)](https://agentmods.dev/skills/aperivue/medsci-skills/explainability)
Your own site
<a href="https://agentmods.dev/skills/aperivue/medsci-skills/explainability"><img src="https://agentmods.dev/badge/skills/aperivue/medsci-skills/explainability.svg" alt="Measured on agentmods" height="20"></a>
Per session 150 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,563 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00150 $0.01563
Opus 5 $0.00075 $0.00781
Sonnet 5 $0.00030 $0.00313
Haiku 4.5 $0.00015 $0.00156

Measured 6d ago against content hash 4d1c082ad483, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

explainability 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 6d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/check_explainability_report_challenge/verify.sh, scripts/check_explainability_report.py, tests/test_explainability_report.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/explainability/SKILL.md · 110 lines

How it starts

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

Explainability Skill

Purpose

A saliency / Grad-CAM heat-map is the most over-interpreted artifact in medical-imaging AI: a colourful map over the lesion is routinely presented as proof the model "looks at the right thing." Adebayo et al. (NeurIPS 2018) showed many saliency methods produce visually convincing maps that are independent of the model's learned weights and of the labels — so they explain nothing. This skill produces an explainability analysis that clears the rigor bar, and audits an existing one, so the map is trustworthy before it reaches a manuscript (CLAIM 2024 / TRIPOD+AI interpretability items).

It sits alongside evaluation in the lane: /architecture-zoo/preprocess-imaging/model-scaffold/model-validation/model-evaluation + explainability/write-paper + /check-reporting. It integrates captum / pytorch-grad-cam (referenced in the plan); it does not reimplement them and never runs a model on real patient data.

When to use

  • You produced (or are about to produce) saliency / Grad-CAM / attention maps and want them reported to the standard a reviewer expects.
  • You want to audit an explainability analysis for the four failure modes below.

When NOT to use

  • Discrimination / calibration metrics → /model-evaluation then /analyze-stats.
  • Split or preprocessing leakage → /model-validation / /preprocess-imaging.
  • LLM/MLLM faithfulness & hallucination → /mllm-eval.
  • Reimplementing captum / pytorch-grad-cam → out of scope (this skill wires and audits them).

The four failure modes (what the gate enforces)

  1. Saliency as validation. A map is attribution, not proof the model is correct or that the relationship is causal. Frame it as "where signal is attributed", never as "the model is right".
  2. No sanity check. Run the Adebayo model-randomisation and data-randomisation tests. A map that survives neither is uninterpretable; both axes are the minimum bar.
  3. No quantitative localisation. If you claim the map localises the finding, measure it — IoU / pointing game / Dice against ground-truth masks — do not eyeball a few examples.
  4. Cherry-picked examples. Report a cohort-level result, not a handful of hand-picked cases.

Read the full file on GitHub · 110 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. 6d ago First seen · 110 lines · 150 tokens per session scan A 4d1c082ad483

Subscribe to this mod's changes

explainability is a skill published in the GitHub repository Aperivue/medsci-skills (283 stars, last pushed today), licensed MIT. It adds 150 tokens to every session and 1,563 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

bids

Use this skill when working with Brain Imaging Data Structure (BIDS) datasets: organizing neuroscience and biomedical data (MRI, EEG, MEG, iEEG, PET, microscopy, NIRS, motion capture, EMG, MR spectroscopy, behavioral), querying BIDS layouts, validating compliance, converting DICOM to BIDS, writing metadata sidecars…

K-Dense-AI/scientific-agent-skills · 80 tokens

bulk-rnaseq

End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp/Trim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway/GSEA enrichment (pathway-enrichment), and…

K-Dense-AI/scientific-agent-skills · 218 tokens

torch-geometric

PyTorch Geometric (PyG) for graph neural networks — node/link/graph classification, message passing (GCN, GAT, GraphSAGE, GIN), heterogeneous graphs, neighbor sampling, and custom datasets. Use when working with torchgeometric, not for general NetworkX analytics or non-graph PyTorch models.

K-Dense-AI/scientific-agent-skills · 71 tokens

aeon

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard…

K-Dense-AI/scientific-agent-skills · 74 tokens

esm

Use when working directly with the esm Python SDK, ESM3 or ESMC model IDs, Forge/Biohub inference clients, or ESMFold2 folding workflows.

K-Dense-AI/scientific-agent-skills · 39 tokens

geniml

Use Geniml for audited local genomic-interval workflows: validate BED and universe contracts, plan Region2Vec or scEmbed runs, inspect model/tokenizer compatibility, and assess consensus universes.

K-Dense-AI/scientific-agent-skills · 43 tokens