···6677You talk to your main agent (in Pi, Claude Code, OpenCode etc.). When work needs to be farmed out, it writes a mill program: a TypeScript file that spawns subagents with specific instructions. You see the code before it executes.
8899+## Install
1010+1111+```bash
1212+brew install laulauland/tap/mill
1313+```
1414+1515+Or build from source (requires [Bun](https://bun.sh)):
1616+1717+```bash
1818+git clone https://github.com/laulauland/mill.git && cd mill
1919+bun install
2020+bun build --compile packages/cli/src/bin/mill.ts --outfile mill
2121+mv mill ~/.local/bin/ # or anywhere on your PATH
2222+```
2323+2424+Then scaffold a config:
2525+2626+```bash
2727+mill init # creates ./mill.config.ts in current project
2828+mill init --global # creates ~/.mill/config.ts (shared default)
2929+```
3030+3131+The config sets your default driver, model preferences, and authoring guidance. See [Configuration](#configuration) for details.
3232+933## Quick example
10341135```ts
···52765377`mill --help` and `mill <command> --help` include a **Models** section for the selected driver (`defaultDriver` from resolved config, or `--driver` override on command help). The list is sourced from that driver's `codec.modelCatalog`, so driver registration is what informs the CLI/main agent about available models.
54787979+## Use with Claude Code
8080+8181+[Install mill](#install), then add the skill:
8282+8383+```bash
8484+npx skills add laulauland/mill
8585+```
8686+8787+This teaches Claude Code how to write and run mill programs. When you ask it to farm out work to subagents, it will author a `.ts` program using `mill.spawn()`, show it to you for confirmation, and execute it via the CLI.
8888+8989+## Use with pi
9090+9191+[Install mill](#install), then add the [pi-mill](https://github.com/laulauland/mill/tree/main/packages/pi-mill) extension:
9292+9393+```bash
9494+pi install npm:pi-mill
9595+```
9696+9797+This registers a `subagent` tool in pi. When the agent needs to delegate work, it writes a mill program and executes it. The extension also adds monitoring: `/mill` opens an in-session overlay, and `pi --mill` launches a standalone run monitor.
9898+5599## FAQ
5610057101**Couldn't I just do this with bash and claude -p?**
···73117```
7411875119Resolved in order: `./mill.config.ts` → walk up to repo root → `~/.mill/config.ts` → built-in defaults.
120120+121121+Recursion guard:
122122+123123+- `maxRunDepth` (default `1`) limits nested `mill run` invocations by depth.
124124+- Mill tracks depth with `MILL_RUN_DEPTH` in worker/program child environments.
125125+- If a nested invocation exceeds `maxRunDepth`, `mill run` is rejected before submission.
7612677127## Drivers
78128
···20202121## Prerequisites
22222323-1. `mill` must be on your `PATH` (or set a custom command in config).
2424-2. A `mill.config.ts` with at least one driver/executor configured.
2323+1. `mill` must be on your `PATH` — see [install instructions](https://github.com/laulauland/mill#install).
2424+2. A `mill.config.ts` with at least one driver/executor configured (`mill init` to scaffold one).
25252626## How it works
2727