Skip to main content
Glama

No proxy, no API key, nothing leaves your machine. Run it as a CLI, open the same report in your browser with tallybook --serve, or add tallybook-mcp to Claude Code or Codex and ask the agent itself what it's spending and what would be cheaper.

More in the documentation.

Install

brew install --cask magna-nz/tap/tallybook

Also available via go install github.com/magna-nz/tallybook/cmd/tallybook@latest, or as a release download. Works on macOS, Linux and Windows.

Add the MCP server so your agent can check its own spend mid-session — tallybook-mcp ships alongside tallybook, so no separate install:

claude mcp add tallybook -- tallybook-mcp   # Claude Code

For Codex, add it to ~/.codex/config.toml:

[mcp_servers.tallybook]
command = "tallybook-mcp"

Related MCP server: nikhilnt

Use

tallybook                         # this period's report: the five biggest findings
tallybook --serve                 # the same report, findings and sessions in your browser, on localhost
tallybook findings                # every finding, grouped by what kind of change it asks for
tallybook --since 7d --compare    # this week against last week: spend, sessions, cache hit rate
tallybook finding 1               # finding #1 in full: what happened, why, what to change
tallybook finding 1 --evidence    # the same, with the sessions behind it
tallybook finding 1 --patch       # finding #1's fix, as an applyable diff
tallybook agents                  # spend by sub-agent type, with the model and effort each ran at
tallybook sessions --sort cost    # sessions ranked by what they cost
tallybook changes                 # did a past model swap actually save money?
tallybook setup hook              # record sessions automatically as they end

Docs

The command reference, the MCP server's tools, configuration, and the privacy model live on the documentation site.

License

MIT

Available Tools

8 tools
agentsB
Read-onlyIdempotent

Spend per sub-agent type: runs, the model it mostly used, average cost per run, the share of runs whose tool calls were all read-only, errored tool results, and runs where the requested model differed from the one actually used.

Inputs: since, source, project, currency. Returns: plan, agents, currency, scan_error, +3 more

changesB
Read-onlyIdempotent

Every point where a sub-agent's model changed, with the real runs before and after compared and a verdict: keep, watch, revert, or too early. These are measured figures, not estimates.

Inputs: since, source, project, currency, +2 more. Returns: plan, changes, currency, min_runs, +5 more

findingA
Read-onlyIdempotent

One finding in full, addressed by its stable id from report: what happened, why it costs, what to change, what to expect, plus the evidence table and the patch if there is a file to change.

Inputs: id (required), since, source, project, +1 more. Returns: id, plan, patch, share, +14 more

pricesB
Read-onlyIdempotent

The price table every figure is computed from, in US dollars per million tokens, with the date it was last verified. Includes any overrides from the user's config.

Returns: unit, models, verified, scan_error, +2 more

refreshA
Idempotent

Rescan the transcript directories now instead of waiting for the automatic rescan, and report how many files were scanned, newly recorded, unchanged, or skipped. Only tallybook's own database is written.

Returns: errors, failed, scanned, ingested, +5 more

reportA
Read-onlyIdempotent

What the coding agents on this machine cost over a window: the total, the split by tool and by model, and the list of findings about what would have been cheaper. Call finding with an id from the list for the full advice.

Inputs: since, source, compare, project, +1 more. Returns: usd, plan, prior, turns, +17 more

sessionA
Read-onlyIdempotent

One session turn by turn: model, effort, token counts and cost per model response. Accepts a full session id or a unique prefix. Never returns prompt text, tool output, or command lines; the database does not hold them.

Inputs: id (required), currency. Returns: id, usd, plan, turns, +15 more

sessionsA
Read-onlyIdempotent

Sessions in the window with what each cost, sorted by cost or by time, most expensive or most recent first. Includes sub-agent runs as their own rows.

Inputs: sort, limit, since, source, +2 more. Returns: plan, total, currency, sessions, +4 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 8 tools

    Disambiguation4/5

    Each tool targets a distinct granularity: report (window summary), sessions (per-session list), session (single session detail), agents (per-agent-type rollup), changes (model-change points), finding (single finding), prices, and refresh. The analytics tools (report/sessions/agents/changes) overlap in domain and an agent must parse descriptions carefully to pick the right level, but boundaries are stated clearly enough.

    Naming Consistency4/5

    Seven tools are single lowercase nouns (finding, prices, agents, changes, session, report, sessions) with only refresh acting as a verb, so the set is mostly predictable despite lacking a verb_noun pattern. The session/sessions singular-plural pair is a minor readability risk but conventional.

    Tool Count5/5

    Eight tools is well-scoped for a cost-tracking server: one data-refresh action, one price reference, and a small hierarchy of correctly-sized analytics views. No tool feels redundant or bolted on.

    Completeness4/5

    The read/analytics surface is thorough (window totals, session and sub-agent breakdowns, change verdicts, drill-down findings, price reference, manual rescan). Minor gaps exist: no tool to set or edit the price/override config that 'prices' reads from, and no keyword search across findings.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Local-first dashboard + MCP server that parses Claude Code and Codex JSONL files into a SQLite cost / token tracker. Per-MCP and per-tool breakdown, session drill-down, dedup by request_id; never talks to vendor APIs
      5
      104 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables local-first tracking of AI token usage and costs from Claude Code and OpenCode, answering queries about tokens, models, sessions, and cost through MCP tools and a CLI, with no network calls.
      124 npm
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables analyzing coding-agent session transcripts to measure tool efficiency, detect loops, track test outcomes, and report costs, with MCP tools for listing sessions, analyzing sessions, finding loops, and generating cost reports.
      4
      MIT