# Repository Briefing: Maciek-roboblog/Claude-Code-Usage-Monitor
> Source: https://repoforai.com/repo/Maciek-roboblog/Claude-Code-Usage-Monitor (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: B (63/100 · Maintenance 12/35 · Adoption 17/25 · Releases 14/20 · License 20/20)
- **Latest Release**: v4.0.0 (2026-06-27) — https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: CLI
- **Momentum**: 8,827 ★ total (+2 24h / +10 7d) · 466 forks
- **Topics**: `ai`, `analytics`, `claude`, `claude-code`, `claude-usage`, `limits`, `monitoring`, `terminal`, `usage-tracking`
- **When to Use**: Best for: Heavy Claude Code users and workstation tooling that need limit warnings, local usage history, or provenance-aware JSON snapshots for scripts and status bars. Skip if: The native statusline already answers your questions, or you need an authoritative cross-account billing ledger or centralized quota enforcement.

## Overview
```text
### Architecture & 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.
```

## Key Capabilities
```text
- Source precedence: Fresh statusline `rate_limits` take priority; stale or expired captures fall back to labeled local estimates.
- Snapshot contract: Rich output, `--once`, `--compact`, and `--write-state` use a shared, versioned snapshot.
- Automation: `--once` distinguishes OK (0), near limit (10), limit hit (11), indeterminate or no active session (20), and no data or configuration error (30).
- History: The opt-in warehouse retains project, model, and day dimensions beyond Claude's 30-day cleanup, with CSV and JSON reports.
- Source isolation: `--data-paths`, `CLAUDE_CONFIG_DIR`, and WSL discovery support multiple data directories without merging unrelated accounts into one five-hour window.
- Model coverage: The v4.0.0 distribution bar includes Sonnet, Opus, Haiku, and an Other bucket; `--filter-models anthropic` excludes routed non-Claude models.
```

## Quick Start / Clone
```bash
# Install directly from PyPI with uv (easiest)
uv tool install claude-monitor

# Run from anywhere
claude-monitor  # or cmonitor, ccmonitor for short
```
