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.
npx agentmods add instructions/brycewang-stanford/statspai/claude-mdgit clone --depth 1 https://github.com/brycewang-stanford/StatsPAIWrote 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.
[](https://agentmods.dev/instructions/brycewang-stanford/statspai/claude-md)<a href="https://agentmods.dev/instructions/brycewang-stanford/statspai/claude-md"><img src="https://agentmods.dev/badge/instructions/brycewang-stanford/statspai/claude-md.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.07986 | $0.07986 |
| Opus 5 | $0.03993 | $0.03993 |
| Sonnet 5 | $0.01597 | $0.01597 |
| Haiku 4.5 | $0.00799 | $0.00799 |
Grade C, and why
StatsPAI CLAUDE.md scanned grade C with 1 finding 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 today.
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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
4. `rm -rf dist/ && python -m build && twine check dist/*`。 How it starts
The opening of the file, as written. The whole thing — 336 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md — StatsPAI
Claude Code / AI agent 在本仓库工作的指引。动手前请通读。
1. 项目定位
StatsPAI 的目标是面向 Agent 设计,适合人类以及 agent 进行调用,并致力于超越 Stata、R、以及老的 Python 生态,成为全世界最好的因果推断与实证分析工具。
做法有三条:
- 一次
import statspai as sp覆盖 DiD / IV / RD / 合成控制 / DML / Meta-Learner / 贝叶斯因果 / 因果发现 / 结构计量 / 面板 / 空间 / 时序。 - Agent 原生——所有函数返回结构化结果、带自描述 schema,人和 Agent 用同一入口。v1.6 起进入 P1 阶段:
sp.causal_question(estimand-first DSL)、sp.llm_dag_propose / validate / constrained(LLM-DAG 闭环)、sp.paper()(自动论文)、sp.causal_text(文本因果 MVP)。 - 数值对齐 Stata / R——已有参考实现的方法,先对齐再扩展。
| 版本 | 1.21.0(见 pyproject.toml) |
| Python | 3.9 – 3.13 |
| License | MIT |
| 作者 | Biaoyue (Bryce) Wang · [email protected] · CoPaper.AI / Stanford REAP |
| PyPI | https://pypi.org/project/StatsPAI/ |
| 导入别名 | import statspai as sp —— 所有示例、docstring、测试一律 sp.xxx |
2. 仓库结构
StatsPAI/
├── src/statspai/ # 主包:87 子模块 / 1,167 函数(实时数 `python scripts/registry_stats.py`)
│ ├── __init__.py # 对外 API 入口
│ ├── registry.py # 函数注册表(sp.help / sp.list_functions 依赖)
│ ├── help.py # sp.help / sp.describe_function / sp.function_schema
│ ├── cli.py
│ └── <领域模块>/ # did iv rd synth dml metalearners …
├── rust/statspai_hdfe/ # HDFE Rust 后端(PyO3)
├── tests/ # pytest 套件 + reference_parity/ + external_parity/
├── docs/ · mkdocs.yml # MkDocs 文档
├── paper.md · paper.bib # JOSS
├── benchmarks/ # 性能基准
└── pyproject.toml
领域分组(对外 API 按下列七类组织):
- 因果 / 处理效应:
causal did rd iv synth dml metalearners tmle bcf bayes causal_impact policy_learning ope dtr multi_treatment qte principal_strat proximal mediation mendelian assimilation bridge - 面板 / 结构:
panel fixest structural frontier multilevel gformula gmm msm longitudinal - 空间 / 时序:
spatial timeseries bartik - 因果发现 / ML:
causal_discovery dag neural_causal deepiv conformal_causal matrix_completion bunching causal_llm causal_rl causal_text fairness - 设计 / 抽样 / 推断:
matching power mht survey bounds dose_response interference selection censoring imputation transport target_trial epi survival surrogate - 分解 / 诊断 / 回归:
decomposition regression nonparametric diagnostics robustness postestimation inference smart - 基础设施:
core utils compat fast datasets output plots workflow agent experimental question
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.
- today Changed · +23 lines · +1,515 tokens per session 4dbec81e2b34
- 6d ago First seen · 313 lines · 6,471 tokens per session scan C fe454d9983bb
StatsPAI CLAUDE.md is an instructions file published in the GitHub repository brycewang-stanford/StatsPAI (309 stars, last pushed yesterday), licensed MIT. It adds 7,986 tokens to every session, about $0.0399 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
py3plex copilot-instructions.md
Copilot instructions for SkBlaz/py3plex, covering github copilot instructions for py3plex, project overview, repository structure, key code patterns and network creation.
marimo AGENTS.md
AGENTS.md instructions for marimo-team/marimo, covering marimo development guidelines, your primary responsibility is to the project and its users, quick setup, development commands and python.
viral-ngs copilot-instructions.md
Copilot instructions for broadinstitute/viral-ngs, covering copilot instructions, quick reference, running tests and key files.
streamlit python.instructions.md
Instructions for streamlit/streamlit, covering python development guide, key principles, docstrings, package structure and dependencies.
FaST-LMM AGENTS.md
Instructions for fastlmm/FaST-LMM, covering coding notes for agents, general policies, cross-repository release coordination, numerical correctness and error handling.
panoptes-utils AGENTS.md
AGENTS.md instructions for panoptes/panoptes-utils, covering ai agent guidelines for panoptes utilities, project overview, essential reading, project structure and development workflow.