pi-dent-agent
A generic coding agent as a pi extension: Bash, Task, Agent, Fleet, Script, Search, Markdown and more tools, with billing and terms extensions bundled
Package details
Install pi-dent-agent from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-dent-agent- Package
pi-dent-agent- Version
0.2.52- Published
- Nov 28, 2026
- Downloads
- 9,698/mo · 7,176/wk
- Author
- dralban68
- License
- MIT
- Types
- extension
- Size
- 89.5 MB
- Dependencies
- 21 dependencies · 5 peers
Pi manifest JSON
{
"extensions": [
"./index.ts",
"./node_modules/pi-dent-purse/index.ts",
"./node_modules/pi-dent-terms/index.ts",
"./node_modules/pi-dent-web-fetch/index.ts",
"./node_modules/pi-dent-web-search/index.ts",
"./node_modules/pi-mcp-adapter/index.ts",
"./node_modules/pi-anthropic-oauth/src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-dent
A generic coding agent built as a pi extension. It adds background tasks, child sessions, a live task browser, model guidance with billing awareness, cross-session coordination, transcript search, and scripted tool calls.
Requires pi 1.5.2 or later and Node 26.

Key features
Background tasks (Agent, Bash, Script)
Long work runs beside the conversation instead of blocking the user or filling the main context window:
BashandScriptrun shell commands or inline JavaScript/TypeScript (with access to every session tool viatools.<Name>(args)) in the foreground or withbackground: true. Full output is captured to an output file (bash-tool.md, script-tool.md).Agentdispatches an isolated child session with its own context, model, and tool subset, and continues a retained session file withresume(agent-tool.md).- Cohorts and completion notifications. Background tasks launched from one assistant message
form a cohort. The model ends its turn after launching; once every task in the cohort settles, a
single
Background tasks settled:completion notification starts the next turn, andTaskreads the results (task-registry.md, cohorts and completion notification, task-tool.md). - Live task tree widget. Running and interrupted tasks appear above the editor, with child sessions' tasks nested beneath their parent agent (task.md, task tree widget).
Task browser (shift+right / /tasks)
Press shift+right (or run /tasks) to open the full-screen task browser
(task-browser.md):
- List page: inspect the full task tree (running and settled), filter to running tasks with
f, and jump across rows with↑/↓org/G. - Details page (
enter): follow a running child session's live session events (tool calls, results, thinking, assistant replies), expand any event withenteror all withe/c, read streamingBash/Scriptoutput, or cancel a running task withctrl+k.
Model guidance and billing
Configure modelGuidance in pi-dent.conf to steer model selection and keep costs visible
(model-guidance.md, billing.md):
- Guided models: map
provider/id(with optional thinking level) to awhendescription. The model catalog lists them inAgent's description, and dispatches outside the guided set are rejected. - Session rules: regex-matched rules injected verbatim into every matching main or child session.
- Live billing annotations: paired with the bundled
pi-dent-purseextension, the guidance message annotates guided models with current rates, active discounts, and limit-window status.
Tools and extensions
| Tool | What it does | Spec |
|---|---|---|
Bash, Script |
Run a shell command, or JavaScript/TypeScript that can call other tools, in the foreground or as a background task. Bash replaces pi's built-in bash. |
bash-tool.md, script-tool.md |
Agent |
Dispatch a child session with its own context, tool subset and model, from an agent definition, an inline prompt or a default one; resume continues it. |
agent-tool.md |
Task |
List, read, wait for or kill background tasks. | task.md, task-tool.md |
Fleet, Schedule |
List the sessions on this machine and send or query across them; schedule a message to this session later. | fleet-tool.md, schedule-tool.md |
Search |
Find and read earlier messages, tool calls and results across session trees, through a SQLite index of the session files. | search-tool.md |
Markdown |
Outline, read and restructure Markdown files by their headings. | pi-dent-markdown |
Skill, Plugin |
Load a skill's instructions; read a plugin's commands, agent definitions and skills. | skill.md, plugin.md |
Session, AskUserQuestion |
Report the session's identity, models and billing report; ask the user multiple-choice questions. | session-tool.md, ask-user-question-tool.md |
Slash commands: /tasks, /fleet, /recap and /dent (slash-commands.md).
Bundled extensions, each loaded as its own extension (specs/package.md):
pi-dent-purse (billing), pi-dent-terms (Terms), pi-dent-web-fetch (WebFetch),
pi-dent-web-search (WebSearch), pi-mcp-adapter, and pi-anthropic-oauth.
Install
pi install npm:pi-dent-agent # add it to pi's packages
pi -e npm:pi-dent-agent # or try it for one run
The bundled extensions ship with the package, so do not also list them in pi's packages: a second
copy loads twice and its tools collide.
To develop pi-dent itself:
- Run
pnpm installin this repository. - List the checkout in
~/.pi/agent/settings.json:{ "packages": ["../../src/pi-dent-agent"] }. User-scope paths resolve against~/.pi/agent. - Run
pi -ne -e ./to load only this repository's extensions (docs/development.md).
Configure
pi-dent.conf is JSONC, read from two layers that merge deeply. The project layer wins every
conflict:
| Layer | Path |
|---|---|
| global | ~/.pi/pi-dent/pi-dent.conf |
| project | <cwd>/.pi/pi-dent/pi-dent.conf |
{
"modelClasses": { "fast": "zai/glm-5.3-flash" },
"modelGuidance": {
"models": {
"zai/glm-5.3": { "when": "planning and complex reasoning" },
"zai/glm-5.3-flash": { "when": "fast background workers and quick checks" },
},
"rules": [{ "match": "flash", "rule": "verify results before relying on them" }],
},
"plugins": { "dev": { "path": "/absolute/path/to/a/plugin" } },
}
- When it's read: at start and on
/reload. - Problems: a bad value produces one
pi-dent: …notification and is ignored. - Reference: docs/pi-dent-conf.md has an annotated sample of every root key; specs/config-file.md owns the format.
Documentation
- specs/: the behaviour of every tool and setting (source of truth).
- docs/concepts.md: how the domain terms relate.
- docs/development.md: how extensions load, UI surfaces, and reference code.
License
MIT