New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@tmustier/pi-usage-extension

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tmustier/pi-usage-extension

Usage statistics dashboard for Pi sessions.

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

/usage - Usage Statistics Dashboard

A Pi extension that displays aggregated usage statistics across all sessions.

Usage Statistics Screenshot

Compatibility

  • Pi version: 0.42.4+
  • Last updated: 2026-01-13

Installation

Pi package manager

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"]
    }
  ]
}

Local clone

Add to your ~/.pi/agent/settings.json:

{
  "extensions": [
    "~/pi-extensions/usage-extension"
  ]
}

Usage

In Pi, run:

/usage

Features

Time Periods

PeriodDefinition
TodayFrom midnight (00:00) today
This WeekFrom Monday 00:00 of the current week
All TimeAll recorded sessions

Use Tab or / to switch between periods.

Timezone

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.

Columns

ColumnDescription
Provider / ModelProvider name, expandable to show models
SessionsNumber of unique sessions
MsgsNumber of assistant messages
CostTotal cost in USD (from API response)
TokensTotal tokens (input + output)
↑InInput tokens (dimmed)
↓OutOutput tokens (dimmed)
CacheCache read + write tokens (dimmed)

Navigation

KeyAction
Tab / Switch time period
Select provider
Enter / SpaceExpand/collapse provider to show models
q / EscClose

Provider Notes

Cost Tracking

Cost data comes directly from the API response (usage.cost.total). Accuracy depends on the provider reporting costs.

Cache Tokens

Cache token support varies by provider:

ProviderCache ReadCache Write
Anthropic
Google
OpenAI Codex

The "Cache" column combines both read and write tokens.

Data Source

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.

Changelog

See CHANGELOG.md.

Keywords

pi-package

FAQs

Package last updated on 03 Feb 2026

Did you know?

Socket

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.

Install

Related posts