---
slug: "matthewlam-pi-worker"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/minghinmatthewlam/pi-worker@main/README.md"
repo: "https://github.com/minghinmatthewlam/pi-worker"
source_file: "README.md"
branch: "main"
---
# pi-worker

Headless worker helpers for `pi -p`.

## Flags

- `--last-message-file <path>` writes the final assistant text on `agent_end`.
- `--result-schema <path>` enables the `report_result` tool and validates tool args against the JSON Schema file. Gotcha: a `-t` allowlist applies to extension tools too — include `report_result` in it (e.g. `-t read,write,bash,report_result`) or the model cannot call the tool and no result file is written.
- `--result-file <path>` overrides the structured result output path. Without it, `result.json` is written next to `--last-message-file`.
- `--worker-heartbeat-file <path>` writes a JSON liveness record on `agent_start`, `tool_execution_end`, and `agent_end`.
- `--worker-trust` answers project trust with `{ "trusted": "yes" }` for this process.
