Borrowing it
Nothing to install: this file belongs to brycewang-stanford/StatsPAI. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/brycewang-stanford/StatsPAI/main/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/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.
<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="Reviewed on agentmods" width="80" 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.20503 | $0.20503 |
| Opus 5.5 | $0.08201 | $0.08201 |
| Sonnet 5.5 | $0.04101 | $0.04101 |
| Haiku 4.5 | $0.02050 | $0.02050 |
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 2d 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.
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/*`。**再把 sdist 的文件清单对照 `git ls-files`**:`MANIFEST.in` 的 `recursive-include tests *` 会把工作树里被 gitignore 的本地产物一起打包——1.32.0 发版时先后抓到复现检查的临时目录、Track C 的 38 MB 共享输入、以及可由包内 How it starts
The opening of the file, as written. The whole thing — 444 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——已有参考实现的方法,先对齐再扩展。
| 版本 | 以 pyproject.toml / sp.__version__ 为准(不在此处写死,2026-09 审查发现此行停在 1.24.0) |
| Python | 3.10 – 3.13(2026-10-04 起不再支持 3.9;Windows 暂不在测试矩阵里,见 docs/dev/2026-10-04-windows-test-gaps.md) |
| 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/ # 主包:90 子模块 / 1,566 个注册符号,其中约 400 个是结果类与异常类(实时数 `python scripts/registry_stats.py`;此行 2026-10-12 核对)
│ ├── __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 mcmc 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 doe - 分解 / 诊断 / 回归:
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.
- 2d ago Changed · +1 lines · +48 tokens per session 2feb11e710b2
- 3d ago Changed · +77 tokens per session 857cda263f54
- 4d ago Changed · +43 tokens per session d5f63b9d52fb
- 5d ago Changed · +1 lines · +393 tokens per session b33b7feb94af
- 6d ago Changed · +7 lines · +884 tokens per session eaaa2f0b76f7
- 7d ago Changed · -41 lines · -28,783 tokens per session 24fea647752d
- 8d ago Changed · +83 tokens per session 9e9da613e363
- 9d ago Changed 71e47c2293d0
- 10d ago Changed · +12 lines · +2,185 tokens per session 923412ac08b1
- 11d ago First seen · 464 lines · 45,573 tokens per session scan C aa7658365662
StatsPAI CLAUDE.md is an instructions file published in the GitHub repository brycewang-stanford/StatsPAI (345 stars, last pushed yesterday), licensed MIT. It adds 20,503 tokens to every session, about $0.0820 per session on Opus 5.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
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).