All shelves / Mods / Usage
token-ledger
By Arunjay4213
token-ledger is a Claude Code usage mod by Arunjay4213.
Pins this session's cost and the last turn's tokens and cache hit, and /ledger lists each turn.
Draws
Install
The marketplace name is claude-mods.
claude plugin marketplace add Arunjay4213/claude-mods claude plugin install token-ledger@claude-mods
It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.
- Version
- 0.1.0
- Repo stars
- 9
- Last change
- 2026-10-16
What it can reach
- Draws in the session
- Reads usage or context figures
Needs Claude Code 2.1.269 or newer, in an interactive terminal. Restart Claude Code. The README turns function hooks on by setting CLAUDE_CODE_ENABLE_FUNCTION_HOOKS to 1 under env in ~/.claude/settings.json; the official docs say 2.1.287 and later ignore that flag. A status line updates when each turn ends: the session cost, the last turn's cost, tokens in and out, and the cache hit. A figure the engine does not have is left out, so the line gets shorter instead of showing a zero. On this line, in counts fresh input, cache reads, and cache writes together, and cache is the share that came from the cache. /ledger opens a pane with one row per turn, newest first. Run it again to close it. In the pane, in is the uncached input alone. The ledger does not price tokens itself. It reports the session total the engine has already priced, and a turn's cost is the change between two readings. If the engine reports no cost, the cost column shows a dash and the status line drops the dollar figures. The first reading is at session start, so a turn is priced once there is a baseline. A subagent's cost lands on the subagent's row, marked and drawn dim, and the main turn's row shows what was left. It keeps the last 200 turns, so /ledger keeps the history after /resume, and a new session starts empty. The pane draws the newest 40 rows and counts the rest in the totals. From 110 columns it docks beside the transcript. Narrower, it sits above the prompt. When the pane is too narrow, columns are dropped in order and cost always stays. A checkout starts with CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude --plugin-dir plugins/token-ledger.
The marketplace name is claude-mods. The same marketplace also lists context-lens, quota-meter, and budget-guard. This page installs token-ledger. usage-meter draws the 5-hour and 7-day limits with what this session cost. cost-meter draws session cost, context fill, the plan windows, and what each turn cost, and a budget, off until you set one, asks before the next tool call. This pane is one row per turn, with cache reads and writes, and it does not ask before a tool call. The dollar figures are the engine's own, so this page does not list network access.
Demo

What it hooks into
session.startWhen a session startsturn.completeWhen a turn endscommand.runWhen you run its slash command/clear/resume/ledgerui.closeWhen its pane closesui.renderDraws into the sessionPane
Read from the on() calls in its hook modules. Open its source under Files to check what each one does.
Slash commands 1
/ledgerWhat each turn cost: tokens, cache, time and dollars
Files
The author's README and source, 4 files. They load when you open them.
Facts
- Author
- Arunjay4213
- Category
- Usage
- Marketplace
- claude-mods
- Folder
- plugins/token-ledger
- Version
- 0.1.0
- Repo stars
- 9
- Last change
- 2026-10-16
- Language
- TypeScript
- Files
- 6
