m4-api

m4-api is a skill for Claude Code, Codex from hannesill/m4. It costs 0 tokens per session (1,658 once invoked), scanned A, original, MIT.

A Python interface for querying clinical datasets and working with results as native Python values or pandas tables.

In plain words
What is it for?
Use it to inspect dataset schemas, run SQL, combine query results, and perform analysis with Python, pandas, or numerical libraries.
Why use it?
It supports multi-step analysis, large query results, joins, calculations, and statistics without repeatedly formatting data for display.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to inspect dataset schemas, run SQL, combine query results, and perform analysis with Python, pandas, or numerical libraries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hannesill/m4/m4-api
View source ↗ hannesill/m4
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 hannesill/m4 --skill m4-api
Clone the repo
git clone --depth 1 https://github.com/hannesill/m4

Made for: Claude Code, Codex.

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 m4-api

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/hannesill/m4/m4-api"><img src="https://agentmods.dev/badge/skills/hannesill/m4/m4-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,658 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.00000 $0.01658
Opus 5.5 $0.00000 $0.00663
Sonnet 5.5 $0.00000 $0.00332
Haiku 4.5 $0.00000 $0.00166

Measured yesterday against content hash eef4cc6794d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

m4-api 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 yesterday.

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.

src/m4/skills/system/m4-api/SKILL.md · 115 lines

How it starts

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

M4 Python API

Every call names its dataset; M4 keeps no active dataset.

Every query

  1. Check which datasets are ready: m4 list-datasets --json ("prepared": true) or m4 status --all. list_datasets() returns every dataset M4 knows, downloaded or not. Adding data (m4 init, m4 download) needs the user's data access, so ask them first.
  2. Find the tables and columns, then query with schema-qualified names:
from m4 import M4Client

db = M4Client(dataset="mimic-iv-demo")
db.schema()["tables"]                           # ["mimiciv_hosp.admissions", ...]
db.table_info("mimiciv_icu.icustays")["schema"] # columns (name, type); ["sample"] holds rows
df = db.query("""
    SELECT first_careunit, COUNT(*) AS stays
    FROM mimiciv_icu.icustays
    GROUP BY first_careunit
    ORDER BY stays DESC
""")                                             # pandas DataFrame

execute_query(sql, dataset=...), get_schema(dataset=...), and get_table_info(table, dataset=...) do the same without a client. From the shell: m4 query --dataset mimic-iv-demo --sql "SELECT ...".

A query returns every row it selects: aggregate in SQL and keep row-level results in DataFrames, not in the conversation.

Datasets

Dataset Schemas Access
mimic-iv-demo mimiciv_hosp, mimiciv_icu open, 100 patients
mimic-iv mimiciv_hosp, mimiciv_icu; mimiciv_derived after m4 init-derived credentialed
mimic-iv-note mimiciv_note, for the notes functions only credentialed
mimic-iv-ed-demo mimiciv_ed open, the MIMIC-IV demo's 100 patients
mimic-iv-ed mimiciv_ed credentialed
eicu-demo eicu_crd, as in eicu open, over 2,500 unit stays
eicu eicu_crd (eicu_crd.patient, never bare patient) credentialed
mimic-iii mimiciii_clinical credentialed
mimic-cxr-jpg mimic_cxr: metadata, split, chexpert, negbio, test_labels, images credentialed, with a DUA of its own

Read the full file on GitHub · 115 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday Changed · +32 lines eef4cc6794d8
  2. 2d ago Changed · +5 lines ca6eb4cb31e6
  3. 3d ago Changed · -91 lines · -38 tokens per session a0f81fe08454
  4. 1mo ago Changed · +1 lines 4adec078945c
  5. 1mo ago First seen · 168 lines · 38 tokens per session scan A a6ae7b2497b3

Subscribe to this mod's changes

m4-api is a skill published in the GitHub repository hannesill/m4 (46 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,658 tokens. 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

tooluniverse-single-cell

Single-cell RNA-seq analysis with scanpy/anndata — h5ad data loading, scRNA-seq quality control and QC gating (ngenesbycounts, totalcounts, mitochondrial percent / pctcountsmt, pctcountsribo, doublet detection with Scrublet/scDblFinder, ambient RNA / SoupX awareness, empty-droplet filtering, MAD-based thresholds)…

mims-harvard/ToolUniverse · 146 tokens

tooluniverse-protein-structure-prediction

Protein 3D structure prediction from sequence — ESMFold de novo prediction, AlphaFold database retrieval, experimental structures from RCSB, ProtVar variant impact assessment, ProtParam sequence properties. Use for structure prediction when no experimental structure exists, fold-confidence scoring, and…

mims-harvard/ToolUniverse · 71 tokens

tooluniverse-protein-sae-variant-interpretation

Interpret a missense variant via ESMC-6B Sparse Autoencoder (SAE) feature activations. For a given protein + variant, computes which interpretable SAE features (catalytic, ligand-binding, PTM, structural motif, domain, etc.) are lost or gained at the mutation site. Use when standard pathogenicity scores…

mims-harvard/ToolUniverse · 144 tokens

tooluniverse-enzyme-design

De novo enzyme design by catalytic-motif scaffolding — build a transition-state motif, generate scaffolds with AlphaProtein Novo, fold every mechanistic state, and triage with mechanism-inspired filters (catalytic geometry, multi-state H-bonds, multi-resequence backbone scoring). Use for designing enzymes for a named…

mims-harvard/ToolUniverse · 85 tokens

tooluniverse-proteomics-analysis

Mass-spec proteomics analysis — protein identification, quantification (LFQ, TMT, iTRAQ), differential expression (tumor vs normal, treatment vs control), PTM identification, and pathway enrichment on protein lists. Use when you have proteomics MS output, asking about protein abundance differences, or doing…

mims-harvard/ToolUniverse · 76 tokens

tooluniverse-spatial-omics-analysis

Spatial multi-omics interpretation pipeline. Transforms spatially variable genes (SVGs), domain annotations, and tissue context into biological insights via domain-by-domain characterization, cell-type composition, spatial gene expression patterns, RNA+protein+metabolite integration. Use for Visium, MERFISH, seqFISH…

mims-harvard/ToolUniverse · 97 tokens