Claude Usage TUI
An independent, local-only terminal viewer for Claude Code token activity. It draws daily, weekly, and cumulative graphs and always reports how much of the calendar is backed by exact turns versus historical aggregate allocation.
Install
With uv:
uv tool install claude-usage-tui
Or with pipx:
pipx install claude-usage-tui
For development, install from a checkout:
uv tool install .
The runtime uses only the Python standard library and sends no data anywhere.
Use
# Open the interactive daily graph
claude-usage
# Open a particular view
claude-usage weekly
claude-usage cumulative
# Compatibility with the earlier prototype
claude-usage usage daily
# Show exactly how much is observed and reconstructed
claude-usage audit
# Refresh only the local JSONL index
claude-usage scan
Inside the TUI, use the arrow keys or d, w, and c to change views. Press
q to exit. Add --once --no-color for a non-interactive plain-text render.
Where the numbers come from
The tool never queries Anthropic and does not scrape CodexBar. It reads files already maintained on your machine:
| Source | Owner | Used for | Accuracy |
|---|---|---|---|
~/.claude/projects/**/*.jsonl |
Claude Code | Per-turn timestamp, model, input/output and cache tokens | Exact for records that still exist when indexed |
~/.claude/usage-tui.db |
This tool | Incremental, durable index of the exact JSONL fields above | Exact copy of parsed token records |
~/.claude/stats-cache.json |
Claude Code | Retained model totals and per-day direct-token activity | Real local aggregate; may outlive original transcripts |
The index deliberately retains already parsed turns if Claude Code later removes their JSONL file. It contains token metadata only, not prompts, responses, filenames from source code, or transcript content.
Exact versus reconstructed
For each model, the tool first sums exact indexed turns. If Claude's local
modelUsage total is larger, the difference is known to exist but its original
cache-token timestamps are no longer available. The tool distributes only that
difference across Claude's retained dailyModelTokens activity dates.
Consequently:
Lifetimereconciles to the newest available local per-model total.- Exact JSONL dates keep their exact token counts.
- Historical daily, weekly, peak, and streak values are approximate wherever
an aggregate-only difference exists; the TUI marks these with
≈. claude-usage auditprints exact and allocated totals globally and per model.- Missing dates cannot be invented. If neither JSONL nor
stats-cache.jsoncovers a period, the tool has no evidence for that period.
This is token activity, including cache reads and cache creation. It is not the percentage of a Claude subscription quota, an Anthropic invoice, or a server-authoritative account history. Subscription windows and dynamic limits are not present in these local history files.
Privacy and storage
- All parsing and rendering happens locally.
- There are no runtime dependencies, telemetry, network requests, or API keys.
- The database defaults to
~/.claude/usage-tui.dband can be overridden withCLAUDE_USAGE_TUI_DBor--db. CLAUDE_STATS_CACHEcan point at a different stats cache.- Use
--projects-dir PATHto scan one non-default transcript directory.
Project scope and provenance
This is a focused implementation containing only:
- a minimal incremental JSONL collector;
- source reconciliation and accuracy reporting;
- the terminal renderer and command dispatcher;
- tests and packaging.
It does not include the browser dashboard, pricing model, Docker setup, VS Code
extension, or general session analytics from
phuryn/claude-usage. That project
informed the early prototype and is credited, with its MIT notice, in
THIRD_PARTY_NOTICES.md. The visual presentation is
inspired by the Codex token activity interface; no Codex source or assets are
included.
Development
python3 -m unittest discover -s tests -v
python3 -m py_compile cli.py collector.py usage_tui.py
Releases use PyPI Trusted Publishing: a signed vX.Y.Z tag must exactly match
collector.VERSION. GitHub Actions tests and builds the distributions, uploads
them to PyPI through short-lived OIDC credentials, and then creates the GitHub
Release. See RELEASING.md.
License
MIT © 2026 Ivan Oparin. See LICENSE and
THIRD_PARTY_NOTICES.md.
Metadata
Release files for claude-usage-tui 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| claude_usage_tui-0.1.0.tar.gz | 16.4 kB | With provenance | Details for claude_usage_tui-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| claude_usage_tui-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for claude_usage_tui-0.1.0-py3-none-any.whl |
Total release size: 33.3 kB
Release files / claude_usage_tui-0.1.0.tar.gz
| Download URL | claude_usage_tui-0.1.0.tar.gz |
|---|---|
| Size | 16.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b5692406db5effbdfcd7254faef3207980df53a4ceb4a5638758217fa77acd1e
|
|
BLAKE2b-256 checksum How to use checksums |
43247df156bf208a0245b606f1d8bed3a4bf10e15245f73c10fe384dd984d8b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / claude_usage_tui-0.1.0-py3-none-any.whl
| Download URL | claude_usage_tui-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3aca8c4c270361b2cbdf8803133c367abcb7ce72992441d4d8b8baa1a3d87d99
|
|
BLAKE2b-256 checksum How to use checksums |
9719b8002106bc81a4335c5552eeb42f4815f0312ef2547a124f9a750d06f9d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logSecurity for claude-usage-tui 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for claude_usage_tui-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.