@artale/pi-tokens
Token cost intelligence for Pi. Per-tool cost breakdown, $/call estimates, budget alerts, expensive call finder.
Package details
Install @artale/pi-tokens from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@artale/pi-tokens- Package
@artale/pi-tokens- Version
1.1.0- Published
- Mar 14, 2026
- Downloads
- 46/mo · 7/wk
- Author
- artale
- License
- MIT
- Types
- extension
- Size
- 10 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"src/extension.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-tokens
Real-time token usage tracking for Pi. Per-message, per-tool, and session totals.
Install
pi install npm:@artale/pi-tokens
Commands
/tokens — session summary (input, output, total, rate)
/tokens tools — breakdown by tool (which tools eat the most tokens)
/tokens messages — per-message breakdown (last 20)
/tokens reset — reset all counters
Tools
tokens_usage— session summarytokens_tools— per-tool breakdown
What it tracks
- Input tokens per message
- Output tokens per message
- Tool result sizes (estimated)
- Token rate (tokens/minute)
- Top tools by token consumption
Why
Context windows aren't infinite. Know what's eating yours. If bash is consuming 60% of your tokens, maybe you need pi-lean to truncate its output.
License
MIT