@siriuslan/subagent-dispatch0.0.1
Pi extension that delegates a task to a separate, isolated agent session (pi or Claude Code) and returns its result
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@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.
| Backend | Runs | Model |
|---|---|---|
pi (default) |
pi --mode json -p --no-session |
Your session's current model; override per call |
claude |
claude -p --output-format json --dangerously-skip-permissions |
Claude 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:
| Parameter | Description |
|---|---|
task |
The task, used as-is as the subagent's prompt |
backend |
"pi" (default) or "claude" |
cwd |
Working directory, relative to the current one (default: current) |
model |
pi backend only: an id, provider/id or pattern, as pi --model takes. Default: your session's current model |
provider |
pi 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
claudebackend 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
pibackend runs the same pi version as your session, with its default tools, and saves no session. - The
pibackend 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