spend-ledger
Reviewed
at commit c901585
Sends data to Your configured Svod MCP server, only when one is connected
Per-project token and cost ledger per machine; /spend; monthly note in Svod, with other machines pulled over ssh.
0 upvotes
Log in to upvote or save- Made by
- escapeboy
- Pinned commit
-
c901585b71d685112047e38bc069a9d0c537307f - What we checked
-
Records tokens and cost per project and model after every turn, keeps them in the mod's store and in ~/.claude/spend-ledger/<month>.json, and shows them with /spend. If a Svod MCP server is connected it also writes a monthly note there, and if you list remote machines it reads their ledger files over ssh. The ledger holds project paths, model names and usage figures, no prompts or code.
Review details
Static review of the source at the pinned commit; not run. Registers session.start (runs `hostname -s`, registers /spend, probes the configured Svod MCP server with a read call and, if it answers, starts a 6-hour timer), turn.complete (main loop only: adds usage and cost delta to $.store and rewrites ~/.claude/spend-ledger/<YYYY-MM>.json using $.fs.write when HOME is set), session.end (syncs to Svod when connected) and command.run for spend (day, week, month or sync). Sync calls $.mcp.call on the server named in the svod_server option (default 'svod') to read and write a note at note_dir/<month>.md, and for each ssh alias in the remote_hosts option (empty by default) runs `ssh -o ConnectTimeout=8 -o BatchMode=yes <alias> cat ~/.claude/spend-ledger/<month>.json`, parsing the JSON it gets back. The only network paths are that MCP server and the user's own ssh aliases; no other hosts. The ledger includes the working directory of each session with HOME replaced by ~. Defaults (vault 'personal', Bulgarian table labels, 'Svod') come from the author's setup but are configurable and optional. Failures in the turn handler are swallowed. npm dependencies: none.
- What it uses
-
- Reads your prompts: no
- Sees tool calls: no
- Blocks or changes tool calls: no
- Reads or writes files: yes
- Runs programs on your machine: yes
- Calls the model (uses tokens): no
- Sends data over the network: yes
- Stores data: yes
- Shows something on screen: yes
- Hooked events
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/spend-ledger/)