← Catalog

@siriuslan/subagent-dispatch

Pi extension that delegates a task to a separate, isolated agent session (pi or Claude Code) and returns its result

Extension

Install

Install with PiG

pig install npm:@siriuslan/subagent-dispatch

Install with Pi

pi install npm:@siriuslan/subagent-dispatch
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.0.1 (README.md). PiG does not review it.

@siriuslan/subagent-dispatch

A pi extension that hands a self-contained task to a separate, isolated agent session, waits for it to finish and returns its answer. The work doesn't fill your current session's context window. Only the final answer comes back.

BackendRunsModel
pi (default)pi --mode json -p --no-sessionYour session's current model; override per call
claudeclaude -p --output-format json --dangerously-skip-permissionsClaude Code's default

Install

pi install npm:@siriuslan/subagent-dispatch

The claude backend needs the Claude Code CLI on your PATH and uses your existing login.

Usage

Just ask. A prompt of this form is dispatched directly, without going through the model:

start a subagent to do <task>
start a subagent using claude to do <task>
start a subagent with claude code session to handle <task>

using / with / via choose the backend (pi, claude, claude code). do / complete / finish / handle are all accepted, and the task may span several lines. When the subagent finishes, its answer appears in the transcript as a message, and the main agent sees it on its next turn.

Or let the model decide. The start_subagent tool is available to the model:

ParameterDescription
taskThe task, used as-is as the subagent's prompt
backend"pi" (default) or "claude"
cwdWorking directory, relative to the current one (default: current)
modelpi backend only: an id, provider/id or pattern, as pi --model takes. Default: your session's current model
providerpi backend only: the provider to look model up in. Ignored without model

The tool result shows the backend and model used, the answer (Ctrl+O expands the task, full output, duration and cost), or the error if the run failed. Pressing Esc while the tool runs stops the subagent.

Notes

  • The claude backend runs with --dangerously-skip-permissions. It can edit files and run commands in the working directory without asking. Only use it for tasks you'd let it do unsupervised.
  • The pi backend runs the same pi version as your session, with its default tools, and saves no session.
  • The pi backend uses the model your session is on when the subagent starts. To pick a cheaper model, ask for one ("start_subagent with model haiku") or switch models first. The natural-language trigger always uses the session's model. If the session has no model, pi's own default is used.

Development

npm test   # uses fake pi / claude CLIs; no agent is called