Repository navigation
Releases
Releases · peterwkdev-creator/claude-context-cost
v1.7.0
- A folder sum counts each response once: a resumed or forked session
repeats the responses it came from in its own file, and those were counted
twice. Its line says how many were already counted;--jsonadds
"repeated". - A response with no
message.idcounts: its request id, its line'suuid
or its line number takes the id's place. Before, only the first of them
counted. - A file in a format this version does not know (no
type, or assistant
lines with nousage.input_tokens) prints a warning, instead of counting
zero in silence. A field of the wrong type is skipped, not a traceback. --budgetlists a rule orCLAUDE.mdthat is a link to a file outside
the repository, and does not read it.--versionsruns git withcore.fsmonitoroff, and looks up only
absolute local paths: a relative path read another repository from the
current folder, and a UNC path (//host/share) reached another machine.
README and SECURITY say to read only your own transcripts with it.- Tests for a cut last line, an empty file, bytes that are not UTF-8,
git
missing from thePATHand a repository with no commit. - A folder of many projects is summed faster, with the same output.
- The demo page source (
vitrine/montar.py, its test andindex.html) is
in English.
v1.6.4
- The demo page build also rejects an empty or non-text title, description
or language, builds the page before creating the output folder, and keeps
CRLF line endings in the HTML. - The Pages workflow jobs stop after 10 minutes.
- No change in the library.
v1.6.3
- The demo page is built with its language (English), title and description
in the HTML itself, so screen readers and search engines get them before
any script runs. No change in the library.
v1.6.2
- A file with no responses (not a transcript, or the wrong file) prints what
to give instead and exits with 1, instead of an empty table. - A folder given as the budget file, or a file that cannot be read, is an
error message with exit code 2, not a traceback. --examplewith a path and--budget --quiet --jsonare errors instead of
silently ignoring an option.- Clearer output: the legend says what
unattributedis;--versionssays
tokensis of one load; the bytes-per-token line and theskippedline
say what they mean. - README: a shorter start (what it is, try it in a minute); "as Claude Code
loads it" instead of "renders"; where a relative budget path starts. - Issue templates, the pull request template and CONTRIBUTING agree on where
a missing case goes;claude-context-cost --versionin the templates.
v1.6.1
- README: badges for the PyPI version, the Python versions and the license,
beside the tests badge, so PyPI shows them too.
v1.6.0
From a first use in another project's git hook:
--budget --quiet: only the verdict and the limits exceeded, for a hook.--budgetnames the repository it measured, and says what a session also
loads that it does not count: your~/.claude/CLAUDE.md, memory and any
CLAUDE.mdabove the repository. The README says which folder is measured
and where the budget file's path starts.- The
howcolumn widens when a source has three ways, so thesource
column stays aligned.
v1.5.1
- Clearer output: the legend explains every column (
share,in,chars/4,
error,how) and everytodayvalue of--versions;--stepssays
"start of the session or after a compaction" instead of "segment start". --helpends with examples, where the transcripts are and a link to the
README; error messages say what to give instead.- The README explains each kind of source and each
how. - PyPI links as on GitHub: Homepage is the page, Source the repository.
v1.5.0
--versions: for one transcript, which git commit of eachCLAUDE.md,
rule and memory file the session loaded (the newest commit before the load
with exactly that text, or the first one after it, marked(later)), and
how today's file differs. Git is only read.--jsonaddsversions;
loaded_versionsandVersionin the API.- On the author's machine: of 2,863 distinct texts loaded, only 290 are the
same on disk today; 811 were in git and the commit was found for 798 (the
other 13 were never committed); none of the 212 texts equal today and in
HEADwas missed (tests/test_corpus.py). - Budget fixes:
nanandinfare not a ratio or a limit; a budget file
that is missing or not UTF-8 exits with 2 and a message, not a traceback;
every message names the budget file; an unquoted dotted pattern
(CLAUDE.md = 1) is named whole; an import inside a~~~block is not
followed; a Windows junction is not followed;--budget ""is an error. - Clearer output: "2 limits exceeded" instead of "passed", and a space after
theloadedcolumn. - The README's links, section links and image are absolute, so they work on
PyPI too, and it shows the CI badge; the PyPI page links the demo and this
changelog, and its description and keywords are the GitHub About and topics. SECURITY.md: how to report a vulnerability privately, and what the tool
does not do (no network, no writes). The CI's actions are pinned by commit.- Mutation: 51 mutants (24 in the budget, 10 in
--versions); the tests
catch all 51.
Install: pip install claude-context-cost==1.5.0
v1.4.0
- Context budget for CI:
claude-context-cost --budget context-budget.toml [repository]measures everyCLAUDE.md, rule and@importClaude Code
loads from a repository, as Claude Code renders them, and exits with 1 when
a declared limit is passed (per file by glob pattern, and for the start-up
total), with 2 when the budget file is invalid.--jsonworks with it. check_budget,BudgetandBudgetErrorin the API.- On the author's machine the files found are the ones Claude Code loaded in
257 of 257 start-ups and 252 of 252 on-demand loads, with the same bytes in
268 of 268 files (tests/test_corpus.py). - Mutation: 36 mutants, 19 of them in the budget; the tests catch all 36.
- CI checks the budget through the installed package too.
v1.3.1
- Published on PyPI:
pip install claude-context-cost. Each Release publishes
through trusted publishing (OIDC), with no stored token, after the tests and
a check of the installed package. - CI builds the package on every push, installs the wheel outside the checkout
and runs the README example through the command and the API. - No change in the library.