Stop eating your clients' AI costs.
Tallyhook reads the session logs Claude Code and Codex already write, tags every session with the client it was for, and gives you an invoice line. One command per laptop. Nothing else changes.
From $49 a month flat, not per seat. No card to start. Only metadata leaves the laptop, never code or transcripts, and the collector is open source. How it works
northwind/storefront
See cost per client, not per seat.
Every session lands under the client whose repo it ran in. Developer, model, tokens and list price, for any date range.
Bill it back, with markup.
Export invoice lines as CSV, per client, per month, with the markup you set. Drops into Xero, QuickBooks or a spreadsheet — or send the client a read-only report link directly, no export needed.
Catch the expensive session today.
Our most expensive single session has passed $390: one conversation, resumed across nine days, still open. Not a runaway loop, just work nobody priced until the month ended. In Tallyhook that is one row with a price on it, the same day. Set a dollar threshold and you'll get an email the moment one crosses it, and a monthly budget per client so a retainer never overruns quietly.
Your vendor dashboards count by user and by model. Never by client.
On a subscription seat there is not even a dollar figure. So the cost gets absorbed, or guessed, or billed as a flat fee that is wrong in both directions.
- Claude Team and Console
- Usage and estimated spend per user and per model. Nothing per repo or per client, and no dollar figure for usage inside a seat.
- Cursor
- Team analytics count AI-written lines per repo and usage per user. No cost per repo or client.
- OpenAI / Codex
- Workspace analytics show usage per user and per model. Nothing per repo or client.
- One Max seat, 8 weeks to 29 Sep
- $4,054 of list-price usage across 740 sessions. The dashboard could not say what any of it was for.
Three steps. After that it runs on its own.
- 01
Run one command on each laptop
It registers a Claude Code hook and reads the session logs Claude Code and Codex already keep. History uploads on the spot, so you see real numbers before you finish reading this page.
Terminal$# output tallyhook: installed to ~/.tallyhook/tallyhook.js ✓ Claude Code hooks registered (SessionEnd, Stop) ✓ uploaded 312 sessions as maya@agency.dev
- 02
Pick a client for each repo, once
Sessions arrive tagged with their git remote. Choose the client from a dropdown and every past and future session from that repo follows.
Repos without a clientgithub.com/northwind/storefront→ Northwindgithub.com/acme/patient-portal→ Acme Healthgithub.com/bluebird/iosPick a clientChoosing a client saves instantly and re-tags every earlier session from that repo.
- 03
Export the invoice line
Cost by client, developer and model for any month, with your markup applied. A CSV that drops into whatever you invoice from.
northwind-invoice-2026-09.csvLine Sessions List Billable maya@agency.dev 38 $412.30 $494.76 tomas@agency.dev 21 $188.12 $225.74 Claude Sonnet 5 1,204 $551.02 $661.22 AI agent usage, September 59 $600.42 $720.50
# output tallyhook: installed to ~/.tallyhook/tallyhook.js ✓ Claude Code hooks registered (SessionEnd, Stop) ✓ uploaded 312 sessions as maya@agency.dev
Session metadata leaves the laptop. The work never does.
- Tokens by model, cache reads and writes split
- Start and end time, tool and version
- Git remote and branch, and which repos the edited files belong to
- Developer identity from git config, and the machine hostname
- Turn count and tool-call counts
- Paths of files edited
- First 160 characters of the first prompt (optional)
- Transcripts and every later prompt
- Code, diffs, file contents
- Tool output and command results
- Environment variables and secrets
The collector is open source (MIT): one dependency-free file, about 1,019 lines. Read it before you run it on GitHub, or get it from npm.
Or try it with no account at all. This groups your repos into the clients you bill, applies your markup and prints cost beside the billable figure, uploading nothing:
npx tallyhook clients add "Northwind" northwind --rate 20 npx tallyhook --by client
Flat per workspace. Pays for itself on the first invoice.
Unlimited clients, repos and sessions on both plans. Fourteen days free, no card until you decide.
| Team | Agency | |
|---|---|---|
| Per month | $49 | $149 |
| Developers running the collector | up to 5 | up to 20 |
| More than 20 developers | — | +$7/seat/month, any time |
| Collectors | Claude Code, Codex | Claude Code, Codex |
| Exports | Invoice and session CSV | Invoice and session CSV |
| Alerts and client budgets | Yes | Yes |
| Client report links | Yes | Yes |
| Price overrides | Yes | Yes |
| Start free | Start free |
Costs are list-price equivalents from each vendor's public API pricing. On a subscription (Claude Max, Team, ChatGPT Pro) that is the value of what your team used, not a bill you received. The app says so wherever a number appears.
Only developers who install the collector count toward the seat limit. Anyone else on the team can sign in and view every client, session and invoice for free.
Questions
What is Tallyhook?+
A cost ledger for teams that use AI coding agents. A small collector on each developer's machine reads the session logs Claude Code and Codex CLI already write, uploads per-session metadata (tokens by model, repo, branch, developer, timing), and Tallyhook prices each session at the vendor's public list rate, assigns it to a client by git remote, and produces invoice lines with your markup.
Who is it for?+
Dev agencies, consultancies and small product teams (roughly 2 to 50 developers) that use Claude Code or Codex and need to know which client or project the AI spend belongs to, usually so they can bill it back or price fixed-fee work correctly.
How is this different from Anthropic's or OpenAI's own usage dashboards?+
Vendor dashboards report usage per user and per model. None of them know which client a repo belongs to, and usage inside a subscription seat has no dollar figure at all. Tallyhook attributes every session to a repo and a client, prices it at list rates, and exports invoice lines.
Is this just ccusage with a login?+
ccusage is an excellent open-source CLI for one machine and was the reference for token counting. Tallyhook is the team layer on top of the same local logs: every developer's sessions in one place, mapped to clients, with cost alerts, client budgets, shareable client reports and invoice output. If you work solo and don't bill clients, ccusage is enough.
How accurate is the cost?+
Tokens come from the vendor's own session logs, deduplicated per message (including messages that forked subagents copy from the parent session). Prices are the public API rates per model, including cache reads, 5-minute cache writes at 1.25x input and 1-hour cache writes at 2x input. Claude fast mode is priced at its premium rate. You can override any model's price for negotiated rates. It is a list-price equivalent, not a figure reconciled against your vendor invoice (on subscription plans there is no per-session invoice to reconcile against), and it leaves out server-tool fees such as Claude web search, the 1.1x rate for US-only inference and OpenAI long-context surcharges.
Is the collector open source?+
Yes. The collector is MIT-licensed, one dependency-free Node.js file, with its source on GitHub (github.com/tallyhook/tallyhook-collector) and published on npm as tallyhook, so npx tallyhook and npx tallyhook install <token> both work. You can read exactly what leaves your machine before you run it. The hosted web app and API are not open source.
What leaves the developer's machine?+
Only metadata: token counts by model, start and end time, tool and version, git remote and branch, which repositories the edited files belong to, developer identity from git config (or the OS username if no git email is set), the machine hostname, turn and tool-call counts, paths of edited files, and optionally the first 160 characters of the first prompt. Transcripts, code, diffs, tool output and environment variables never leave the machine.
What counts as a developer seat?+
Only developers who install the collector and upload sessions. Anyone else you invite, such as a project manager or account owner, signs in free as a workspace member (up to 50 people per workspace). The free trial covers whichever plan you are trying — 5 developers on Team, 20 on Agency — and you can switch between them free in Settings while the trial runs, so an agency can evaluate with a real team before paying.
What if we have more than 20 developers?+
Add extra seats to the Agency plan any time from Settings: $7 per seat per month, up to 500 developers in total. That is below Agency's own blended rate ($149 / 20 = about $7.45), so growing past 20 never costs more per head.
Does the hook slow Claude Code down?+
Rarely, and briefly. The Stop hook syncs at most once every ten minutes and usually finishes in well under a second. Each upload times out after eight seconds, Claude Code caps the hook at 20 seconds, and the hook always exits cleanly, so it never fails a turn.
I'm a one-person consultancy. Is this for teams only?+
No. The Team plan at $49 a month works for a single developer, and a solo consultant is the clearest case for it: you are the one eating the agent cost and the one sending the invoice, so there is nobody to roll anything out to. You install the collector on your own machine and get the invoice document with your markup, a read-only link to send each client, and history that outlives the session logs Claude Code eventually deletes. The free npx tallyhook command already groups repos into clients locally; the paid plan is what makes that into something a client can open.
Can I try it without creating an account?+
Yes, two ways. The live demo at tallyhook.dev/demo opens the real app on sample data for a made-up five-developer agency: overview, clients, budgets, sessions and a finished invoice. Or run the collector itself (npx tallyhook, an open-source npm package) to print what each repo on your own machine cost over the last 30 days at list price, and npx tallyhook --by client to roll those repos up into the clients you bill with your markup. It needs no account or token and uploads nothing; it only downloads the public price list.
Can alerts go somewhere other than email?+
Yes. Add a webhook URL in Settings and both alerts are POSTed there as well as emailed. Discord is verified: a real cost-spike and a real budget alert were both watched arriving in a channel, correctly formatted. The same payload also carries the field Slack documents for incoming webhooks, so it should work there too, but nobody has watched one arrive yet and we would rather say that than imply it is tested. The message is deliberately plain text, because Discord and Slack use different bold syntax and either one would render as stray asterisks in the other. Saving a URL sends a test immediately.
Can I charge different clients different markups?+
Yes. The workspace has a default markup and any client can override it on its own page; an empty field means it inherits. If one invoice covers several clients at different rates, each client's line is priced at its own rate and the per-developer and per-model billable columns come off, because no single markup describes them honestly.
Whose timezone decides when a month ends?+
Yours, once you set it. Workspace owners pick a billing timezone in Settings and every calendar-month range is cut on that clock. It matters more than it sounds: a session run at 8pm on the last day of the month in US Pacific is already the next day in UTC, so without a timezone it would be billed in the following month. Sessions are always stored in UTC and nothing is repriced; only the period boundaries move. The default is UTC.
Can I set a budget per client?+
Yes. Put a monthly budget on any client and workspace owners get one email when that client's month passes 80% of it and another at 100%. Separately, a per-session threshold emails you the moment a single session gets expensive, which is how you catch an agent loop the same day.
What about Cursor?+
Cursor does not write per-request token usage to a local log the collector can read, so it needs a proxy, which is a bigger trust ask than reading a log file. It is not built. There is a one-line way to register interest at the bottom of the features page, and what gets built next comes from those asks rather than a guess.
Can my coding agent ask what it is spending?+
Yes. Run npx tallyhook mcp and you have a Model Context Protocol server over stdio; in Claude Code, claude mcp add tallyhook -- npx -y tallyhook mcp. It exposes four tools: spend grouped by repository, the same grouped by model, the individual sessions that cost the most, and a summary of this period against the equally long one before it. It needs no account and no token and uploads nothing, because it reads the same local logs the free report does. If you have set "privacy": true, it leaves the prompt snippet out too.
Can I turn off the prompt snippet?+
Yes. Set "privacy": true in ~/.tallyhook/config.json and only counts and identifiers are sent.
What happens if I don't upgrade after the trial?+
Nothing is deleted and the collector keeps recording, so your history has no gap. The ledger itself (overview, clients, sessions, invoices, exports and client report links) is paused until you pick a plan, and opens again the moment you do.
Can I switch plans or cancel later?+
Yes, any time, from Settings. Plan switches are prorated with no double charge; cancelling stops billing but never deletes your data. Workspace owners manage billing.