omp packages

@m4riok/pi-cc-usage0.2.0

Pi extension for Claude Code subscription usage via Anthropic OAuth

m4riok Published 11 days ago MIT ~483 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

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 .