StatsClaw
A workflow framework for statistical package development.
An open-source tool that helps researchers build, test, and document statistical software packages with AI agent teams.
Website · Roadmap · Contributing · Discussions
What is StatsClaw?
StatsClaw is a framework for Claude Code that uses AI agent teams to assist with statistical package development. You describe what you need — a bug fix, a new feature, a cross-language translation — and StatsClaw coordinates multiple AI agents to help you build, test, and document the result. It works best when a domain expert stays in the loop to guide decisions.
How It Works
StatsClaw orchestrates a team of 9 specialized AI agents, each operating under strict information isolation:
| Agent | Role |
|---|
| Leader | Orchestrates the workflow, dispatches agents, enforces isolation |
| Planner | Reads your paper/formulas, executes deep comprehension protocol, produces specifications |
| Builder | Writes source code from spec.md (never sees the test spec) |
| Tester | Validates independently from test-spec.md (never sees the code spec) |
| Simulator | Runs Monte Carlo studies from sim-spec.md (never sees either spec) |
| Scriber | Documents architecture, generates tutorials, maintains audit trail |
| Distiller | Extracts reusable knowledge for the shared brain (brain mode only) |
| Reviewer | Cross-checks all pipelines, audits tolerance integrity, issues ship/no-ship verdict |
| Shipper | Commits, pushes, opens PRs, handles package distribution |
The code, test, and simulation pipelines are fully isolated — they never see each other's specs. If all pipelines converge independently, confidence in correctness is high. This is adversarial verification by design.
Multi-Pipeline Architecture
planner (bridge)
/ | \
spec.md / test-spec.md \ sim-spec.md
/ | \
builder ─ ─(parallel)─ ─ simulator
(code pipeline) | (simulation pipeline)
\ | /
implementation.md | simulation.md
\ | /
\ v /
tester <-- sequential, after merge-back
(test pipeline)
|
audit.md
|
scriber (recording)
|
distiller (brain mode only)
|
reviewer (convergence)
|
shipper
Key properties:
- Planner is always mandatory — it bridges all pipelines
- Builder handles code, scriber handles docs, simulator handles Monte Carlo studies — for docs-only requests, scriber replaces builder as implementer
- Builder and simulator run in parallel (simulation workflows), then tester validates the merged result — each pipeline has its own isolated spec
- Pipeline isolation is enforced — each pipeline never sees another's spec
- Adversarial verification — if all pipelines converge independently, confidence is high
Supported Languages
| R | Python | Julia | Stata | TypeScript | Go | Rust | C | C++ |
|---|
Want another language? Let us know.
Quick Start
Prerequisites
- Claude Code — Install Claude Code
- GitHub access — Push access to your target repository
- Workspace repo — A GitHub repo for storing workflow artifacts (auto-created if needed)
Your First Task
Just tell StatsClaw what you want. It auto-detects the language, selects the right workflow, and starts working:
work on https://github.com/your-org/your-package resolve the issues
StatsClaw will auto-detect the language, select a workflow, and start working. It will ask you clarification questions when it encounters ambiguity — your domain expertise guides the process. Results vary depending on task complexity; expect to iterate.
Workflow
Code: leader → planner → builder → tester → scriber → [distiller]? → reviewer → shipper?
Docs-only: leader → planner → scriber → reviewer → shipper?
Simulation+Code: leader → planner → [builder ∥ simulator] → tester → scriber → [distiller]? → reviewer → shipper?
Simulation-only: leader → planner → simulator → tester → scriber → [distiller]? → reviewer → shipper?