@kivlor/pi-subagents
Minimal subagent delegation for pi — bounded child sessions plus markdown-defined custom agents (Codex-style)
Package details
Install @kivlor/pi-subagents from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@kivlor/pi-subagents- Package
@kivlor/pi-subagents- Version
0.1.3- Published
- Oct 7, 2026
- Downloads
- 468/mo · 468/wk
- Author
- kivlor
- License
- MIT
- Types
- extension
- Size
- 19.1 KB
- Dependencies
- 0 dependencies · 2 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
@kivlor/pi-subagents
Subagent delegation for the Pi coding agent: run a task in a fresh child session with its own clean context, optionally guided by a custom agent defined in a plain markdown file.
Install
pi install npm:@kivlor/pi-subagents
--local/-l writes the declaration to the project's .pi/settings.json
instead of the personal one. Manage installed extensions with pi config.
Tools
subagent— runs a task in a fresh, throwaway child session (in-memory, no persisted session file) and returns the child's final answer. Params:task,agent?,model?,cwd?.
Usage
Ask pi: "Use a subagent with the code-reviewer agent to review src/foo.ts", and the model calls:
{ "task": "Review src/foo.ts ...", "agent": "code-reviewer" }
Commands
/agents— list agents/agents <name>— inspect one/agents:new <name>— scaffold one
Custom agents
Plain markdown files with YAML frontmatter, discovered from:
.pi/agents/in the current project~/.pi/agent/agents/
File format:
---
description: Reviews code for bugs and security issues
model: z-ai/glm-5.3
thinking: high
tools: ["read", "bash", "grep"]
---
You are a meticulous code reviewer. … (this body is the agent's system prompt)
All frontmatter fields are optional. The filename (minus .md) is the agent
name unless overridden by name:.