# Pi Smart Subagents

[English](README.md) | [简体中文](README.zh-CN.md)

Run isolated child agents in [Pi](https://pi.dev/), with Jev selecting a model and tools for each task.

An independent community fork of Luke Parke's `@parke.dev/pi-subagent` from [LukasParke/pi-extensions](https://github.com/LukasParke/pi-extensions/tree/main/packages/pi-subagent). It retains the upstream engine's named agents, parallel and background tasks, worktrees and usage accounting, and adds Jev routing with child capability verification.

---

<a id="quick-start"></a>
### Installation

```bash
pi install npm:@cr1ms0n/pi-subagent
```

---

<a id="delegation"></a>
### Usage

Before your first task, configure your TypeSafe API key and candidate models in `~/.pi/subagent.json`. See the [configuration example](docs/REFERENCE.md#jev-routing).

Then ask Pi, for example:

> Use a read-only subagent to review this project's directory structure and summarize the main modules.

Jev chooses the model and tools. The optional `jevRouting.baseUrl` setting can point to a trusted complete `https://` SystemOne request URL; when omitted, the official `https://api.typesafe.ai/v1/systemone` endpoint remains the exact default. The value is strictly validated, and changing it changes the destination receiving the minimal routing disclosure. See the [configuration reference](docs/REFERENCE.md#jev-routing) for the full contract.

Optional infrastructure tools can be preserved outside Jev's ordinary tool choices with the top-level `passthroughTools` string array in the same config file (default `[]`). Use exact registered names; there are no built-in presets. This is your explicit approval of trusted non-project-writing infrastructure, including in read-only profiles—not automatic proof of a custom tool's effects. Known write/unsafe builtin and nested-dispatch tools cannot use this exception. Startup requires every listed definition to be registered, while letting its host control whether it is active. See [passthrough tools](docs/REFERENCE.md#passthrough-tools).

Open `/subagents` to inspect tasks and `/subagent-cost` to view usage.

See the [usage reference](docs/REFERENCE.md#quick-usage) for parallel tasks, background work, worktrees and structured results, or the [TUI guide](docs/UX.md) for keyboard controls.

---

<a id="license"></a>
### License

[MIT](LICENSE). Copyright (c) 2026 Luke Parke. Fork maintained by cr1ms0n (awoaCrim). Preserve the original copyright and license when redistributing this work.

Thanks to [Linux.do](https://linux.do/).
