pi extension suite · 10 packages

The Pi
Extension
Suite

Live observability, disciplined context control, and parallel agent orchestration — inside your terminal.

01 Observe & Accelerate 02 Tame Context 03 Orchestrate
ecosystem map

Ten focused tools. Three acts.

Click any card to jump straight to its 5-slide chapter — or press M anywhere to return here.

ACT I · EXTENSIONS 01 – 03

Observe & Accelerate

Before you optimize an agent session, make its hidden state visible — how full the context window is, how fast tokens stream, and how to shift into priority gear.

pi extension

pi-context-usage icon

pi-context-usage

Dot-grid view of your context window.

session · live preview /context
claude-sonnet-4-5 31.4k / 200.0k (16%)
System Prompt1.7k1%
Tools2750%
Messages29.4k15%
Empty152.2k76%
Buffer16.4k8%

why it exists · the problem

Flying blind until compaction hits.

context window no breakdown
??.?k / 200.0k ??%
Sudden compaction! Which layer ate your tokens?
◍ system prompt ? tokens

Hidden baseline overhead

Base instructions, <rules>, <project_context>, and <skills> eat context before turn one.

⚙ active tools ? schemas

Silent schema inflation

Every active tool ships its description and JSON parameter schema on every request.

● messages ? turns

Runaway turn growth

Verbose tool outputs and replies compound silently until compaction interrupts your flow.

how it works · live simulation

Watch the 10×10 grid fill turn by turn.

10×10 grid T4 · 56.0k / 200k (28%)
0% Prompt + tools pinned · messages grow 100%
System Prompt chars ÷ 4
6.0k 3%
Tools active schemas ÷ 4
2.0k 1%
Messages used − sys − tools
48.0k 24%
Empty window − used − buf
128.0k 64%
Buffer model.maxTokens
16.0k 8%
Session Turns 1 cell = 1% (2.0k tok)

In Pi, /context renders a proportional 11 × 8 (88-cell) dot grid.

how to use

Run /context in any Pi session.

pi · live session summary view
> /context
Context Usage
claude-sonnet-4-5 31.4k / 200.0k (16%)
◍ System Prompt: 1.7k (1%)
⚙ Tools: 275 (0%)
● Messages: 29.4k (15%)
· Empty: 152.2k (76%)
○ Buffer: 16.4k (8%)
Context Details
claude-sonnet-4-5 · 31.4k / 200.0k tokens (16%)
▾ System Prompt 6.2k tokens est. (24,800 chars)
▸ Introduction 0.4k est. · ▸ <skills> 1.8k est.
▾ Tools (3) 273 tokens est.
▸ edit 142 (567 chars) · read 70 · bash 61
▾ Conversation (6 turns)
▸ #1 10:00 U Inspect repo & summarize /context… 55
▸ Σ 10:06 Σ Earlier discussion summary… 38
↑/↓ move Enter/→ expand ← collapse Tab jump Esc/q close
$pi install npm:pi-context-usage

/context — Dot-Grid Summary

Proportional 11 × 8 grid separating System Prompt, Tools, Messages, Empty, and Output Buffer.

/context details — Deep Overlay

Inspect prompt tags (<skills>, <rules>), active tool schemas, and per-turn estimateTokens().

↑/↓EnterTabEsc No UI? Outputs a plain-text dump.

the advantage

Clarity before compaction hits.

5 buckets

Instant Layer Split

Separate System Prompt, Tools, Messages, Empty space, and Output Buffer with distinct symbols.

88 dots

Zero-Scroll Glance

An 11 × 8 proportional grid captures the entire 200k+ window without leaving your terminal.

2 modes

TUI + Headless

Keyboard-driven /context details overlay in interactive sessions, plain-text dump without UI.

beforeflying blind

One opaque token total. Bloated tool schemas or giant <skills> go unnoticed until sudden auto-compaction wipes your working context.

afterwith pi-context-usage

Run /context or /context details anytime to pinpoint prompt sections, active tools, and heavy turns using live chars ÷ 4 estimates.

$pi install npm:pi-context-usage
github.com/championswimmer/pi-context-usage
pi extension
pi-gauge icon

pi-gauge

Live tokens/sec and TTFT in your status bar.

42.1 t/s 412ms
live status bar · e2e mode
one LLM call · 84.2 tokens in 2.00s v0.3.2
TTFT 412ms
before_provider_request first *_delta message_end
the problem

Staring at a spinner.
Stalled, throttled, or just slow?

Two opposite bottlenecks feel identical when your status bar is silent.

case A · high TTFT (cold start) 2.40s wait
> refactor auth middleware
waiting for first token…
TTFT 2.40s
95 t/s
Status bar without pi-gauge: [ ? ]
case B · low t/s (throttled stream) 6.2 t/s
> refactor auth middleware
190ms → trickling…
190ms
6.2 t/s trickle
Status bar without pi-gauge: [ ? ]
TTFT = the wait until the first token arrives · t/s = the pace once the reply starts flowing
how it works

Three hooks. Live telemetry.

one LLM call · 84.2 tokens · 2.00s e2e ready
before_provider_requestanchor start first *_deltaTTFT 412ms message_end84.2 tok / 2.00s = 42.1 t/s
TTFT: 412ms
stream: 53.0 t/s
e2e denominator (request → message_end): 42.1 t/s
~/project (main) waiting for first delta… —

Re-anchored per call

Resets cleanly on every before_provider_request across multi-step tool loops.

Calm mid-stream

Writes throttled at 250ms (~4/sec) with a 500ms floor to suppress burst noise.

Exact at message_end

Estimates chars/4 mid-stream if needed, then snaps to exact usage.output.

how to use

Install once. Tune with /gauge.

$ pi install npm:pi-gauge ~/.pi/agent/pi-gauge.json
status bar styles 84.2 tok / 2s · 412ms
default (pill + emoji) [⚡ 42.1 t/s ⏱ 412ms]
/gauge display icon ⚡ 42.1 ⏱ 412ms
/gauge tps off [⏱ 412ms]
/gauge ttft off [⚡ 42.1 t/s]
/gauge icons nerd [U+F0E4 42.1 t/s U+F017 412ms]
waiting for 1st token [⏱ —]
/gauge — interactive TUI settings tab-complete
throughput (t/s) < on | off > /gauge tps
latency (TTFT) < on | off > /gauge ttft
measurement mode < e2e | stream > /gauge mode
display style < pill | icon > /gauge display
icon set < emoji | nerd > /gauge icons
/gauge graph [model] per-call TPS & TTFT history chart
mode=e2e [⚡ 50.0 t/s ⏱ 412ms] 100 tok ÷ 2.00s total
mode=stream [⚡ 63.0 t/s ⏱ 412ms] 100 tok ÷ 1.59s stream
the advantage

Know which model is actually fast.

same prompt · empirical readout e2e mode
fast model
142 t/s 210ms
slow model
6.2 t/s 1.85s

Spot provider slowdowns instantly

[⏱ —] flags stalled TTFT on the spot; live t/s separates queue lag from throttled streaming.

Benchmark models empirically

Compare Anthropic, OpenAI, Google, or /fast tiers on one scale — plus session trends via /gauge graph.

Zero workflow clutter

Stays in Pi’s status bar. Records append as pi-gauge-sample entries with 0 tokens of LLM context cost.

$ pi install npm:pi-gauge
Then ask Pi anything — the pill appears on its own.

pi extension

pi-faster icon

pi-faster

One /fast toggle for provider priority tiers

↯ fast / ~2x output
4 providers zero config
request payload before_provider_request
> /fast on
↯ fast
Anthropicspeed: "fast"
OpenAIservice_tier: "priority"
GeminiserviceTier: "priority"

why it exists · the problem

Fast lanes exist. Every API hides them differently.

Anthropic anthropic-messages
speed: "fast" + betas: ["fast-mode-2026-02-01"] on opus-5
OpenAI / Azure / Codex responses & completions
service_tier: "priority" excluded on gpt-oss-* & gpt-image-*
Gemini API google-generative-ai
config.serviceTier: "priority" camelCase nested under config object
Vertex AI google-vertex
X-Vertex-AI-LLM-Shared-Request-Type: priority HTTP header instead of body field
mid-session friction standard tier
01
Four incompatible knobs

Body field vs nested config vs beta array vs HTTP header.

02
Tedious to toggle mid-session

No quick switch when you want a burst of speed or want to save cost.

03
Easy to break other models

Sending unknown fields to Bedrock or unsupported models triggers errors.

streaming token output (standard) waiting...

how it works · interactive router

One toggle. Smart routing.

throughput ~2.0x
pi hook
before_provider_request
> /fast on
↯ fast active
fast-config.json
first match wins
never overrides existing
std
1.0x
fast
~2.0x
Anthropic matched
speed: "fast" + beta on claude-opus-5
OpenAI / Codex / Azure matched
service_tier: "priority" GPT, o-series, codex
Gemini / Vertex AI matched
config.serviceTier: "priority" Vertex: X-Vertex-AI-LLM-Shared-Request-Type
Other / Bedrock / OSS bypassed
payload left untouched no fast rule matched

how to use

Four subcommands. Clear status.

/fast toggle on / off
/fast on enable priority tier
/fast off return to standard
/fast status print current state
pi session ~/.pi/agent/pi-faster.json
>
Fast mode: off
>
Fast mode is on. Requests will cost more.
>
provider support matrix fast-config.json
Provider Injected Field / Header Models
Anthropic speed: "fast"+ beta on opus-5 opus-5 / 5-5, fable-5-2, mythos-5-2
OpenAI · Azure · Codex service_tier: "priority" GPT, o-series, codex
Gemini API config.serviceTier: "priority" gemini-*
Vertex AI X-Vertex-AI-LLM-Shared-Request-Type gemini-*
↯ fast on & supported model
fast: paused 10m cooldown on 402/403/429/529
(hidden) off or unsupported model

the advantage

Fast on demand. Safe by default.

~2x allowlist

Non-destructive

Only modifies allowlisted models. Existing fields & headers are never overwritten.

10m cooldown

Auto-pause on errors

HTTP 402, 403, 429 or 529 pauses fast mode so retries run normally.

10k cache guard

Transparent rules

Warns on cache miss above 10k tokens. Edit rules anytime in fast-config.json.

beforemanual provider config

Remember speed vs service_tier vs serviceTier vs Vertex headers; manually revert on rate limits.

afterpi-faster

One /fast toggle saved across sessions, automatic provider routing, and built-in 10m error cooldown.

$ pi install npm:pi-faster
github.com/championswimmer/pi-faster v0.1.3 · MIT
ACT II · EXTENSIONS 04 – 06

Tame Your Context

Long sessions rot when stale tool output, broken prompt-cache prefixes, and irrelevant skill lists crowd out the task at hand. Keep context lean, cached, and sharp.

pi extension

pi-context-prune icon

pi-context-prune

Prune old tool output, keep the summary.

context v3.2.1 · pi >= 1.5.0
read
bash
grep
summary t1, t2, t3

3 calls, raw output pruned

originals kept, recover via context_tree_query

why it exists · the problem

15 turns ago is still in every prompt.

request #15 · context payload re-sent every turn
turn 02 read 8.4 KB
turn 05 bash 14.2 KB
turn 08 grep 6.8 KB
turn 11 bash 11.6 KB
turn 13 read 4.9 KB
turn 15 prompt 0.2 KB
45.9 KB stale tool output

carried forward verbatim on turn 15, even after the bug moved on

99% stale history
LATENCY

Slower every turn

Longer prompts stretch prefill and time-to-first-token.

COST

Paid on repeat

Every subsequent prompt re-bills old logs the model already read.

ATTENTION

Signal buried in noise

Stale stack traces and grep dumps compete with the live task.

how it works · interactive simulation

Prune the context. Recover on demand.

pruned · summary active
context event (LLM prompt) 29.4 KB → 0.4 KB
t1 · readsrc/auth.ts · 8.4 KB
t2 · bashnpm test · 14.2 KB
t3 · grepsessionId · 6.8 KB
context-prune-summary compact · 0.4 KB
  • t1 read src/auth.ts — JWT middleware & refresh flow
  • t2 bash npm test — 2 fails in token.test.ts:42
  • t3 grep sessionId — 14 matches across 4 files
Summarized tool refs: t1, t2, t3 Use context_tree_query to retrieve
context_tree_query({ toolCallIds: ["t2"] }) recovered
## toolRef: t2 · Tool: bash · Status: ERROR
FAIL src/token.test.ts:42
  Expected status 200, received 401 (expired refresh token)
session index · JSONL intact
t1
readsrc/auth.ts
8.4 KB · kept
t2
bashnpm test
14.2 KB · kept
t3
grepsessionId
6.8 KB · kept
context-prune-index maps short refs back to full ToolResultMessage entries. Originals are never rewritten or deleted.

how to use

Install, configure, recover on demand.

$ pi install npm:pi-context-prune pi -e npm:pi-context-prune
pi · /pruner commands
> /pruner on · enable pruning
Context pruning enabled.
> /pruner model openai/gpt-4.1-mini:low
> /pruner prune-on agent-message
> /pruner settings · Global/Project TUI overlay
> /pruner tree · foldable pruned-call browser
> /pruner now · flush pending batches immediately
✂ ON (On agent message) │ ↑1.2k ↓340 $0.003

5 pruneOn modes

/pruner prune-on
agentic-auto calls context_prune default
agent-message on final text reply cache-safe
on-context-tag on context_checkpoint pi-context
on-demand manual /pruner now manual
every-turn after every tool turn debug

context_tree_query

always active
context_tree_query({ toolCallIds: ["t1", "t2"] })

Returns full original output + args + turn index whenever the agent needs exact details back.

the advantage

Lean context. Nothing ever lost.

01 · LEAN CONTEXT

Bulky outputs pruned

Completed tool results are filtered from the context event and replaced by tight summaries—and oversized summaries auto-skip.

02 · ZERO LOSS

Original history intact

Session JSONL entries are never rewritten or deleted. Inspect anytime in /pruner tree or recover via context_tree_query.

03 · CACHE-AWARE

Cheap & batch-smart

Batch turns with agent-message or agentic-auto to protect prefix caches, using a fast model like gpt-4.1-mini or haiku.

WITHOUT PRUNING 100% raw tool outputs re-sent
read + bash + grep carried in full on every turn
WITH PI-CONTEXT-PRUNE compact summary + short refs
summary in prompt · full logs indexed off-context
$ pi install npm:pi-context-prune
pi -e npm:pi-context-prune /pruner on Pi >= 1.5.0
pi extension
pi-cache-graph icon

pi-cache-graph

Prompt-cache hit rates and token stats inside pi.

/cache graph · per-turn (%) active branch
100% 50% 0%
hit% = cacheRead / (input + cacheRead + cacheWrite)
the problem

Silent cache misses multiply cost.

Every turn re-sends your prompt. When context edits or pruning shift earlier tokens, prefix caching breaks without warning.

PREFIX INTACT 94.2% hit
sys
tools
history [1..10]
new
cacheRead44,200
cacheWrite1,900
input820

Cached prefix skips re-tokenization: low token cost, fast prefill latency.

PREFIX BUSTED 18.6% hit
sys
edited
re-written [3..10]
new
cacheRead8,700
cacheWrite34,600
input3,620

Everything after the edit misses cache: full prompt re-written, higher latency, zero error in chat.

Re-paying uncached prompt tokens Slower TTFT on every busted turn Invisible until you measure hit%
how it works

Turn-by-turn hit% breakdown

/cache graph · per-turn warmup
100% 75% 50% 25% 0%
cacheRead (hit) cacheWrite input (uncached) click any turn
CANONICAL FORMULA
hit% = cacheRead / (input + cacheRead + cacheWrite)

OpenAI-style providers report cacheWrite = 0; Anthropic-style report it separately.

TURN #12 96.2%
cacheRead 48,100
cacheWrite 1,100
input 800
Session aggregate hit% 84.7%
how to use

Three commands. Full session TUI.

/cache graph3 views

TUI overlay across turns: 1 Per-turn %, 2 Cumulative %, 3 Cumulative tokens (▇ in, ░ write, ▒ read). Switch subagents via ← →.

/cache statsbranch vs tree

Per-message prompt, received, cache hit, cache write, and hit% table with Active branch vs Whole tree delta.

/cache exportCSV

Writes session-name.csv to project root with summary + per-message rows for charting.

PAIRING Built for pi-context-prune — verify your prune trigger preserves prefix hits instead of busting cache.
Context Cache Graph — /root — Per-turn (%)
Active branch: 14 turns • prompt 412,800 • cache hit 368,200 • hit rate 89.2%
Whole tree: 18 turns • prompt 521,400 • cache hit 441,000 • hit rate 84.6%
Latest: 95.4% • Min: 0.0% • Max: 96.8% • Turns: 18
100│············██····
 80│········██████·███
 60│·····█████████████
 40│···███████████████
 20│·█████████████████
  0│──────────────────
    1               18
Recent turns (* = active branch)
#16* 93.1%in 1,120cache 29,400claude-sonnet
#17* 94.6%in 980cache 31,200claude-sonnet
#18* 95.4%in 840cache 32,800claude-sonnet
1/2/3 view • v cycle • ←/→ agent • r refresh • q/Esc close
the advantage

See every token. Keep your cache warm.

01 // OBSERVABILITY

Three live views

Inspect per-turn %, cumulative %, or stacked token volumes (input, cacheWrite, cacheRead) right in the TUI.

02 // TREE & AGENTS

Branch & subagents

Separate active branch totals from abandoned branches, and switch to pi-subagent-manager subagent graphs.

03 // WORKFLOW

Tune pruning + export

Validate pi-context-prune strategies in real time or dump session-name.csv via /cache export.

hit%
cacheRead / full prompt
Cost & latency telemetry at a glance: Keeping cacheRead high cuts fresh input & cacheWrite re-tokenization on every turn — reducing API spend and time-to-first-token while catching regressions before they compound.
$ pi install npm:pi-cache-graph
/cache graph /cache stats /cache export

pi extension

pi-context-decisions icon

pi-context-decisions

Advertise only the skills each prompt needs.

relevance router /decisions status
> Review these validation changes
decision model
code-review
test-edge-cases
release-notes
ui-polish
4 candidates -> 2 advertised · 2 pruned

the problem

Every turn advertises everything.

Sending dozens of skills, external tools, and MCP servers on every prompt burns tokens and blurs tool choice.

unfiltered prompt 40 skills · 120 tools
code-review release-notes ui-polish test-edge-cases db-migrate mcp__slack k8s-debug terraform mcp__jira seo-audit email-copy mcp__postgres stripe-setup a11y-audit mcp__figma load-test changelog ci-repair icon-pack oncall-notes
context overhead per turn95% irrelevant
with pi-context-decisions ◇ ≡ 2/40 ⚙ 1/120
> Review these validation changes
skill code-review 0.94
skill test-edge-cases 0.82
mcp ext__git_diff 0.71
38 skills & 119 tools withheld until needed
relevant signal in contextfocused & additive

how it works

Score metadata. Route what fits.

classifier pipeline · threshold 0.375 3 advertised 3 pruned
active prompt
> Review these validation changes for missing edge cases.
decision model
scoring 6 candidates…
50-item shards no skill bodies sent
candidates (skills + opt-in mcp) threshold 0.375
advertised to Pi 3 active
withheld / pruned 3 skipped

how to use

One dialog. Five classifier routes.

$ pi install npm:pi-context-decisions
commands in pi Node 22.18+ · Pi 1.1.0+
/decisionsFloating 4-tab TUI (Skills · Tools · Decision · Lab)
/decisions statusCredentials, last round & allowlist counts
/decisions historyCommitted branch additions per turn
/decisions tools listNames-only external tool availability
/decisions mcp listMCP servers & ext__ groups (no scoring)
/decisions testExplicit synthetic check against model

Supported classifier backends

none selected by default
Pi classifiersnative classify()
TypeSafeTYPESAFE_API_KEY
OpenAIOPENAI_API_KEY (API key)
Google GeminiGEMINI_API_KEY
OpenRoutercurated catalog · OPENROUTER_API_KEY

Resolves Pi credentials first, then env vars. Zero calls until you pick a model.

Opt-in Tool & MCP filtering

off by default

Enable under /decisions → Tools. Pick individual tools or whole mcp / ext__ groups. Pin essentials globally or in .pi/pi-context-decisions.json (Ctrl+S).

the advantage

Less noise. Sharper agent focus.

≤ 12
new skills added per round

Advertises only relevant names, descriptions & paths — never bloated skill bodies or unrelated tools.

100%
top-model benchmark accuracy

50-candidate parallel shards with an 8s deadline. Top deciders hit 100% accuracy in ~314ms.

0
skills retracted on your branch

Additive across turns as tasks shift. Leaves <8 automatic skills unfiltered; fail-closed by default.

prompt context footprint
all skills + tools
160
◇ ≡ 12/40 ⚙ 18/120
30

Precision context without losing reach

Keep your entire skill library and MCP stack installed — Pi only sees what fits the task at hand, including inside pi-subagent-manager children.

$pi install npm:pi-context-decisions
1. /decisions -> 2. Decision model -> 3. Fresh session
ACT III · EXTENSIONS 07 – 10

Orchestrate Everything

Scale beyond a single serial loop: enforce task dependencies, steer parallel subagents, watch background tmux builds quietly, and keep PR checks live in your footer.

pi extension

pi-checklist icon

pi-checklist

Session task checklist with dependencies.

/checklist 1/4
k7q Design schema done
m2x Wire up store ongoing
p9z Add tests blocked by m2x
r4d Update docs planned

the problem

Long sessions lose the plan.

When subtasks live only in scrolling chat history, agents forget steps, skip prerequisites, or declare victory too early.

chat context · turn 18 untracked
turn 01 Plan: 1) schema 2) store 3) tests 4) docs
--- context compacted · earlier plan buried ---
> editing store.ts... (half wired)
! running npm test before store is finished
FAIL 3 tests failed · missing export in store
agent: "All done!" tests & docs skipped
01

Forgotten subtasks

Multi-step plans disappear behind compaction, /branch, or dozens of tool calls.

02

Skipped prerequisites

Nothing stops an agent from running tests or migrations before foundational code lands.

03

Premature "done"

Turns wrap up with half-verified changes because remaining work isn't pinned in the UI.

how it works

Enforced dependsOn state machine.

Step 3 / 5
/checklist · live session DAG 2/4 done
✓ k7q Design schema root DONE
✓ m2x Wire up store root DONE
● p9z Add tests m2x done PROG
⊘ r4d Update docs ← p9z BLCK
checklist_update validated
> updates: [{ id: "m2x", status: "done" }, { id: "p9z", status: "ongoing" }]
✓ m2x done → p9z dependency satisfied → p9z ongoing
Task Lifecycle Rules
planned → ongoing → done

Blocked tasks (blockedBy.length > 0) cannot move to ongoing or done until every dependency is done. Cycles rejected.

how to use

Three agent tools. Full TUI control.

pi · commands & TUI
$ pi install npm:pi-checklist
# or: pi install git:github.com/championswimmer/pi-checklist
/checklist Open centered TUI dialog with all tasks
/checklist add [text] Add a task with 3-char ID & dependsOn picker
/checklist settings Display mode, status style, icons, prompt steering
/checklist clear | hide Reset list or hide widget while keeping state
modes: statusbar widget-only status-minimal end-of-turn hidden

checklist_create

replace | append

Creates up to 10 tasks with deterministic 3-char FNV-1a IDs (k7q) and dependsOn DAG links.

checklist_read

filter & inspect

Returns tasks, computed ready / blockedBy views, and notes after compaction or mid-turn.

checklist_update

atomic batch

Moves tasks through planned → ongoing → done / cancelled with dependency & cycle guards.

top 5 in widget subtasks (≤3) task meta

the advantage

Accountable execution. Zero guesswork.

DAG-enforced order

Dependencies aren't advisory notes — checklist_update blocks starting any task whose blockers aren't done.

Survives session turns

Persists in the session JSONL branch across /resume, /branch, /undo, and context compaction.

Live TUI visibility

Top-5 prioritized widget, n/m footer summary, and centered /checklist overlay keep you in sync.

accountable execution

Deterministic 3-char IDs, atomic updates, and visible blockers ensure the agent finishes every step — not just the first thing that compiles.

$ pi install npm:pi-checklist
Pi 1.5.0+ Node 22.19+
pi extension
pi-subagent-manager icon

pi-subagent-manager

Parallel subagents you can watch and steer.

/agents tree live · 3 threads
main delegating to 3 agents
coder running steer: add tests
researcher done
reviewer idle
why it exists · the problem

Serial queues. Blind delegation.

One agent stalls independent tasks in line — and opaque workers hide what they're doing until it's too late.

bottleneck 01

Serial Agent Queue

main · single thread 00:00 → 03:40
1. review
2. research
3. fix auth
4. docs
■ input blocked until queue drains

Unrelated research, coding, and review wait behind one turn loop.

bottleneck 02

Blind Black-Box Workers

opaque subagent status: ???
transcript hidden
mid-flight steer blocked
resume session lost

No live tree to inspect progress, redirect wrong turns, or resume work.

the fix: parallel fan-out + live /agents tree + steer & resume
how it works · interactive tree

Parallel threads you can steer.

/agents tree · /root (fork:) 3 workers · parallel
fork: inherits frozen parent conversation snapshot
main
/root
wait: false ×3
coder /root/fix-auth
edit auth.ts · running checks
running
researcher /root/retry-audit
cited 4 retry handlers
done
reviewer /root/review-pr
checking edge cases
running
Enter → watch coder ↑12.4k ↓3.1k
read src/auth/session.ts
edit fixed token expiry guard
steer add tests
bash npm test — 14 passed
Steer add tests Enter
← open browser Enter watch / steer Ctrl+Q main
how to use

One command. Six bundled roles.

$ pi install npm:pi-subagent-manager pi 0.99.2+
commands & plain language
> "Have a reviewer check my last commit while a researcher looks up how this repo handles retries."
/agents fork:<agent> <task> share current conversation
/agents fresh:<agent> <task> start clean, zero history
/agents tree watch live tree & steer
/agents types edit model, tools & prompts
/agents delegation limits & settings

architect

Plans, tradeoffs, coordinating helpers

coder

Implementation and debugging

researcher

Codebase and web research

reviewer

Correctness and security issues

tasker

Small jobs and quick lookups

writer

Drafting and editing prose

custom agents Define your own in /agents types or .md / .yml files.
the advantage

More done at once. Nothing hidden.

parallelism

Detached Fan-Out

Launch independent siblings with wait: false and keep typing in your main session while helpers work.

observability

Watch, Steer, Resume

Inspect any branch in /agents tree, send mid-flight steering, or resume completed and paused sessions.

isolation

Fork or Fresh

Share a frozen parent snapshot via fork:, or spawn clean independent roots via fresh:.

parallel throughput · wall-clock comparison wait: false → agent_wait
Serial (1 agent)
coder researcher reviewer
3× sequential
Parallel (/root)
coder researcher reviewer
→ concurrent fan-out, results return to main
1× wall-clock
$ pi install npm:pi-subagent-manager
Try /agents fork:coder fix the failing auth test
Requires pi 0.99.2+ · tool policies are not a sandbox
pi extension
pi-background-monitor icon

pi-background-monitor

Long-running tmux jobs, logs and selective alerts

/bgmon list private tmux server
build npm run build running
tests npm test done
logs tail -f app.log failed
watch /error|failed/ delivery: wake
wake-up
the problem

Long jobs either freeze Pi or burn tokens polling.

5-minute builds, test suites, and servers stall your session—or wake the model on noisy output.

1. Foreground wait AGENT FROZEN
$ npm run build && npm test
waiting 04:42...
BLOCKED next prompt & parallel edits stuck in queue

One slow build holds the entire conversation hostage.

2. Polling in a loop NOISY WAKE-UPS
sleep 10 && tail compiling chunk 14/80... +1 turn
sleep 10 && tail compiling chunk 39/80... +1 turn
sleep 10 && tail info: HMR socket ready wasted

Every check burns context tokens on routine chatter.

SOLUTION Run detached in a private tmux server and wake Pi only on a matching line or exit.
how it works

Private tmux server. Selective regex wake-up.

private tmux server (jobs) 3 active
build npm run build running
bgmon_start · retained 8 × 1 MiB
tests npm test done
exit watch armed · 42 passed
logs tail -f app.log watching
watch: /error|failed/i · delivery: wake
wake-up signal SILENT · 0 INTERRUPTS
Lines scanned: 0 Unmatched lines stay silent
journal stream · regex /error|failed/i seq #0
WATCH ARMED metadata only · no raw output injected
waiting for line matching /error|failed/i…
how to use

Install once. Ask Pi in plain language.

$pi install npm:pi-background-monitor
Pi 1.5.0+ Node.js 22+ tmux 3.2+ Linux / macOS
natural-language prompts 5 tools
> “Run npm run build in the background. Wake up if the output matches error|failed, and check the log later.”
bgmon_start + bgmon_watch (regex, from: retained, delivery: wake)
> “Run my health-check every 5 seconds for ~5 minutes. Wake up if output contains unhealthy.”
timed Bash loop + bgmon_watch (contains: "unhealthy")
LOG PAGING bgmon_inspect pages retained history via after cursor (16 KiB / 200 lines).
/bgmon or /bgmon list

Select a live or retained job and open the read-only log viewer overlay.

/bgmon settings

Adjust shared limits (1–64) across Global, Project, and Session scopes.

/bgmon stop-server

Stop your session’s private tmux server while retaining journal logs.

attach & logRef

Returned on start for manual tmux attach or read-only historical inspection.

the advantage

Zero-polling monitoring. Bounded by design.

0
polling loops needed

Selective Wake-Up

Filter completed lines with any, contains, regex, or exit. Deliver via ui, nextTurn, or wake with metadata only.

8 / 16
running / retained defaults (1–64)

Private tmux & Subagents

Jobs run in private tmux servers and normally survive Pi shutdown. Subagents share the group budget with isolated watches.

8 × 1 MiB
per source · 200-line pages

Bounded, Visible Gaps

Ring-rotated journals bound disk and context. Rotation, capture faults, or slow-reader gaps are surfaced explicitly.

ZERO-POLLING FLOW
private tmux pane → bounded journal → line/exit watch → wake metadata → paged bgmon_inspect
$ pi install npm:pi-background-monitor
Start long jobs. Walk away. github.com/championswimmer/pi-background-monitor
the full cockpit

Ten small tools. One sharp workflow

I. Live Cockpit Visibility

/context maps every token bucket, pi-gauge tracks live t/s & TTFT, and /fast flips priority inference across providers.

II. Disciplined Context Budget

pi-context-prune shrinks stale tool dumps, /cache proves prefix hits hold, and /decisions keeps unused skills out of the prompt.

III. Parallel Execution & Shipping

/checklist keeps multi-step plans honest while /agents, /bgmon, and pi-gh-footer run builds, subagents, and CI checks side by side.

install the suite Ready to paste in your shell
$ pi install npm:pi-context-usage
$ pi install npm:pi-gauge
$ pi install npm:pi-faster
$ pi install npm:pi-context-prune
$ pi install npm:pi-cache-graph
$ pi install npm:pi-context-decisions
$ pi install npm:pi-checklist
$ pi install npm:pi-subagent-manager
$ pi install npm:pi-background-monitor
$ pi install npm:pi-footer npm:pi-gh-footer
↺ Back to Map [M]