@gfgghgftgffg/pi-subagents-lean
A lighter wrapper for @tintinweb/pi-subagents: one subagent tool, about 97% less tool text on the first call.
Package details
Install @gfgghgftgffg/pi-subagents-lean from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@gfgghgftgffg/pi-subagents-lean- Package
@gfgghgftgffg/pi-subagents-lean- Version
0.1.27- Published
- Nov 28, 2026
- Downloads
- 3,132/mo · 544/wk
- Author
- gfgghgftgffg
- License
- MIT
- Types
- extension
- Size
- 85.1 KB
- Dependencies
- 1 dependency · 4 peers
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@gfgghgftgffg/pi-subagents-lean
A unified, ultra-lean facade for @tintinweb/pi-subagents — cutting registered tool text by ~97%.
Routes agent launches, result inspection, mid-flight steering, and scripted workflows through a single subagent tool while retaining upstream background execution, schedules, FleetView UI, and native result cards.
Features
- Five operations in one tool —
run,result,steer,workflow, andhelpshare a singlesubagentregistration backed by the upstream published runtime. - Validated JSON passthrough — Uncommon fields stay out of the permanent schema; pass them as a JSON object string in
input(validated against the real upstream TypeBox schema before execution) and inspect full schemas viaop: "help". - Workflow authoring & exposure parity —
helpforworkflowincludes the authoring guide, or points to the bundled upstream skill path whenworkflowToolExposure: "skill"is configured. Because the facade is always a single tool,"deferred"exposure does not split or defer itsworkflowoperation. - Dynamic startup agent roster —
subagent_typelists agent types enabled when the extension loads (reload after editing agent files, or runop: "help"withinput: "run"if upstream's custom description cannot be parsed). - Nested FleetView & Goal bridge — FleetView nests child agents under their parent with per-agent token usage (
❯marks the cursor,●marks the open view, andshowModeladds model and thinking level). Also registers a read-only child-session context bridge sopi-goal-x-leankeeps goal ownership in the parent session.
Installation
Install from npm without pinning a version:
pi install npm:@gfgghgftgffg/pi-subagents-lean
pi update --extensions
For optional persistent-goal coordination, install or update pi-goal-x-lean alongside it:
pi install npm:@gfgghgftgffg/pi-goal-x-lean
Or install from a local checkout of the monorepo:
node scripts/install-extension.mjs pi-subagents-lean
[!IMPORTANT] Do not load another
pi-subagentswrapper alongside this package. Local Git installations are updated by pulling the checkout and re-runninginstall-extension.mjs(pi updatedoes not update local checkouts). When migrating to npm, back up settings, remove the exact old entry shown inpi list, and install the npm package.
Usage
Launch a subagent (run_in_background: false waits inline when the next step depends on it, unless the agent's definition forces background execution):
{
"op": "run",
"prompt": "Find the implementation of the cache key.",
"description": "Locate cache key",
"subagent_type": "Explore",
"run_in_background": true
}
Check status or read finished output (pass agent_id or a saved handle after reload):
{ "op": "result", "agent_id": "agent-id" }
result returns immediately by default; prefer completion notifications for background tasks, or pass input: "{\"wait\":true}" when the next step is blocked on a running agent. Saved records include completion timestamp and relative age when available.
Steer a running subagent:
{ "op": "steer", "agent_id": "agent-id", "message": "Also check the tests." }
Run an explicit or named saved workflow (for "use N agents", prefer parallel run calls instead):
{ "op": "workflow", "input": "{\"name\":\"review-panel\"}" }
Inspect every parameter for an operation:
{ "op": "help", "input": "run" }
[!TIP] Headless runs (
pi -pand JSON mode) automatically wait for background agents and workflows before exiting so the parent session can respond to their output. SetheadlessWaitMinutesinsubagents.jsonto bound that wait (0, the default, means unlimited). Subagents also wait for their own background children before finishing, and child results remain readable while the parent record is retained.
Agent Definitions and Operational Notes
[!WARNING] Upstream discovers built-in and custom agents across global, workspace, and project directories (this package bundles no private agents, sessions, or memory). Review each agent's
model, remove unwanted definitions, and avoid naming custom agentsgeneral-purpose,Explore, orPlan. Reload Pi after changing agent files, discovery scopes, or trust settings.
- Model inheritance & session resume — Built-in
Exploreinherits the parent session's model unless overridden in an agent file. Resuming an agent preserves the model and thinking level recorded in its saved session (even across reloads or cleanup); edits to an agent definition apply to newly launched agents. See the upstream changelog for unavailable-model fallback rules. - Nested delegation & concurrency limits — Built-in
general-purposecan delegate outside workflows within upstream depth and concurrency limits (a customgeneral-purposefile withoutallowed_subagentskeeps delegation disabled). Agents withallowed_subagentsshare a default cap of10concurrent nested children (/agents → Settings → Max nested concurrency,0= unlimited); excess nested spawns fail immediately rather than queuing. Top-level and workflow agents are exempt. - Settings file & prompt cache policy — Settings save globally unless
.pi/subagents.jsonalready exists in the project (Tabswitches the target file).cacheRetentiondefaults toinheritand can be set tonone,short, orlong(or overridden per agent viacache_retentionfrontmatter) without affecting the parent session's cache policy. - Worktrees — A deleted worktree that contained uncommitted changes cannot be reopened; a clean removed worktree reopens in the main checkout.
- Events, RPC & workflow validation — Upstream agent docs, events, and RPC v2 cover top-level, nested, and workflow lifecycles. RPC snapshots report pending notifications and settling descendants, workflow bus payloads stay untruncated separately from notification text, and RPC
stopwaits up to 5 seconds by default for descendants to settle. Strict draft-07agent({ schema })checks and failure diagnostics are documented in workflows.md.
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.
Source and Development
Adapted from kunkun9527/pi-subagents-lean over tintinweb/pi-subagents, maintained in amox-pi-extensions-lean. The upstream published runtime is installed as an exact dependency without copying engine code; both projects are MIT-licensed (LICENSE preserved).
See the maintenance policy and MAINTENANCE.md for dist entrypoint contracts and child-context bridge details.