@agmxyz/pi-workers

Delegate searches, research and reviews to separate read-only Pi worker processes

Packages

Package details

extension

Install @agmxyz/pi-workers from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@agmxyz/pi-workers
Package
@agmxyz/pi-workers
Version
0.4.0
Published
Dec 4, 2026
Downloads
1,983/mo · 109/wk
Author
cito-lito
License
MIT
Types
extension
Size
144 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "extensions/delegate.ts",
    "extensions/skill.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-workers

check

Keep long searches, file dumps and review noise out of your main Pi session. delegate sends a task to a separate worker and brings back an answer, so you can focus on what to do with it.

Work with Pi as usual. When a task would flood the session, such as a broad search or a large review, Pi hands it to a read-only worker and briefs it; you don't need to write agent files. Your session makes every change itself. It's developed in me-pi, my Pi setup, if you want to see the workflow around it.

Install and try it

Requires Pi 1.5.0 (the version CI tests) on macOS or Linux (CI covers Linux; macOS is tested locally).

pi install npm:@agmxyz/pi-workers

To track main instead, install git:github.com/agmxyz/me-pi. Install only one of the two: both load the same extensions.

Restart Pi or run /reload, then just work. You don't name roles: Pi decides when a task is worth delegating and which worker gets it. Small reads and every edit stay in your session. For example:

  • "Where does this project handle configuration?" A search of unknown scope goes to a read-only worker, and you get back a few lines with path:line evidence.
  • "Review this branch's diff for correctness." A large diff goes to a reviewer; for a small one, Pi reads it itself.
  • "Add a 30 s default timeout; npm test must pass." Pi edits, runs your check and commits in your session, and asks a worker to review a large diff.

The routing is prompt guidance to your model, so it can misjudge. Steer it when you want: "use a worker for this", "do this in the background" (in an interactive session; print and JSON runs refuse it), or "have Opus 5.5 and Sol 6.1 challenge this plan and cross-check each other" (the models must be available in Pi).

Workers are not sandboxed: they run with your OS permissions and can read your project. See Safety.

Upgrading from 0.2? The implement role is gone: see Migrating from implement.

Switching from a Git install? Run pi remove git:github.com/agmxyz/me-pi (or git:github.com/0bmario/me-pi, the old URL) first, so Pi doesn't load the extensions twice.

What's in the package

  • delegate runs read-only workers: scout for a short search with path:line evidence, and general, which you brief as a reviewer, researcher, plan critic or investigator. Workers load your own AGENTS.md and skills. /delegate status shows jobs and model resolution; /delegate cancel <id> requests cancellation.
  • Skill loads an already-discovered skill by name.

For risky-bash protection (guard), install the standalone guard extension from me-pi ("extensions/guard.ts").

Roles, limits, environment variables and recovery are in the delegation guide.

Why use it?

  • Keep the main context focused. A worker can search files or review a diff and return findings instead of filling the session with its process.
  • One writer. Only your session edits; workers read, research and review, so nothing writes behind your back.
  • Limits by default. Hard time limits (5 / 15 min for scout / general), a $5 cap on Pi's estimated cost per run (configurable, or off), and at most four workers at once.
  • No blind retries. An infrastructure failure (HTTP 409/429/5xx, timeout, network) is retried on the same model only after an attempt that did nothing but read. pi-workers never switches models on its own.

Where it's weaker

  • Custom worker profiles. You can brief general for different jobs and choose models per call, but you can't define a new persistent role with its own toolset and defaults.
  • Delegated writing. Workers don't edit. For a second feature at the same time, add a Git worktree and start a Pi session there; delegate does not create or clean up worktrees for you.
  • Long-lived jobs. Background jobs end on /reload, a session switch, or Pi exit, and a worker's session can't be resumed.
  • A live view or built-in chains. You see progress and the final answer, not the worker's conversation; workflows beyond that depend on your own skills.

Packages such as pi-subagents and pi-side-agents aim at some of these; compare before choosing.

Configure

Everything here is optional.

Model pools live in ~/.pi/agent/delegate.json (set ME_PI_DELEGATE_CONFIG to use another path). Without it, workers use your session's model.

{
  "version": 3,
  "scout": { "models": [{ "model": "provider/fast-model", "thinking": "low" }] },
  "worker": { "models": [{ "model": "provider/strong-model", "thinking": "medium" }] }
}

scout serves scouts and worker serves general. All keys are in Configure model pools.

Calls with web: true need web tools: pi install npm:pi-web-access.

Safety

  • Not a sandbox. Extensions and workers run with your OS permissions; the secret-path fence (and optional standalone guard) are guardrails, not security boundaries.
  • Worker file-read tools refuse common secret paths (.env*, keys, ~/.ssh, ~/.pi/agent/auth.json).
  • The recovery rules are guidance for the main session, not runtime enforcement.
  • pi-workers itself sends nothing anywhere; workers talk only to your configured model providers, plus fetched pages when web tools are on.

Uninstall

pi remove npm:@agmxyz/pi-workers   # or git:github.com/agmxyz/me-pi
rm ~/.pi/agent/delegate.json   # if you created it

License

MIT