
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@tmustier/pi-usage-extension
Advanced tools
A Pi extension that displays aggregated usage statistics across all sessions.

pi install npm:@tmustier/pi-usage-extension
pi install git:github.com/tmustier/pi-extensions
Then filter to just this extension in ~/.pi/agent/settings.json:
{
"packages": [
{
"source": "git:github.com/tmustier/pi-extensions",
"extensions": ["usage-extension/index.ts"]
}
]
}
Add to your ~/.pi/agent/settings.json:
{
"extensions": [
"~/pi-extensions/usage-extension"
]
}
In Pi, run:
/usage
| Period | Definition |
|---|---|
| Today | From midnight (00:00) today |
| This Week | From Monday 00:00 of the current week |
| All Time | All recorded sessions |
Use Tab or ←/→ to switch between periods.
Time periods are calculated in the local timezone where Pi runs. If you want to override it, set the TZ environment variable (IANA timezone, e.g. TZ=UTC or TZ=America/New_York) before launching Pi.
| Column | Description |
|---|---|
| Provider / Model | Provider name, expandable to show models |
| Sessions | Number of unique sessions |
| Msgs | Number of assistant messages |
| Cost | Total cost in USD (from API response) |
| Tokens | Total tokens (input + output) |
| ↑In | Input tokens (dimmed) |
| ↓Out | Output tokens (dimmed) |
| Cache | Cache read + write tokens (dimmed) |
| Key | Action |
|---|---|
Tab / ← → | Switch time period |
↑ ↓ | Select provider |
Enter / Space | Expand/collapse provider to show models |
q / Esc | Close |
Cost data comes directly from the API response (usage.cost.total). Accuracy depends on the provider reporting costs.
Cache token support varies by provider:
| Provider | Cache Read | Cache Write |
|---|---|---|
| Anthropic | ✓ | ✓ |
| ✓ | ✗ | |
| OpenAI Codex | ✓ | ✗ |
The "Cache" column combines both read and write tokens.
Statistics are parsed from session files in ~/.pi/agent/sessions/. Each session is a JSONL file containing message entries with usage data. Assistant messages duplicated across branched session files are deduplicated by timestamp + total tokens (matching ccusage).
Respects the PI_CODING_AGENT_DIR environment variable if set.
See CHANGELOG.md.
FAQs
Usage statistics dashboard for Pi sessions.
We found that @tmustier/pi-usage-extension demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.