Skip to main content

🎯 claude-plan-usage

PyPI Version Python Version License: MIT PRs Welcome Zero Dependencies

Your Claude plan usage limits — in the terminal. No more switching to the desktop app.

  Plan usage limits  Team

  Current session
  Resets in 4 hr 38 min
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  13% used

  Weekly limits

  All models
  Resets in 130 hr 58 min
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  4% used

  Last updated: 14:01:55  ● within limits

📑 Table of Contents


✨ Key Features

  • 🎯 Exact numbers — reads the same data as claude.ai/settings/usage, not estimates
  • ⚡ Instant — one command, results in 2 seconds
  • 🔌 Claude Code integration — add as a /usage slash command, never leave your session
  • 🪶 Zero dependencies — just Python standard library, nothing to install
  • 🔑 Zero config — auto-reads your auth from macOS Keychain
  • 💰 Basically free — each check costs ~$0.000001 (one Haiku token)
  • 📊 Color-coded progress bars — blue, yellow, red based on utilization

🤔 Why Not Other Tools?

Other usage trackers (like claude-monitor) parse your local session files and estimate your limits using token counts, ML predictions, and P90 calculations. They're guessing.

claude-plan-usage doesn't guess. It reads undocumented rate limit headers directly from Anthropic's API — the exact same data source that powers the claude.ai/settings/usage page.

When the dashboard says 50%, this tool says 50%. Same number. Same source.

🔮 Other tools 🎯 claude-plan-usage
Data source Local session files ✅ Live API response headers
Accuracy Estimated from token counts Exact — same as claude.ai dashboard
What it shows Token counts, burn rates, predictions Actual plan utilization % and reset times
Setup Config files, plan selection, themes pip install and done
Dependencies Heavy (ML, Rich, Pydantic, Sentry) Zero — Python standard library only
Complexity 100+ files ✅ ~200 lines of code

💡 The key discovery: Anthropic returns anthropic-ratelimit-unified-5h-utilization and anthropic-ratelimit-unified-7d-utilization headers on every API response. These are undocumented. Nobody was reading them. Now you can.


🚀 Installation

pip install claude-plan-usage

That's it. No config. No setup. No API keys needed.


📖 Usage

Terminal

claude-plan-usage

🔌 Inside Claude Code (Slash Command)

This is the cool part — you can check your usage without leaving your Claude Code session.

Create this file at ~/.claude/skills/usage/SKILL.md:

---
name: usage
description: Show Claude plan usage limits (current session and weekly)
disable-model-invocation: true
allowed-tools: Bash
---

Run the following command and display the output to the user exactly as-is:

\```bash
claude-plan-usage
\```

Now just type /usage in any Claude Code session. ✨

🐍 Python API

from claude_usage import get_plan_limits

limits, error = get_plan_limits()
if limits:
    print(f"Session: {limits['session']['percent']}% used")
    print(f"Weekly:  {limits['weekly']['percent']}% used")
    print(f"Status:  {limits['status']}")

🔍 How It Works

Anthropic returns undocumented rate limit headers on every API response:

Header What it tells you
anthropic-ratelimit-unified-5h-utilization 📊 Current session usage (0.0 to 1.0)
anthropic-ratelimit-unified-5h-reset ⏰ When the session resets (unix timestamp)
anthropic-ratelimit-unified-7d-utilization 📊 Weekly usage (0.0 to 1.0)
anthropic-ratelimit-unified-7d-reset ⏰ When the week resets (unix timestamp)
anthropic-ratelimit-unified-status allowed or 🚫 throttled

How it works under the hood:

  1. 🔑 Reads your OAuth token from macOS Keychain (stored by Claude Code CLI on login)
  2. 📡 Sends one tiny Haiku API call (1 token)
  3. 📋 Reads the rate limit headers from the response
  4. 🎨 Renders progress bars with colors in your terminal

Zero config. Zero dependencies. Just works.


🎨 Progress Bar Colors

Color Utilization Vibe
🔵 Blue 0–49% You're chilling
🟡 Yellow 50–79% Maybe slow down
🔴 Red 80–100% You're about to hit the wall

📋 Requirements

Requirement Details
🍎 OS macOS (uses Keychain for auth)
🤖 Claude Code Installed and logged in
🐍 Python 3.9+

🐧 Linux/Windows users: PRs welcome! The main blocker is reading the OAuth token — everything else is cross-platform.


⚠️ Limitations

  • macOS only for now — the OAuth token lives in macOS Keychain. Happy to accept PRs for other platforms.
  • Undocumented API headers — Anthropic could change these anytime. If it breaks, open an issue.

📝 License

MIT


Built by @craakash — because checking usage shouldn't require opening another app.

Release files for claude-plan-usage 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claude-plan-usage 0.1.1
File Size Uploaded
claude_plan_usage-0.1.1.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claude-plan-usage 0.1.1
File Interpreter ABI Platform
claude_plan_usage-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.8 kB

Release files / claude_plan_usage-0.1.1.tar.gz

Download URL claude_plan_usage-0.1.1.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7e830e2c564cde5b23a155674df01cf7df768b883ae57cc6b6b291e11b64b4ab
BLAKE2b-256 checksum
How to use checksums
ec476ae2103b1a50b44a97e12c1614288cec8faeeae9e8a90e508b2e9c157a3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.5

Release files / claude_plan_usage-0.1.1-py3-none-any.whl

Download URL claude_plan_usage-0.1.1-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
144ae6d7573d643d224163cfcd9308eddec392c5c12ae97c63c2d25a920b1342
BLAKE2b-256 checksum
How to use checksums
b8e2107c58e8e881b46ec43079cb943842636acb3f66c185386e130b7b05c806
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page