Maciek-roboblog/Claude-Code-Usage-Monitor
Local Python CLI for Claude Code limits, usage forecasts, and history
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Claude Monitor is a local Python CLI with a Claude Code statusline hook. It reads local usage records and can capture official rate_limits through --statusline. The trust layer prefers fresh official values and falls back to labeled local estimates when those captures become stale or expire. A versioned snapshot builder feeds the live terminal UI, one-shot and compact output, state files, and exports.
Rich renders the terminal UI, Pydantic and pydantic-settings handle validation and configuration, and NumPy supports statistical calculations. The integration boundary is the snapshot: external status bars, trays, and GUIs can consume --once --output json or --write-state without parsing the terminal UI. The Claude Code integration uses a statusline hook, not an MCP endpoint.
Key Capabilities & Differentiators
The CLI offers live, daily, monthly, session, entry, session-list, and burn-rate views. It tracks tokens, messages, and estimated cost, including model-specific cache creation and read costs. The v4.0.0 model distribution bar shows Sonnet, Opus, Haiku, and an Other bucket rather than dropping model families from the visualization.
Forecasting is reset-aware, and weekly utilization percentages are shown only when official figures are available. The default Custom plan uses historical P90 estimates and accepts an explicit token threshold through --custom-limit-tokens. The opt-in local warehouse keeps project-, model-, and day-level records beyond Claude's 30-day cleanup, defaults to 365 days of retention, and supports CSV and JSON reporting.
Trade-offs & Limitations
If you only need current official utilization, the native Claude Code statusline is the simpler option. Claude Monitor is useful when you also want forecasts, local fallback, historical reporting, or a scriptable interface. Those additions do not make local estimates authoritative: fixed plan thresholds and P90 estimates are planning aids, not subscription entitlements, and the Team plan has no verified local threshold.
The CLI keeps unrelated accounts out of the same five-hour window when scanning multiple sources, but it is not a centralized quota ledger. Enabling the warehouse or distributing state files adds a data-handling decision: choose what to retain and who may read project-level reports or snapshots. The MIT license permits commercial reuse of the monitor, not use of Anthropic services beyond their own terms.
Hardware & Deployment Guide
Install with uv tool install claude-monitor, or use pip in a virtual environment. The CLI requires Python 3.9+; Python 3.11+ is recommended. The local path processes usage records and renders or exports results without model inference, a GPU, or an external service. Set up the statusline hook for official limits; --api is a separate, opt-in experimental Anthropic OAuth usage path.
v3.1.0 introduced daily and monthly aggregation alongside live monitoring. v4.0.0 added the official-limit trust layer, the versioned snapshot protocol, multi-source scanning, and the opt-in warehouse. When upgrading an integration, verify that the hook produces fresh data and that the consumer handles all --once exit codes rather than treating every nonzero result as an execution error.
rate_limits take priority; stale or expired captures fall back to labeled local estimates.--once, --compact, and --write-state use a shared, versioned snapshot.--once distinguishes OK (0), near limit (10), limit hit (11), indeterminate or no active session (20), and no data or configuration error (30).--data-paths, CLAUDE_CONFIG_DIR, and WSL discovery support multiple data directories without merging unrelated accounts into one five-hour window.--filter-models anthropic excludes routed non-Claude models.Heavy Claude Code users and workstation tooling that need limit warnings, local usage history, or provenance-aware JSON snapshots for scripts and status bars.
The native statusline already answers your questions, or you need an authoritative cross-account billing ledger or centralized quota enforcement.
Quick Start & Installation
# Install directly from PyPI with uv (easiest) uv tool install claude-monitor # Run from anywhere claude-monitor # or cmonitor, ccmonitor for short
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| Claude-Code-Usage-Monitor ★ | 8.8k | +10 | Python | MIT | Local Python CLI for Claude Code limits, usage forecasts, and history |
| spec-kit | 153.7k | +1.3k | Python | MIT | A Python CLI for spec-driven coding-agent workflows and reviewable handoffs |
| academic-research-skills | 59.6k | +694 | Python | — | Claude Code plugin for human-reviewed research, manuscript writing, and peer rev |
| claude-plugins-official | 49.1k | +611 | Python | Apache-2.0 | Claude Code’s official marketplace for installing plugins and curated skill bund |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/Maciek-roboblog/Claude-Code-Usage-Monitor.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about Claude-Code-Usage-Monitor
How should a status bar or script consume the monitor?
claude-monitor --statusline as a Claude Code statusline hook to capture official rate_limits. Have the consumer call claude-monitor --once --output json or read a file produced by --write-state. Check provenance and handle nonzero exit codes explicitly: a near-limit warning is not a command failure.What hardware does it need, and what drives runtime overhead?
Can we run it internally or redistribute it with a commercial tool?
When is this a better fit than the native statusline or a historical usage report?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy