m4-setup

m4-setup is a skill for Claude Code, Codex from hannesill/m4. It costs 44 tokens per session (932 once invoked), scanned A, original, MIT.

A diagnostic and repair guide for the M4 development environment, its datasets, agent skills, backends, and visualization tool. It lists checks for finding missing or misconfigured components.

In plain words
What is it for?
Use it to check dataset availability, Python imports, installed skills, DuckDB or BigQuery settings, and whether the Vitrine display service is working.
Why use it?
It helps identify whether a failure comes from the code, the Python environment, unavailable data, backend settings, or visualization services. MIMIC-IV and eICU are healthcare datasets used by M4.

Skill for Claude CodeCodex

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/hannesill/m4/m4-setup
Any agent
npx skills add hannesill/m4 --skill m4-setup
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-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/hannesill/m4/m4-setup.svg)](https://agentmods.dev/skills/hannesill/m4/m4-setup)
Your own site
<a href="https://agentmods.dev/skills/hannesill/m4/m4-setup"><img src="https://agentmods.dev/badge/skills/hannesill/m4/m4-setup.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 932 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 $0.00044 $0.00932
Opus 5 $0.00022 $0.00466
Sonnet 5 $0.00009 $0.00186
Haiku 4.5 $0.00004 $0.00093

Measured 4d ago against content hash 835e7a1c75d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

m4-setup 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 4d 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.

src/m4/skills/system/m4-setup/SKILL.md · 108 lines

How it starts

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

M4 Setup And Repair

Use this skill when the M4 environment looks incomplete, a dataset is missing, skills are stale, or vitrine is unavailable.

When to Use This Skill

  • from m4 import ... fails or the wrong Python environment is active
  • list_datasets() or m4 status --all does not show expected datasets
  • M4 skills are missing, stale, or inconsistent across tools
  • DuckDB/BigQuery backend configuration is wrong
  • vitrine imports fail or the display server is not reachable

Fast Diagnostics

Run commands from the M4 repo root unless the user is intentionally working elsewhere.

pwd
uv run python - <<'PY'
from m4 import list_datasets
print("datasets:", list_datasets())
PY
uv run m4 status --all
uv run m4 agent-env --dataset mimic-iv-demo --json
uv run m4 skills --list
uv run vitrine status

If plain python cannot import m4, use uv run python; M4 is usually installed in the project virtual environment.

Dataset Checks

Expected built-in datasets:

Dataset Notes
mimic-iv-demo Local demo tabular dataset
mimic-iv MIMIC-IV tabular data and derived tables
mimic-iv-note MIMIC-IV notes
eicu eICU tabular data

Custom datasets live under the M4 data directory in datasets/*.json and should appear in m4 status --all. By default the data directory is m4_data; if M4_DATA_DIR is set, it must point directly at the data directory.

Common checks:

uv run m4 agent-env --json
M4_CONFIG_DIR="${M4_HOME:-${M4_DATA_DIR:-m4_data}}"
cat "$M4_CONFIG_DIR/config.json"
find "${M4_DATA_DIR:-m4_data}/databases" -maxdepth 1 -type f -name '*.duckdb' -print
find "${M4_DATA_DIR:-m4_data}/datasets" -maxdepth 1 -type f -name '*.json' -print

Pass dataset="name" when querying, then inspect schema with get_schema(dataset=...) and get_table_info(..., dataset=...).

Skill Installation Repair

The canonical bundled skills are under src/m4/skills. Installed tool directories are generated copies.

Read the full file on GitHub · 108 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. 4d ago First seen · 108 lines · 44 tokens per session scan A 835e7a1c75d7

Subscribe to this mod's changes

m4-setup is a skill published in the GitHub repository hannesill/m4 (43 stars, last pushed 1mo ago), licensed MIT. It adds 44 tokens to every session and 932 once invoked, about $0.0002 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.