Pi Usage — AI skill for Claude Code
Pi extension that fetches subscription usage for AI providers.
How to install Pi Usage
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open juanibiapina/pi-usage and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Pi Usage does
Pi extension that fetches subscription usage for AI providers. Simplified fork of @marckrenn/pi-sub-core.
Alternatives in AI
- onWatch — Open-source Go CLI that tracks AI API quota usage across 7 providers (Synthetic, Z.ai, Anthropic, Codex, GitHu 397 ★
- Mirofish CLI — Multi-agent AI prediction engine - digital sandbox for scenario simulation (fork of 666ghj/MiroFish) 307 ★
- Facadecode — One IDE for you and your AI team 131 ★
README
pi-usage
Pi extension that fetches subscription usage for Anthropic, Copilot, Gemini, Antigravity, Codex, Kiro, z.ai, and xAI/Grok.
Behavior
Usage resolves when Pi starts a session, selects a model, or completes a turn. The extension has no recurring refresh timer.
All Pi processes owned by the same OS account on one machine share provider state, regardless of project or `PI_CODING_AGENT_DIR`. State uses the OS user cache directory:
- Linux:
${XDG_CACHE_HOME:-$HOME/.cache}/pi-usage - macOS:
$HOME/Library/Caches/pi-usage - Windows:
%LOCALAPPDATA%\\pi-usage
Each provider has an independent freshness window, lease, last-good snapshot, and retry deadline. The initial freshness window remains 60 seconds.
For every resolution:
- Fresh cached usage returns without an endpoint call.
- Stale usage triggers one endpoint call when retry policy permits it.
- Concurrent local callers wait and receive the lease owner's result.
Retry-Afterbecomes an absolute deadline shared by every local Pi process.- A failed refresh preserves last-good usage and marks it stale.
- A provider without last-good data returns unavailable.
Cached data inside the freshness window is fresh. Stale means refresh was due but could not complete.
Coordination is per OS account and machine. Different machines do not share state.
Events
| Event | Payload | Description |
|---|---|---|
usage-core:ready |
{ state: UsageCoreState } |
Initial resolved state for the selected provider |
usage-core:update-current |
{ state: UsageCoreState } |
Result of each lifecycle-triggered resolution |
`UsageCoreState` retains the existing `provider` and `usage` fields and adds:
availability:availableorunavailable;freshness:freshorstalewhen usage is available;source:cacheorendpoint;fetchedAtandobservedAttimestamps;- optional
retryAt,staleReason, anderrorfields.
Consumers should keep stale usage visible unless their interfac
Related Skills
Coding Agent Account Manager
Sub-100ms auth switching for AI coding CLIs (Claude Code, Codex, Gemini): swap subscription accounts instantly
Syrtis Windows
Windows port of TokenBar — a tray monitor for AI coding-agent token usage, cost, and subscription quota. WinUI
Mysubs
Check AI subscription usage across accounts and providers from the command line.
Core
Agentic AI monitoring and observability — OTEL traces and local log files from Copilot, Claude Code, Codex, an
Claude Codex Consult
Claude Code skill + PowerShell bridge that lets Claude consult OpenAI Codex (any model) mid-task over your Cha
Nexora
Self-hosted, MIT-licensed AI-agent orchestration platform. Agents with personas, skills & tools that chat, run
Related Agents
PR Backend
Use this agent for PocketRocket hub/backend work: room routing, the bot turn engine, providers, approvals and
Riverpod Reviewer
Reviews Riverpod v3 provider patterns for correctness after code changes. Use proactively when adding or modif
Spgr Agent Billing
Owns the SaaS revenue model: Stripe integration, subscription lifecycle, usage metering, dunning, plan entitle