← Catalog

@m4riok/pi-cc-usage

Pi extension for Claude Code subscription usage via Anthropic OAuth

Package

Install

Install with PiG

pig install npm:@m4riok/pi-cc-usage

Install with Pi

pi install npm:@m4riok/pi-cc-usage
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.2.0 (README.md). PiG does not review it.

pi-cc-usage

Shows Claude Code subscription usage and reset countdowns in Pi.

Install

Requires Node.js 22.19 or newer. Tested with Pi 1.6.0.

pi install npm:@m4riok/pi-cc-usage

In Pi, use /login and select Anthropic (Claude Pro/Max). API keys and separate Claude Code CLI credentials are not used. The usage request reads Anthropic's undocumented OAuth usage endpoint; it does not send a model request.

Usage

The footer appears only on Anthropic models and hides when switching to another provider. Manual usage commands and settings work on any model.

Run /usage to open the settings menu. By default, the footer shows weekly (7d) usage as percentage remaining in the default format and refreshes after provider responses. The 5h window is off by default. Poll mode refreshes while an Anthropic model is selected, even without user turns. Set Poll interval (min) in the menu to a whole number of minutes (default: 1).

/usage refresh
/usage format default
/usage format compact
/usage 5h on
/usage 5h off
/usage weekly on
/usage weekly off
/usage percent remaining
/usage percent used
/usage update turn
/usage update poll
/usage interval <minutes>

/usage format, /usage 5h, and /usage weekly open selectors. /usage refresh bypasses the local cache. Settings persist under piCcUsage in Pi's settings.json.

If pi-openai-tweaks is also loaded, Pi numbers the duplicate commands as /usage:1 and /usage:2. Use command completion to find the one described as Claude Code usage.

Rate-limit limitation

When Anthropic returns HTTP 429 with a usable Retry-After header in poll mode, automatic polling resumes at the first scheduled poll at or after that deadline. If the header is missing or unusable, the extension continues at the configured interval; it cannot know when Anthropic will accept another request. This pause applies only to automatic updates in poll mode. Manual /usage refresh and turn-mode updates can still receive HTTP 429.

Development

From the repository root:

npm ci
npm run check
npm test
pi -e .