@ssk_dev/pi-subagents-lean
Lean Pi version of @tintinweb/pi-subagents: the full subagent engine behind one compact tool.
Package details
Install @ssk_dev/pi-subagents-lean from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@ssk_dev/pi-subagents-lean- Package
@ssk_dev/pi-subagents-lean- Version
0.26.3- Published
- Nov 22, 2026
- Downloads
- 977/mo · 178/wk
- Author
- ssk_dev
- License
- MIT
- Types
- extension
- Size
- 15.6 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
pi-subagents-lean
Full Pi subagents, one compact tool.
简体中文 · Full setup: My Lean Pi Setup
A lean version of @tintinweb/pi-subagents. It runs the upstream 0.26.2 engine as-is and folds its agent tools into one subagent tool with a short schema.
Install
pi install npm:@ssk_dev/pi-subagents-lean
Requires Pi >=1.1.0 and Node.js >=22.19.0. Don't install it alongside upstream or another pi-subagents wrapper, or the tools get registered twice.
Compared with upstream
Kept:
- Agent discovery, spawning, background runs, result retrieval, steering and lifecycle handling.
- Upstream's built-in
general-purpose,ExploreandPlantypes, plus any custom agents it discovers. - The engine itself, untouched: only the model-facing prompt is condensed.
Trimmed:
Agent,get_subagent_resultandsteer_subagentbecome onesubagenttool.- Advanced parameters and full schemas stay out of the prompt until the model asks with
help.
Added:
- Forgiving arguments: a missing
opis inferred only when unambiguous:promptorsubagent_typemeansrun;agent_idmeansresult, orsteerwhenmessageis also present. Calls mixing both are left to validation. An objectinputis serialized to a JSON string. - Agent names in the schema:
subagent_typelists the enabled types captured at startup. Reload the extension after changing agent definitions or settings; if upstream's description format isn't recognized, usehelpwithinput: "run".
Usage
The model sees one tool, subagent, with the operations run, result, steer, workflow and help.
{
"op": "run",
"prompt": "Find the implementation of the cache key.",
"description": "Locate cache key",
"subagent_type": "Explore",
"run_in_background": true
}
- Use
run_in_background: falseto wait inline when the next step depends on a new agent's result, unless its configuration pins it to background. For background work, let completion notify you instead of polling. resultwithagent_idchecks status or retrieves the output without waiting. If you need to wait for an already running agent, passinput: '{"wait":true}'.steerwithagent_idandmessageredirects a running agent.helpshows upstream's advanced parameters.
Check your agent definitions
Upstream discovers built-in and custom agents in global, workspace and project directories. This package ships none of my private agents, sessions or memory, but it keeps that discovery. After installing:
- Make sure each discovered agent's
modelpoints to a model you have. - Remove agent types you don't need.
- Adjust prompts, tools and extension allowlists to your workflow.
- Watch for name collisions: a custom agent can override a built-in type of the same name, depending on discovery order.
Token comparison
With only this extension enabled, what the model reads on every turn:
| Variant | Breakdown | Total |
|---|---|---|
Lean @ssk_dev/pi-subagents-lean@0.26.3 |
subagent (275) |
275 |
Upstream @tintinweb/pi-subagents@0.26.2 |
Agent (2,570) + SubagentWorkflow (6,020) + get_subagent_result (183) + steer_subagent (183) |
8,956 |
Method: Pi 1.4.0, each variant measured in its own temporary process with an empty working directory and configuration. Built-in tools, skills, context files, session history, user messages, other extensions, runtime UI and slash commands are not counted; before_agent_start additions are. Tokens are estimated as ceil(characters / 4), not billed tokens.
Development
npm ci
npm run check
License
MIT. The runtime comes from @tintinweb/pi-subagents (MIT).