hfrs

hfrs is a skill for Claude Code, Codex from hannesill/m4. It costs 61 tokens per session (949 once invoked), scanned A, original, MIT.

A calculation guide for the Hospital Frailty Risk Score, which estimates frailty from patients' diagnosis codes. It supports ICD-9-CM and ICD-10-CM codes used in hospital records.

In plain words
What is it for?
Use it for frailty assessment, risk grouping, and research on mortality, long hospital stays, or readmission. It can use diagnoses from the current admission and emergency admissions in the previous two years.
Why use it?
It provides a consistent way to group older or medically complex patients by frailty when direct frailty measurements are unavailable.

Skill for Claude CodeCodex

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

Good fit Use it for frailty assessment, risk grouping, and research on mortality, long hospital stays, or readmission. It can use diagnoses from the current admission and emergency admissions in the previous two years.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hannesill/m4/hfrs
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 hfrs
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 hfrs

README.md
[![agentmods](https://agentmods.dev/badge/skills/hannesill/m4/hfrs.svg)](https://agentmods.dev/skills/hannesill/m4/hfrs)
Your own site
<a href="https://agentmods.dev/skills/hannesill/m4/hfrs"><img src="https://agentmods.dev/badge/skills/hannesill/m4/hfrs.svg" alt="Measured on agentmods" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 949 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.00061 $0.00949
Opus 5 $0.00030 $0.00475
Sonnet 5 $0.00012 $0.00190
Haiku 4.5 $0.00006 $0.00095

Measured 8d ago against content hash 04a2e37a3b6e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

hfrs 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 8d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/calculate_hfrs.py), 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.

src/m4/skills/clinical/hfrs/SKILL.md · 97 lines

How it starts

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

Hospital Frailty Risk Score (HFRS)

Calculate HFRS from ICD diagnosis codes. Based on Gilbert et al. (2018) Lancet methodology with 109 weighted ICD-10 codes.

When to Use This Skill

  • Assessing frailty in ICU or hospitalized patients
  • Risk stratification for older adults
  • Predicting 30-day mortality, prolonged length of stay, or readmission
  • Research requiring a validated frailty metric from administrative data

Methodology

Per the original publication, HFRS is calculated using diagnoses from:

  1. The current (index) admission
  2. All emergency admissions in the preceding 2 years

Each unique ICD code is counted only once, even if it appears in multiple admissions.

Risk Categories

Score Category 30-day Mortality OR
< 5 Low Reference
5-15 Intermediate 1.65 (1.62-1.68)
> 15 High 1.71 (1.68-1.75)

Critical Implementation Notes

  1. ICD-9 mappings are NOT part of the original publication. They have been added for MIMIC-IV compatibility, which contains both ICD-9 and ICD-10 coded admissions. Use ICD-9 mappings with appropriate caution.

  2. Emergency admission types in MIMIC-IV: The SQL implementation considers EMERGENCY, URGENT, and EW EMER. as emergency admissions.

  3. Code matching uses 3-character prefix for ICD-10 (e.g., F05 matches F05.0, F05.1). ICD-9 uses variable-length matching.

Top Contributing Codes

ICD-10 Points Description
F00 7.1 Dementia in Alzheimer's
G81 4.4 Hemiplegia
G30 4.0 Alzheimer's disease
I69 3.7 Sequelae of CVD
R29 3.6 Tendency to fall
F05 3.2 Delirium
N39 3.2 UTI/incontinence
W19 3.2 Unspecified fall

Full 109-code list: references/hfrs_icd_codes.csv

Example Queries

Calculate HFRS for all admissions

-- See scripts/calculate_hfrs.sql for the complete query
-- Key tables used:
-- - mimiciv_hosp.admissions (admission dates and types)
-- - mimiciv_hosp.diagnoses_icd (ICD codes)

-- Simplified example: score a single admission
SELECT
    a.subject_id,
    a.hadm_id,
    SUM(w.points) AS hfrs_score
FROM mimiciv_hosp.diagnoses_icd d
JOIN mimiciv_hosp.admissions a ON d.hadm_id = a.hadm_id
JOIN hfrs_weights w ON d.icd_code LIKE w.icd_prefix || '%'
    AND d.icd_version = w.icd_version
GROUP BY a.subject_id, a.hadm_id;

Read the full file on GitHub · 97 lines

Files

What ships with it

5 files 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. 8d ago First seen · 97 lines · 61 tokens per session scan A 04a2e37a3b6e

Subscribe to this mod's changes

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

arbor-agent-orchestrator

Top-level controller for recreating the open-source AutoResearch workflow as a suite of skills. Use when the user asks to run, emulate, extract, validate, or refine Arbor/AutoResearch behavior, especially when a coordinator must load phase skills for setup, ideation, executors, merge evaluation, novelty search…

RUC-NLPIR/Arbor · 77 tokens

dfam-check

Measure mesh files against Design for Additive Manufacturing (DfAM) rules and report printability findings per process (FDM, SLS, SLA/DLP, metal PBF, MJF). Use when the user asks whether a part is printable, wants overhang/wall-thickness/support analysis of an .stl, .obj, .ply, or .3mf mesh, wants a build-orientation…

earthtojake/text-to-cad · 111 tokens

tooluniverse-gene-enrichment

Gene-set enrichment analysis — GO (Biological Process, Molecular Function, Cellular Component), KEGG, Reactome pathway enrichment via clusterProfiler, gseapy, ORA, GSEA. Use for interpreting DEG lists, screen hit lists, or any gene-list-to-pathways query. Includes simplify-cutoff handling and union-vs-total…

mims-harvard/ToolUniverse · 82 tokens

tooluniverse-phylogenetics

Phylogenetic analysis — de novo multiple sequence alignment (Clustal Omega/MUSCLE/MAFFT via EBImsaalign) and neighbour-joining/UPGMA tree building (EBIbuildphylogenetictree) from your own sequences, plus tree analysis, treeness, saturation (PhyKIT), parsimony-informative sites, alignment gap analysis, DVMC…

mims-harvard/ToolUniverse · 155 tokens

tooluniverse-variant-analysis

VCF and variant analysis — parsing, annotation, classification (synonymous, missense, frameshift, stopgained), VAF filtering, coding vs non-coding categorization, multi-condition variant comparison. Use for VCF parsing, variant fraction calculations (denominator = coding subset only, NOT all variants), and per-sample…

mims-harvard/ToolUniverse · 77 tokens

tooluniverse-cell-line-profiling

Cancer cell-line selection and profiling for experimental model choice. Cross-references DepMap, Cellosaurus, COSMIC, PharmacoDB to deliver identity verification, mutation/CNV profile, gene dependencies, drug sensitivities, and druggable targets. Use to answer 'which cell line should I use for studying gene X?' or 'is…

mims-harvard/ToolUniverse · 100 tokens