ClaudeCodeMod

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.

In your shell
claude plugin marketplace add Arunjay4213/claude-mods
claude plugin install token-ledger@claude-mods
Open the repo

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

The ledger pane: two turns, a totals row, session total 0.4803 dollars, and a pinned line with the session cost, the last turn, 46k in, 5 out, and cache 75 percent
From the author's repo.

What it hooks into

  • session.startWhen a session starts
  • turn.completeWhen a turn ends
  • command.runWhen you run its slash command/clear/resume/ledger
  • ui.closeWhen its pane closes
  • ui.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
Repo
Arunjay4213/claude-mods
Folder
plugins/token-ledger
Version
0.1.0
Repo stars
9
Last change
2026-10-16
Language
TypeScript
Files
6

Other mods in Usage

mod-packaz9713Holds a commandSeven mods in one install: a context forecast, a cache countdown, a follow-up queue, a plain retell, two holds on risky commands, and Snake.taxi-meterdevbrother2024Draws this session's cost as a taxi fare, in won at API list price, with context fill and the plan limits.agent-routeralexandernicholsonHolds a commandAssigns a model and effort to each subagent role from your endpoint's catalog, and draws that model beside the prompt.keepalivealexandernicholsonDraws a prompt-cache bar for each conversation, and can keep an idle cache warm or compact it before it expires.hudhoobnnDraws model, context, and plan-usage gauges above the prompt, with git, the running tools, and a one-line task summary.limits-meterice-lfernandesDraws plan limits and context above the prompt, in tokens and percent, with the model, effort, and a toast on a costly switch.elizabeth-progressYaxin9LuoDraws Elizabeth from Gintama walking a context-window bar above the prompt, with the usage split, turns left, and rate limits.spending-effort-with-jevYaxin9LuoAsks TypeSafe's Jev which /effort level a message needs, sends that message to api.typesafe.ai, and switches on your OK.cache-paneldanyuchnAfter 50 idle minutes, draws a prompt-cache line and a panel to keep it warm, ping it once, or compact, with a cost for each.context-cardNongfsqDraws context fill, the prompt cache, and weekly plan usage in one line above the prompt, with a breakdown on click. One of two mods for running many sessions.statuslineryanclarkDraws context, the 5-hour and 7-day limits, and extra usage under the prompt, from statusline, a status-line binary you install first.usage-headerSzotaszDraws the context window above the prompt, a color per category, with the 5-hour and weekly limits under it.
All 183 in Usage