Check your Claude plan usage limits from the terminal โ no more switching to the desktop app
Project description
๐ฏ claude-plan-usage
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
- ๐ค Why Not Other Tools?
- ๐ Installation
- ๐ Usage
- ๐ How It Works
- ๐จ Progress Bar Colors
- ๐ Requirements
- โ ๏ธ Limitations
- ๐ License
โจ 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
/usageslash 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-utilizationandanthropic-ratelimit-unified-7d-utilizationheaders 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:
- ๐ Reads your OAuth token from macOS Keychain (stored by Claude Code CLI on login)
- ๐ก Sends one tiny Haiku API call (1 token)
- ๐ Reads the rate limit headers from the response
- ๐จ 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_plan_usage-0.1.1.tar.gz.
File metadata
- Download URL: claude_plan_usage-0.1.1.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e830e2c564cde5b23a155674df01cf7df768b883ae57cc6b6b291e11b64b4ab
|
|
| MD5 |
97bef67cadf0e666ed818bb20a3ff72c
|
|
| BLAKE2b-256 |
ec476ae2103b1a50b44a97e12c1614288cec8faeeae9e8a90e508b2e9c157a3b
|
File details
Details for the file claude_plan_usage-0.1.1-py3-none-any.whl.
File metadata
- Download URL: claude_plan_usage-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
144ae6d7573d643d224163cfcd9308eddec392c5c12ae97c63c2d25a920b1342
|
|
| MD5 |
a72b6f27745531b8cf6580429b5858f0
|
|
| BLAKE2b-256 |
b8e2107c58e8e881b46ec43079cb943842636acb3f66c185386e130b7b05c806
|