token-ledger
Reviewed
at commit 6de1b69
A pinned line with session cost, last-turn tokens and cache hit ratio, plus /ledger for the table.
0 upvotes
Log in to upvote or save- Made by
- Arunjay
- Pinned commit
-
6de1b69a555a412aea7b9a374ad6c0de7e47ac4e - What we checked
-
Pins a status line under the prompt with the session cost, the last turn's token counts and the cache hit ratio, and adds /ledger, which opens a pane with a table of recent turns. It reads only the usage figures Claude Code reports, makes no network calls, runs no programs and keeps the table in the plugin's own store.
Review details
Static review of the source at the pinned commit; not run. Registers session.start, turn.complete, command.run (clear, resume, ledger), ui.close and ui.render (Pane) handlers. Uses $.session.usage, $.session.id, $.store.get and $.store.set (up to 200 rows of token counts, model name, duration and cost, keyed by session id), $.command.register for /ledger, $.ui.status, $.ui.open, $.ui.close, $.ui.invalidate and $.ui.log. Per-turn cost is the difference between two session cost readings, with no pricing table. It never reads prompts, tool calls, files or environment variables, and has no fetch, process or file calls. Every runtime call is wrapped in try/catch so failures only leave the display empty. Two local files: register.tsx and format.ts, with no npm dependencies.
- What it uses
-
- Reads your prompts: no
- Sees tool calls: no
- Blocks or changes tool calls: no
- Reads or writes files: no
- Runs programs on your machine: no
- Calls the model (uses tokens): no
- Sends data over the network: no
- Stores data: yes
- Shows something on screen: yes
- Hooked events
A per-turn cost and token ledger: a pinned status line with the session cost, the last turn's tokens and the cache hit ratio, and /ledger for a table of the recent turns with their model, tokens, cache reads and writes, duration and cost.
Made this mod? Add a badge to your README
Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.
[](https://modsforclaude.com/mods/token-ledger/)