claude-calc
See what your Claude Code sessions would cost at pay-per-token API rates.
It reads the session logs Claude Code keeps in ~/.claude/projects, prices
every API message, and shows the result in a local dashboard: spend over time,
cost per model split by token type, and projects you can expand down to
individual sessions.
Install
pipx install claude-calc
or pip install claude-calc. Python 3.9 or newer, no other dependencies.
Use
claude-calc
Starts the dashboard on http://localhost:8765 and opens it in your browser. Logs are rescanned on every page load and on the Rescan button.
claude-calc report
Prints a plain-text summary instead.
Options:
| Flag | Meaning |
|---|---|
--port 9000 |
serve on a different port |
--no-browser |
don't open a browser tab |
--projects-dir DIR |
read logs from somewhere other than ~/.claude/projects |
Pricing
Rates are $/MTok in PRICES inside claude_calc/costlib.py, as
(input, output, cache_read, cache_write_5m, cache_write_1h). Messages are
deduplicated by API message id, and cache writes are billed at the 5-minute
or 1-hour rate depending on which the message used. Models with no rate are
skipped and listed at the bottom of the page.
Develop
git clone https://github.com/hibrahem/claude-calc
cd claude-calc
python3 -m claude_calc.cli
Releases publish to PyPI from GitHub Actions when a v* tag is pushed.
Release files for claude-calc 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 | |
|---|---|---|---|
| claude_calc-0.1.0.tar.gz | 85.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| claude_calc-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 171.6 kB
Release files / claude_calc-0.1.0.tar.gz
| Download URL | claude_calc-0.1.0.tar.gz |
|---|---|
| Size | 85.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4b7314b21cbde7bc16f0daa7ec2384760e3a894170127e7f210752aaf6ea24f
|
|
BLAKE2b-256 checksum How to use checksums |
fc864bffc49134b1f8e4f1dfe4ed8f048523593c703a3d8fa0ca1bd7aced7b60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 11, 2026.
Transparency logRelease files / claude_calc-0.1.0-py3-none-any.whl
| Download URL | claude_calc-0.1.0-py3-none-any.whl |
|---|---|
| Size | 86.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00e1fb74d8e49cc5c97e3a5a4b4a734ad79e36d3ba59368030e497af84e183a6
|
|
BLAKE2b-256 checksum How to use checksums |
974f7e4e89204130262c943754ef9f7a430914393aeb9539bbc3a2d0186f7faa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 11, 2026.
Transparency log