Causal Inference

Causal Inference is a skill for Claude Code, Codex from SkillMedev/skills. It costs 142 tokens per session (1,968 once invoked), scanned A, original, MIT.

A research method for estimating whether an intervention caused a measured result. It chooses among approaches such as randomized trials, natural experiments, before-and-after comparisons with a control group, and statistical matching based on how treatment was assigned.

In plain words
What is it for?
Use it to define the treatment, outcome, comparison units, and available data, then select a design, check confounding factors, run falsification tests, and report a defensible effect estimate.
Why use it?
It prevents ordinary correlation or a flawed regression from being presented as proof of cause and effect. It makes the assumptions visible and requires checks that could disprove the conclusion.

Skill for Claude CodeCodex

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

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/skillmedev/skills/causal-inference
Any agent
npx skills add SkillMedev/skills --skill causal-inference
Clone the repo
git clone --depth 1 https://github.com/SkillMedev/skills

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 Causal Inference

README.md
[![agentmods](https://agentmods.dev/badge/skills/skillmedev/skills/causal-inference.svg)](https://agentmods.dev/skills/skillmedev/skills/causal-inference)
Your own site
<a href="https://agentmods.dev/skills/skillmedev/skills/causal-inference"><img src="https://agentmods.dev/badge/skills/skillmedev/skills/causal-inference.svg" alt="Measured on agentmods" height="20"></a>
Per session 142 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,968 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.00142 $0.01968
Opus 5 $0.00071 $0.00984
Sonnet 5 $0.00028 $0.00394
Haiku 4.5 $0.00014 $0.00197

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

Security

Grade A, and why

Causal Inference 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.

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/causal-inference/SKILL.md · 124 lines

How it starts

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

Causal Inference

A confident effect estimate built on a broken identification strategy is worse than no estimate: it triggers real decisions with fake evidence. This skill forces the choice of design before any regression is run, states the assumptions each design buys, and requires falsification tests before an effect is reported as causal.

Inputs to collect

Gather these before choosing a design. If the user cannot supply one, propose a default and label it a guess.

  1. Treatment: the intervention, precisely defined (who received it, when, at what intensity).
  2. Outcome: the measured variable and its timing relative to treatment.
  3. Unit of analysis: person, account, store, region - and how many units exist on each side.
  4. Assignment mechanism: how units ended up treated - randomized, threshold rule, policy rollout, self-selection. This single fact determines which designs are available.
  5. Data availability: pre-treatment periods (how many), untreated comparison units, candidate instruments, covariates.
  6. Decision at stake: what action the estimate will drive, and how costly a wrong sign or 2x-off magnitude would be.

Operating procedure

Step 1: Frame the estimand and draw the DAG

Define treatment, outcome, unit, and the counterfactual in one sentence ("What would treated units' outcome have been absent treatment?"). Sketch a DAG listing confounders (cause both treatment and outcome), mediators (on the causal path), and colliders (caused by both). Never condition on a collider or any post-treatment variable; controlling for a mediator absorbs the effect you are trying to measure.

Run the confounder checklist - for each candidate variable ask:

  • Does it plausibly influence who gets treated?
  • Does it plausibly influence the outcome independent of treatment?
  • Is it measured before treatment? (If measured after, it may be a mediator or collider - exclude it.)
  • If it is unmeasured and answers yes to the first two, no amount of regression control fixes the problem - you need a design from higher in the ladder below.

Read the full file on GitHub · 124 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 · 124 lines · 142 tokens per session scan A 4990e91ad329

Subscribe to this mod's changes

Causal Inference is a skill published in the GitHub repository SkillMedev/skills (11 stars, last pushed 2mo ago), licensed MIT. It adds 142 tokens to every session and 1,968 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

Systematic Review

Runs a PRISMA-compliant systematic review from PICO question and pre-registered protocol through search strings, two-stage screening, risk-of-bias appraisal, and GRADE-rated synthesis. Use when someone asks "run a systematic review", "build my search strategy and inclusion criteria", "screen these studies against a…

SkillMedev/academic-researcher · 123 tokens

pkpd-modeling

Pharmacokinetic and pharmacodynamic modelling and simulation - non-compartmental analysis, compartmental and population PK, PK/PD and exposure-response, TMDD, PBPK orientation, bioequivalence, allometric scaling and first-in-human dose, drug interaction prediction, and Bayesian therapeutic drug monitoring. Use when…

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

statistical-analysis

Guided statistical analysis for research data - test selection, assumption checking, effect sizes, power analysis, Bayesian alternatives, and APA-formatted reporting. Use whenever a user wants to compare groups, test a hypothesis, analyze experimental or survey data, check statistical assumptions, compute required…

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

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use…

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

hypothesis-generation

Formulate evidence-bounded scientific questions, candidate hypotheses, rival explanations, causal or associational claims, discriminating predictions, measurements, and preregistration-ready analysis plans. Use when turning observations or preliminary findings into transparent, testable research plans without treating…

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

matlab

Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

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