pi-time-stats

Per-call time + token stats for Pi TUI: /timestats slowest-call table plus live widget

Packages

Package details

package

Install pi-time-stats from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-time-stats
Package
pi-time-stats
Version
0.2.6
Published
Oct 1, 2026
Downloads
401/mo · 26/wk
Author
yonikremer
License
MIT
Types
package
Size
29.1 KB
Dependencies
0 dependencies · 2 peers

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-time-stats

Per-call time + token stats for the Pi TUI. One row per tool call — bash npm install and bash python -m main.py show as separate rows.

Install

pi install npm:pi-time-stats
# or from git:
pi install git:github.com/YOURNAME/pi-time-stats@v0.1.0

Use

  • /timestats [n] — slowest tool calls this session (default 10). Time on the left, tool call gets the rest of the line. Nested calls excluded with a count.
  • In the overlay: ↑↓ move, Enter expands a row to full multiline detail, q closes.
  • Live widget above the editor: last: bash 3.2s | session tools 84s | tokens ~152k.

Stats persist as session custom entries, so /reload keeps history.

Notes

  • Time measured with performance.now() between tool_execution_start / tool_execution_end.
  • Token totals come from per-message usage; per-call output sizes are character counts labeled ~.
  • Stats reset on session switch. Never logged, never sent to the model.