ClaudeCodeMod

All shelves / Mods / Usage

cost-ledger

By FynnXland

cost-ledger is a Claude Code usage mod by FynnXland.

Keeps a ledger of what every chat cost, plus other mods' model calls, and draws /ledger: today, 7 and 30 days, projects, top chats, models, and plan limits.

Draws

Install

The marketplace name is fynn-mods.

In your shell
claude plugin marketplace add FynnXland/fynn-mods
claude plugin install cost-ledger@fynn-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.7.0
License
MIT
Repo stars
4
Last change
2026-10-19

What it can reach

  • Draws in the session
  • Reads usage or context figures

Requires Claude Code v2.1.271 or later; tested with v2.1.295. Inside a session: /plugin marketplace add FynnXland/fynn-mods and /plugin install cost-ledger@fynn-mods. It loads in the next session, or after /reload-plugins. Set your plan and billing day once with /ledger plan, since Claude Code does not tell mods your plan. Amounts are API values; on a subscription they count toward your limits, not a bill. /ledger sync shares the ledger between computers through a folder you name.

The marketplace, fynn-mods, holds FynnXland's six mods; each installs on its own. Spend across all your chats is why this page files it under usage. leaks ranks the avoidable spend in the last 7 days of transcripts. cost-meter draws session cost and the plan windows on the status line, with an optional budget. This one books each chat's /cost after every answer, adds the model calls other mods make, and splits the total by day or week, project, chat, and model, with each 5-hour window's API value and your month against the plan price. It touches files only in the sync folder you set. In the source, /ledger is a CommandOutput render.

Demo

The author's screenshot of cost-ledger's /ledger overview in the desktop app, with German labels: totals for today, 7 days, 30 days, and all time, each $14.44 over 17 chats with $0.23 from mods; a 14-day history with one day's bar split by model, Opus 5.5 and Haiku 4.5; costs per project; the five most expensive chats; and the model calls of other mods, quick-replies $0.16 and sidekick $0.07. The figures are the author's.
From the author's repo.

What it hooks into

  • session.startWhen a session starts
  • classic.SessionStartA Claude Code event
  • classic.UserPromptSubmitA Claude Code event
  • turn.completeWhen a turn ends
  • model.completeA Claude Code event
  • model.forkA Claude Code event
  • model.classifyA Claude Code event
  • session.endWhen a session ends
  • command.runWhen you run its slash command/ledger
  • ui.renderDraws into the session

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Slash commands 1

  • /ledger

Files

The author's README and source, 8 files. They load when you open them.

Facts

Author
FynnXland
Category
Usage
Marketplace
fynn-mods
Repo
FynnXland/fynn-mods
Folder
mods/cost-ledger
Version
0.7.0
License
MIT
Repo stars
4
Last change
2026-10-19
Language
TypeScript
Files
11

Other mods in Usage

limit-barsFynnXlandDraws the 5-hour and weekly limits as two slim bars above the prompt, a ring for how long the prompt cache stays warm, and asks before a costly cold send.claude-loadGerruxOpens a /load pane of CPU and memory per Claude Code session, with orphaned dev servers you can end, and draws a load line above the prompt under high load.smart-compacthellosverreOffers /compact in a dialog above the prompt at good moments: after a commit, when tests go green, before the prompt cache expires, or when Claude asks.tideHula-Hoop-AIDraws the context window as a tide above the prompt: a fill bar by phase, a sparkline of recent turns, the rise per turn, and turns left before compaction.cache-ttl-statuslineJerrettDavisDraws session, plan-limit, and Headroom lines with model, cost, context, and a cache TTL that turns yellow then red, below the prompt or, in mod mode, above it.usage-meterLeeHigma0201Shows context fill, the 5-hour and 7-day plan windows, and session cost on the status line, and toasts when a plan window crosses 80% and 95%.subagent-meterNarenDawarShows on the status line how many subagents ran, their share of output tokens and of all tokens, and the agent type that used the most.usage-weatherptpmediabrDraws one line above the prompt with the context as a weather icon, the 5-hour and weekly limits with resets, cache warmth, and a Clear & continue button.am-context-barromnycristopherDraws a card above the prompt with context use against where quality drops, what fills it, turns left, limits, git status, and the phase of a plan you're on.compactlyswapnildahiphaleOpens a cost and cache pane with each turn's cost and when the cache goes cold, and compacts at a natural break a Sonnet judge picks, with a handoff summary.cache-meterT-AI-LabsDraws one row above the prompt with how much of the last turn the prompt cache served, how long it stays warm, and a Keep warm switch that refreshes it.context-meterT-AI-LabsDraws one row above the prompt with the context fill against an auto-compact threshold you pick, and Compact and Clear buttons.
All 183 in Usage