pi-run-stats1.0.5
Pi extension: append a dim stats line (time, duration, model, thinking level, tool calls, tokens, cost) after each completed AI run
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-run-stats
A Pi extension that appends a dim stats line after each completed AI run.
◷ 17:22:31 · 8.4s · opencode-go/deepseek-v4.1-flash · high · 2 turns · 3 tools · 12.3k tok · 38 tok/s · $0.0123
What it shows
After a full agent run settles — every tool call and intermediate reply finished — one line under the reply:
| Part | Meaning |
|---|---|
◷ 17:22:31 |
Timestamp of the run's final assistant message. Older entries are disambiguated: yesterday 10:05:06, Jan 15 09:30:00, 2025-06-03 14:05:06 (expanded shows the absolute date) |
8.4s |
Total run duration (12m 30s / 1h 50m for long runs) |
provider/model |
Model that produced the reply |
high |
Thinking level, bare value (omitted when the model has none) |
2 turns |
Turns this run completed. A turn is one model request plus the tool calls it triggered, so this also counts the model requests |
3 tools |
Tool calls this run made (omitted when there were none) |
12.3k tok |
Tokens spent by this run, summed over every model request it made (unlike the footer, which accumulates the whole session) |
38 tok/s |
Output throughput: output tokens over generation time, so tool execution and idle waits are excluded. Omitted when generation time was not measurable |
$0.0123 |
Cost of this run, summed the same way |
The line shows the per-run figures. Press ctrl+o (Pi's tool-output toggle) to expand the extra breakdown:
◷ 2026-10-09 17:22:31 · 8.4s · opencode-go/deepseek-v4.1-flash · high · 2 turns · 3 tools · 52k tok · 38 tok/s · $0.0300 · gen 6.2s · +2 nested tools ↑29k ↓1.2k R21k W800
gen 6.2s— generation time behind the tok/s figure+2 nested tools— calls those tools made to other tools (codemode-style nesting)↑ ↓ R W— input / output / cache read / cache write
Design notes:
- The line is stored as a session entry and never enters the LLM context — zero token cost.
- Only one line per completed run: intermediate tool-call rounds show nothing.
- Aborted runs (Escape) and runs that end with an error show nothing; the successful retry run does.
- Entries persist with the session, so reopened sessions still show past lines.
- Token and cost figures are per run, not cumulative — the Pi footer already shows session totals and context usage.
Install
pi install npm:pi-run-stats
Then restart Pi.
Usage
The line is on by default. Toggle it with:
/run-stats