@pi-plugins/subagent

extensionmaintained

Minimal subagent tool extension for pi-agent: delegate a task to a fresh headless pi instance.

by · v0.2.1 · published 21h ago

$ pi install npm:@pi-plugins/subagent
downloads/mo
1.4K
stars
6
last push
21h ago
open issues
0

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

No downloads in the last 12 weeks.

README

@pi-plugins/subagent

A minimal subagent tool for pi-agent: delegate a task to a fresh, headless pi instance with an isolated context window.

No agent presets, no orchestration modes — just a subagent tool that spawns another instance of the running pi harness (pi --mode json -p) and returns its final response. Child processes inherit the parent environment with PI_CACHE_RETENTION=short, so they keep pi's standard provider cache retention instead of inheriting a process-wide or OAuth-plugin extended setting.

Install

pi install npm:@pi-plugins/subagent

For a one-off run without adding it to settings:

pi -e npm:@pi-plugins/subagent

For local development, load it straight from this directory:

pi -e ./plugins/subagent

Tool parameters

ParameterRequiredDescription
descriptionyesA short (3-5 word) description of the task
promptyesThe task for the agent to perform
modelnoModel override for this agent (passed to pi --model)
cwdnoWorking directory for the agent process (defaults to the parent's cwd)

Sessions

Children persist a session named after the call's description, so pi --session <id> opens what a subagent did. They live in ~/.pi/agent/sessions/subagents/, outside any project directory, so they never appear in pi -c or pi -r — pi offers to fork them into the current directory instead. Nothing prunes them.