Install
Install with PiG
pig install npm:@gfgghgftgffg/pi-subagents-leanInstall with Pi
pi install npm:@gfgghgftgffg/pi-subagents-leanPackages 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.1.26 (README.md). PiG does not review it.
@gfgghgftgffg/pi-subagents-lean
Advantage
A lighter wrapper for @tintinweb/pi-subagents. Agent, result, steer and workflow calls share one subagent tool, cutting the tool text sent on the first call by about 97%.
Features
run,result,steer,workflowandhelpgo through that one tool. Background tasks, workflows, schedules and the original result cards still use the upstream runtime.- Cold parameters go in
inputas a JSON object string. The wrapper checks them against the real upstream schema before the call.helpreturns that schema. Workflow help also returns the authoring reference;workflowToolExposure: "skill"replaces the reference with a path to the upstream bundled skill. The facade remains one tool in all exposure modes, so"deferred"does not defer itsworkflowoperation. subagent_typelists the agent types enabled at startup. Reload after changing agent files. If the upstream description cannot be parsed, callhelpwithinputset to"run".- FleetView lists nested agents under their parent and shows each agent's own tokens. Its cursor is
❯;●marks the open view. WithshowModelenabled, fleet rows also name the model and thinking level. - Adds a read-only child-session interface so
pi-goal-x-leancan keep goal management in the parent Agent.
Source
The facade comes from kunkun9527/pi-subagents-lean. The runtime is tintinweb/pi-subagents. This package follows upstream releases and does not copy the engine. Both are MIT; the original LICENSE is kept. It lives in amox-pi-extensions-lean.
Usage
Start an agent. Set run_in_background: false to request the result inline when the next step depends on it. The agent’s configuration can require background execution:
{
"op": "run",
"prompt": "Find the implementation of the cache key.",
"description": "Locate cache key",
"subagent_type": "Explore",
"run_in_background": true
}
Use the agent_id from run, or a saved handle after reload. result checks status or returns finished output without waiting by default. Prefer the completion notification for background work. If the next step needs an already running agent’s result, pass input: '{"wait":true}' to result. Saved results include their finish time and age when available:
{ "op": "result", "agent_id": "agent-id" }
Send a new instruction to an agent that is still running:
{ "op": "steer", "agent_id": "agent-id", "message": "Also check the tests." }
Run a workflow when explicitly requested, or when the user names a saved workflow; asking for a number of agents uses parallel run calls. Put workflow parameters in input as JSON text:
{ "op": "workflow", "input": "{\"name\":\"review-panel\"}" }
See the full parameter list for one operation:
{ "op": "help", "input": "run" }
Print (pi -p) and JSON runs wait for background agents and workflows before exiting so the parent can respond to their results. Set headlessWaitMinutes in subagents.json to limit the wait (0, the default, means no limit). A subagent also waits for its own background children before finishing; their results remain available while their parent's record is retained.
Installation
This is a public npm package. Install without a version pin:
pi install npm:@gfgghgftgffg/pi-subagents-lean
pi update --extensions
For a Git fallback, run from the repository checkout:
node scripts/install-extension.mjs pi-subagents-lean
Update a local Git installation by pulling the checkout and rerunning its installer; pi update does not update local contents. Keep one installation source. To migrate, back up settings, remove only the exact old source shown by pi list, then install the npm source. Do not load another pi-subagents wrapper alongside it.
For optional goal integration, also install or update pi-goal-x-lean with pi install npm:@gfgghgftgffg/pi-goal-x-lean.
Important: review your agent definitions
Upstream discovers built-in and custom agents in global, workspace and project directories. This package does not ship private agents, sessions or memory. After install, check each agent's model, remove types you do not want, and avoid names that collide with general-purpose, Explore and Plan. Built-in Explore inherits the session model unless the agent file sets one. Resuming an agent keeps the model and thinking level recorded by its session, even after cleanup or reload; editing those fields in its definition applies to new agents. See the upstream changelog for fallback behavior when that model is unavailable. Built-in general-purpose can delegate outside workflows, within the upstream depth and concurrency limits; a same-named custom file without allowed_subagents keeps delegation disabled. Settings saves globally unless the project already has .pi/subagents.json; Tab switches the target file. cacheRetention defaults to inherit; set it to none, short or long, or use an agent's cache_retention frontmatter, without changing the parent session's cache policy.
A removed worktree that held changes cannot be reopened; a clean one reopens in the main checkout. Background tasks notify the parent when they finish. Agents with allowed_subagents share a default limit of 10 running nested children; excess nested spawns fail instead of queuing. Top-level and workflow agents are outside this limit. Configure it through /agents → Settings → Max nested concurrency (0 means unlimited). Agent files, workflows, worktrees and subagents.json are documented upstream; integrations use its events and RPC. Lifecycle events cover nested and workflow agents as well as top-level ones; RPC snapshots can report pending notifications and settling descendants, and workflow bus results are separate from the truncated notification text. RPC stop waits up to 5 seconds by default for the stopped agent and its descendants to settle. workflow authoring and compatibility cover strict draft-07 agent({ schema }) validation and failure diagnostics. Reload after changing agent definitions, discovery or trust settings. Behavior notes are in the changelog.
Context footprint (character proxy)
| Package | Registered character proxy |
|---|---|
| @gfgghgftgffg/pi-subagents-lean | 273 |
| @tintinweb/pi-subagents | 8832 |
Fixed ceil(characters / 4), not provider billing tokens.
Development
See the development and maintenance guide and MAINTENANCE.md for adaptation details.