pi coding agent
Ten small extensions that make your terminal agent faster to read, cheaper to run, and calmer to trust.
$ pi install npm:pi-<extension>
the tour
Dot-grid view of your context window.
You're guessing.
...until the agent starts forgetting.
One glance: every slice of the window, by who owns it.
A dot-grid summary of your window, with five categories.
A keyboard-driven overlay: system prompt, tools, conversation.
❯ /context Context Usage ◍ ⚙ ● ● ● ● ● ● ● ● ● ● ● ● ● · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ○ ○ ○ ○ ○ claude-sonnet-4-5 31.4k / 200.0k tokens (16%) ◍ System Prompt: 1.7k (1%) ⚙ Tools: 275 (0%) ● Messages: 29.4k (15%) · Empty: 152.2k (76%) ○ Buffer: 16.4k (8%)
Run it any time, after at least one message.
Available Skills opens into one row per skill.
You get a plain-text dump instead.
see your whole window at a glance
each with its own symbol and colour
system prompt, tools, conversation
pi loads the TypeScript directly
Then run /context.
github.com/championswimmer/pi-context-usage
Live tokens/sec and TTFT in your status bar.
Streaming text feels the same until it doesn't. Nothing tells you why.
Time to first token. How long you waited before anything appeared.
Tokens per second. How fast the reply flows once it starts.
Pi sees both in its own events. Now you do too.
tps on|offthroughputttft on|offlatencymode e2e|streamt/s denominatordisplay pill|iconbracketed or compacticons emoji|nerdglyph setgraph [model]session historyBare /gauge opens a settings dialog with a live preview. ctrl+s saves.
Durations of 1s or more show as seconds.
e2e: how long did I wait overall?
stream: how fast once it starts?
←→ cycles models. esc closes.Then just ask pi something. The pill appears.
One /fast toggle for provider priority tiers
speed: "fast"service_tier: "priority"serviceTier: "priority"Output speed is the one thing you cannot type your way around.
speed: "fast"service_tier: "priority"config.serviceTier: "priority"X-Vertex-AI-LLM-Shared-Request-TypeAt a higher price. Off by default.
{
"model": "claude-opus-5-5",
"messages": [ ... ]
}{
"model": "claude-opus-5-5",
"messages": [ ... ],
"speed": "fast"
}/fasttoggle/fast onturn on/fast offturn off/fast statuscheckSaved to ~/.pi/agent/pi-faster.json
Models without fast mode are left alone.
speed: "fast"kept as you set itValues already on a request stay put.
After a 402, 403, 429 or 529, retries run at normal speed.
Toggling warns before it costs you a prompt-cache hit.
Rules live in an editable fast-config.json.
github.com/championswimmer/pi-faster
Prune old tool output, keep the summary.
tokens of raw tool output in one small coding session
illustrative example
Then every request after it carries the whole thing again.
Keep the conclusion. Drop the bulk.
Finished tool-call batches become one short summary.
Raw outputs leave future context. Your session history is never rewritten.
context_tree_query brings back any original output on demand.
Summarize with a cheap, fast model, separate from your coding model.
/pruner statusstate, model, trigger/pruner model <id>pick the summarizer/pruner nowflush pending calls/pruner treebrowse what was pruned/pruner statssummarizer tokens, cost/pruner settingstabbed settings overlaycontext_checkpoint is called/pruner nowcontext_prunedefaultillustrative example session
Prompt-cache hit rates and token stats.
Every turn re-sends your whole prompt. Pi never shows you how much of it came from cache.
Compacts the session context to keep token usage down.
Built first to add observability: see how pruning moves your hit rate, turn by turn.
Cache hits change what every turn costs. Now you can watch them.
Hit % over time for every assistant turn, in three switchable views.
Per-message token and cache table, with branch and whole-tree totals.
Writes the same data to a CSV you can chart in Excel.
Read from every assistant message's usage: input output cacheRead cacheWrite. Providers that report cacheWrite = 0 work the same.
Then run /cache graph in any pi session.
Advertise only the skills each prompt needs.
Pi lists all of them in the model's system prompt, relevant or not.
The latest thing you asked.
Only skills that fit this task.
Until a later prompt needs them.
Picks only add. Nothing is dropped.
Pin essentials, global or project.
MCP and tool filtering. Off by default.
Review these validation changes
Prepare a release
/decisionsnew skills per round, at most
default relevance threshold
skills before filtering starts
decision calls until you pick a model
github.com/championswimmer/pi-context-decisions
Session task checklist with dependencies.
A long task is a long scroll. Ten tool calls later, step one is out of sight.
Which task was next?
Every change is saved as a snapshot in the session file. Rebuild the list from the branch, last snapshot wins.
Create, replace or append the session task list.
Read tasks, statuses and what is blocked.
Move tasks: planned, ongoing, done, cancelled.
/resume, /branch, /undo and compaction.moderate or aggressive usage.or from git
pi install git:github.com/championswimmer/pi-checklist
github.com/championswimmer/pi-checklist
Parallel subagents you can watch and steer.
Everything waits its turn, and you can't see inside.
Handing work off is the easy part. Staying in the loop is what makes it useful.
See any agent live in a nested tree.
Give a running agent more direction.
Pick up a finished agent's conversation.
fork:Shares your current conversation.
fresh:Starts clean, no history.
Agents run detached. You keep working.
Plans, tradeoffs, coordinating helpers
Implementation and debugging
Codebase and web research
Finding correctness and security issues
Small jobs and quick lookups
Drafting and editing prose
Open /agents types to change a role's model, tools or instructions. Or add your own.
Default limits, shared across the whole tree. Change them in /agents.
Plain pi. No uninstall.
Delegates only big or parallel work.
Main agent coordinates, workers execute.
github.com/championswimmer/pi-subagent-manager
Requires pi 0.99.2+. MIT license.
Long-running tmux jobs, logs and selective alerts
Pi waits for the build to finish, or keeps asking "done yet?" while the error scrolls by.
Keep builds, tests, servers and tail -f running while Pi keeps working. Hear back only when output matches, or the job exits.
Run a build, test suite, server or tail -f in the background.
List jobs, read output, page through retained history.
Get called on contains, regex, exit or any.
Stop a job, forget it, or free its logs.
Review or clear this session's alert history.
Pick a job and read its log, read-only.
/bgmonSelect a job, view its read-only log. Same as /bgmon list.
/bgmon settingsTune group limits.
/bgmon stop-serverStop your session's private server.
Shows in your UI. Never enters model context.
Waits for the next run, then tells Pi.
Can start a turn when Pi is idle.
github.com/championswimmer/pi-background-monitor
Reload Pi after installing.
Compact PR number and check counts, in-footer.
Every check means leaving the terminal for a browser tab.
Fits the footer you already watch. pi-footer hosts it; this fills it.
externalStatusKey: "pr-status"
complete summary
widgetId: gh-pr-number
place and style each widget
pi-footer:update-widget{ widgetId, value: string | null } — no PR clears the value.
Passed, running and failed, colored. No browser tab.
Only nonzero counts appear. Footer width stays small.
The PR number is an OSC 8 link. Nothing else is.
Follows your branch, or a PR URL you paste. Refreshes every 30 s.
Using pi-pr-status? Disable it, then reload Pi.
your move
github.com/championswimmer/pi-<extension>