Files
Michael ValderramaandMichael Valderrama 5c44615e78 fix(cost-tracker): count each Claude Code response once in track and session (#4688)
* fix(cost-tracker): count each Claude Code response once in track and session

Claude Code writes one assistant line per content block and repeats the response's usage on each, so summing lines counts a response once per block. Key responses by message.id + requestId, as _ledger.mjs already does, and price each once.

* chore(cost-tracker): bump to 0.31.1; use a counter in the test fixture

The double-count fix changes shipped scripts, so the plugin version rises for installed copies to pick it up. The fixture's uuid no longer uses Math.random, which CodeQL flagged.

---------

Co-authored-by: Michael Valderrama <17348490+ibucketbranch@users.noreply.github.com>
2026-11-04 17:49:00 -06:00
..