← Browse

@sonichi/quota-tracker

A

Track Claude Code quota usage via Anthropic API rate limit headers. Shows 5h and 7d utilization, reset times, and quota status. Works with both subscription and API key auth.

skillclaude

Install

agr install @sonichi/quota-tracker --target claude

Writes 3 files into .claude/skills/, pinned to git-ef5512d4.

  • .claude/skills/quota-tracker/README.md
  • .claude/skills/quota-tracker/SKILL.md
  • .claude/skills/quota-tracker/manifest.json

Document


name: quota-tracker description: "Track Claude Code quota usage via Anthropic API rate limit headers. Shows 5h and 7d utilization, reset times, and quota status. Works with both subscription and API key auth."

Quota Tracker

Monitor your Claude Code quota in real time by intercepting Anthropic API rate limit headers.

When to Use

  • "How much quota do I have left?"
  • "Am I close to the rate limit?"
  • "When does my quota reset?"
  • Before starting expensive tasks

How It Works

A credential proxy sits between Claude Code and the Anthropic API. It reads anthropic-ratelimit-unified-* headers from every API response and writes quota state to a JSON file.

Quick Check

# Read current quota state
cat quota-state.json

Output includes:

  • anthropic-ratelimit-unified-5h-utilization — % of 5-hour window used
  • anthropic-ratelimit-unified-7d-utilization — % of 7-day window used
  • anthropic-ratelimit-unified-5h-reset — when the 5h window resets (epoch)
  • anthropic-ratelimit-unified-7d-reset — when the 7d window resets (epoch)
  • anthropic-ratelimit-unified-status — "allowed" or "rejected"

Setup

1. Start the credential proxy

npx tsx "$SKILL_DIR/scripts/credential-proxy.ts"

This starts on port 7846 and reads OAuth credentials from macOS keychain.

2. Route Claude Code through the proxy

ANTHROPIC_BASE_URL=http://localhost:7846 claude ...

Or add to your voice agent's launchd plist:

<key>ANTHROPIC_BASE_URL</key>
<string>http://localhost:7846</string>

3. Read quota state

python3 "$SKILL_DIR/scripts/read-quota.py"           # human readable
python3 "$SKILL_DIR/scripts/read-quota.py" --json     # machine readable
python3 "$SKILL_DIR/scripts/read-quota.py" --gate     # exit 1 if exhausted

Requirements

  • macOS (reads OAuth from keychain)
  • Claude Code logged in (subscription or API key)
  • Node.js with tsx

Trustgrade A

  • passBody integrity

    Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.

  • passType matchnot applicable to this artifact type

    Whether the artifact is really the kind of thing its metadata claims it is.

  • passFreshness

    How long since the source repository was last pushed to.

  • passPrompt injection

    Scans the artifact's own text for instructions aimed at your agent rather than at you.

  • passLicense

    Whether the source repository declares an SPDX license permissive enough to redistribute.

How the grade is calculated

Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:

  • Aevery check passed
  • Bone warning
  • Ctwo warnings
  • Dprompt injection or body integrity failed, or three warnings
  • Fone of those failed, and something else is wrong

These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.

Versions

  • git-ef5512d434b42026-07-31