@ssk_dev/pi-subagents-lean
Lean Pi subagents extension with full features: 268 initial tokens (96.5% fewer than current upstream).
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.19.4- Published
- Oct 3, 2026
- Downloads
- 423/mo · 41/wk
- Author
- ssk_dev
- License
- MIT
- Types
- extension
- Size
- 18.8 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
@ssk_dev/pi-subagents-lean
Token benchmark: Lean 275, upstream
@tintinweb/pi-subagents@0.19.08,540 — 96.8% fewer.
A lightweight Pi wrapper for @tintinweb/pi-subagents. It preserves the full upstream subagent engine while condensing all agent operations into a single, compact tool schema.
Core Features
- Full upstream runtime: Keeps agent discovery, spawning, background execution, result retrieval, steering, and lifecycle handling untouched.
- Unified tool interface: Combines
Agent,get_subagent_result, andsteer_subagentunder onesubagenttool. - Advanced options on demand: Detailed parameters and schemas remain accessible via
helpand JSON inputs without cluttering the default prompt. - Available agent names:
subagent_typeshows the enabled types captured at extension startup. Reload the extension after changing agent definitions/settings; if the upstream description format is unrecognized, usehelpwithinput: "run".
This package does not strip down or rewrite the underlying engine; it only slims down the prompt footprint exposed to the model.
Installation
pi install npm:@ssk_dev/pi-subagents-lean
Do not load this alongside another pi-subagents wrapper to avoid registering duplicate tools.
Usage
The model interacts with a single tool:
subagent
Supported operations include 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
resultwithagent_idto retrieve output from a finished task. - Use
steerwithagent_idandmessageto redirect a running agent. - Use
helpto inspect advanced upstream parameters when needed.
Important: Review Your Agent Definitions
The upstream runtime automatically discovers built-in and custom agents across global, workspace, and project directories. This repository does not package your private agents, sessions, or memory, but it intentionally preserves that discovery mechanism.
After installation:
- Review all discovered agent definitions and make sure each
modelfield points to a model available in your environment. - Remove any agent types you do not need.
- Adjust prompts, tools, and extension allowlists to match your workflow.
- Check for naming collisions: a custom agent with the same name can override a built-in type depending on discovery precedence.
The upstream package includes built-in general-purpose, Explore, and Plan types. Your environment may load additional custom definitions.
Context Footprint Benchmark
With only this extension enabled, its recurring model-facing initialization contribution is:
| Variant | Tool and prompt contribution | Total |
|---|---|---|
Lean @ssk_dev/pi-subagents-lean@0.19.4 |
subagent (275) |
275 |
Upstream @tintinweb/pi-subagents@0.19.0 |
Agent (2,563) + SubagentWorkflow (5,611) + get_subagent_result (183) + steer_subagent (183) |
8,540 |
This saves 8,265 tokens (96.8%).
Measured with Pi 1.0.0 in separate temporary processes with empty working directories and configuration. Built-in tools, skills, context files, session history, user messages, unrelated extensions, runtime UI, and slash commands are excluded; before_agent_start additions are included. Tokens are a fixed character-proxy estimate using ceil(characters / 4), not provider tokenizer billing.
Versions
Upstream runtime is pinned to @tintinweb/pi-subagents@0.19.0.
Development
npm ci
npm run check
License
MIT. This project wraps the MIT-licensed @tintinweb/pi-subagents.