Skip to main content

contexttax

Where your Claude Code usage actually goes.

Most of it isn't loops or re-reads. It's long conversations. Every turn sends the whole conversation again, so a session at 500k tokens pays for all of it on every message.

uvx contexttax

No install with uv. Or, with plain Python 3:

curl -fsSL https://raw.githubusercontent.com/theadamdanielsson/contexttax/main/contexttax.py | python3 -

What it shows

My last 26 days:

contexttax output: 76% of usage went to turns over 200k context; the biggest 10% of sessions used 90%

Private by design

It reads the logs Claude Code already keeps in ~/.claude/projects. It prints numbers only. It sends nothing anywhere and writes nothing. One file, standard library only, so you can read all of it first.

How it counts

Usage is weighted by API prices, the closest public stand-in for how plan limits are counted. Per model: Opus 5, Sonnet 3, Haiku 1. Within a model: input 1, cache write 1.25 (5-minute) or 2 (1-hour), cache read 0.1, output 5. Plan limits aren't published, so treat the shares as close, not exact.

The fresh-start saving assumes each turn past 200k would instead carry a 20k summary. It ignores what a summary leaves out.

Options

contexttax --days 7     # last week
contexttax --days 0     # everything in the logs
contexttax --json       # the numbers as JSON
contexttax --share      # a few lines to paste anywhere

Share yours

contexttax --share prints a few lines you can paste anywhere:

76% of my Claude Code usage went to turns where the conversation was already past 200k tokens.
My biggest 10% of sessions used 90%.
Re-reads, loops and huge tool outputs barely registered.
Find yours: uvx contexttax

If your numbers look different from mine, I'd like to see them. Open an issue with the output.

MIT licence.

Metadata

Release files for contexttax 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for contexttax 0.1.1
File Size Uploaded Provenance Actions
contexttax-0.1.1.tar.gz 8.0 kB Without provenance Details for contexttax-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for contexttax 0.1.1
File Interpreter ABI Platform Actions
contexttax-0.1.1-py3-none-any.whl Python 3 none any Details for contexttax-0.1.1-py3-none-any.whl

Total release size: 15.7 kB

Release files / contexttax-0.1.1.tar.gz

Download URL contexttax-0.1.1.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bfba312af603c103458c6095bb61accb9e1365724b9a18e655a67b8e0c2eb384
BLAKE2b-256 checksum
How to use checksums
5981ddef94a76f04d2f6b8ec66a801b7062f6b047de7a34a252ab62075b9acc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / contexttax-0.1.1-py3-none-any.whl

Download URL contexttax-0.1.1-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a02316ef686c49e566f70320e631a2507a58e2872909fbf7f3a77094afd7706
BLAKE2b-256 checksum
How to use checksums
05961a6b1f678aa83dfc7322606c356b8e9ef1887576d617a97e22447d54a30d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for contexttax 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page