Turn your AI spend into a story you can defend.
Cost in. Value out. Ratio over time. Per feature, per user, per team.
Anyone can run claude /cost. Few can answer "and what did it produce?"
This tool joins every dollar of AI spend (Claude Code, the Anthropic API, GitHub Copilot, any vendor with a CSV) to the work it actually generated (issues, PRs, lines, eventually product telemetry) and renders the answer as a single editorial HTML report β the kind of one-pager you can put in a Monday email to leadership.
If your team is on a flat subscription, it tells you the leverage ratio: "$200 cash bought $8,016 of token-equivalent work this week β that's 40Γ leverage." If you're paying per token, it tells you which features are eating the bill.
git clone https://github.com/ao92265/ai-value-tracker
cd ai-value-tracker && make install
source .venv/bin/activate
# Render the report against the bundled demo data
avt-html --cost examples/demo-cost.csv \
--report examples/demo-report.csv \
--cost-mode subscription --sub-cash 200 \
--out out/report.html
open out/report.htmlThat's the whole pitch. Real numbers come next.
# Cost side β walks every Claude Code session you've ever run
avt-cost --claude --days 30 --cost-mode subscription --sub-cash 200 \
--out out/cost.csv
# Value side β pulls PR stats from any GitHub repo you point it at
export AVT_REPO=owner/name
avt-value --days 30 --out out/value.csv
# Join + render
avt-report --spend out/cost.csv --value out/value.csv \
--out out/joined.csv
avt-html --cost out/cost.csv --report out/joined.csv \
--cost-mode subscription --sub-cash 200 \
--out out/report.htmlOr weekly via cron:
0 9 * * 1 $HOME/Repos/ai-value-tracker/bin/avt-weekly >> /tmp/avt-weekly.log 2>&1The editorial layout (Space Grotesk on paper-tone, terra & teal accents β no enterprise-SaaS slate) puts the hero number where leadership needs it and lets the long tail trail underneath.
| Section | What it answers |
|---|---|
| Hero | Leverage ratio (137Γ) in subscription mode, or total spend in API mode. |
| Ribbon + KPIs | Cash basis Β· token-equivalent Β· cost per task Β· session volume. Productivity is a first-class metric. |
| Β§ 01 Daily spend | Horizontal bars with peak-day highlight. 7 to 14 days. |
| Β§ 02 Where the spend went | Single allocation bar across every vendor source you've enabled. |
| Β§ 03 Top issues by cost | Costliest tickets, with productivity hints (long threads = candidates for split). |
| Β§ 04 Top users by cost | Team breakdown from git config user.email. Each contributor runs the tool, the team picture composes itself. |
| Β§ 05 Cost vs value | Per-issue leverage. Placeholder formula until product telemetry lands. |
| Method | Explains every number so nobody can wave it away. |
Print-friendly. Single self-contained HTML. No JS, no build step, no external assets beyond Google Fonts.
AI spend lives in more places than just Claude Code. avt-cost unifies them.
| Source | Adapter | Status |
|---|---|---|
| Claude Code (JSONL logs across every project) | --claude |
β |
| Anthropic API (console CSV export) | --anthropic-csv <path> |
β |
| GitHub Copilot (admin API, per seat) | --copilot-org <org> |
β |
| Generic vendor CSV (Cursor / Gong / Intercom Fin / OpenAI / anything) | --vendor-csv <path> --vendor-source <name> |
β |
| Azure billing AI resource group | --azure-billing |
planned |
| OpenAI usage API direct | --openai |
planned |
Run any combination in one shot:
avt-cost --claude --days 30 \
--anthropic-csv anthropic-export.csv \
--copilot-org your-org \
--vendor-csv gong-bill.csv --vendor-source gong \
--out out/cost.csvOutput is one unified CSV with a source column, plus a percentage breakdown on stderr.
~/.claude/projects/**/*.jsonl β avt-cost β cost.csv
GitHub repo (gh CLI) β avt-value β value.csv
β
avt-report β joined.csv
β
avt-html β report.html
Spend walks every project under ~/.claude/projects/, sums token usage per session, multiplies by pricing in src/avt/spend.py, attributes the session to a branch via git reflog timestamp matching, then to an issue via branch name or commit #NNNN references, then to a user via git config user.email at the session cwd.
Value reads any GitHub repo via gh, pulls every PR that references each issue, sums lines / files / merge state.
Report joins on issue number, computes value_score, writes CSV.
HTML renders the single-page editorial report from those CSVs.
If your team is on Claude Max, Claude Pro, or Copilot Business, the per-token numbers this tool prints are hypothetical β what the same work would cost on the API at list price. Actual cash is the subscription.
Run with the right mode:
avt-cost --claude --cost-mode subscription --sub-cash 200You get:
HYPOTHETICAL COST MODE (subscription plan in use)
Total: $8,015.94 across 93 sessions
Hypothetical API-equivalent: $8,015.94
Real subscription cash: $200.00
Leverage ratio: 40.08Γ
A 40Γ ratio says "stay on the sub." A 0.4Γ ratio says "switch to API." Either way the answer is in the report.
Each contributor runs avt-cost --claude against their own machine. The tool tags every session with git config user.email, so when the CSVs are merged (centrally or in a shared bucket), the Β§ 04 Top users by cost panel composes itself.
No central agent. No telemetry endpoint. No log shipping. Just CSVs.
If you want a single team-wide rollup, point a shared CI job at a checkout that aggregates each contributor's exported CSV:
cat alice-cost.csv bob-cost.csv carol-cost.csv > team-cost.csv
avt-html --cost team-cost.csv --out team-report.html ...claude /cost and claude-observatory cover the spend side superbly. AI Value Tracker adds:
- Cross-vendor unification. Five vendor dashboards collapse into one CSV with a
sourcecolumn. - Per-issue attribution. Spend mapped to tickets via branch + commit refs.
- Per-user attribution. Spend mapped to humans via
git config user.email. - Cost-vs-value join. PR output joined to spend, ratio computed.
- Editorial HTML report. Designed to be emailed to leadership, not poked at in a CLI.
- Subscription leverage mode. Sub-vs-API decision with a real number.
If you want hook-level observability and waste-finding, use claude-observatory. If you want the report that answers "is the AI investment paying back," use this.
avt-value is the only GitHub-specific module today. The spend side runs on any project. Other VCS adapters are ~100 lines each. PRs welcome.
Not yet. Today it's lines + (merged_prs Γ 200) β directional only. For absolute numbers, ship the product telemetry in docs/telemetry-spec.md, then swap the formula in report.py.
Token prices in src/avt/spend.py are list rate as of late 2025. They drift. Update when needed. Enterprise volume discounts are not modelled.
- Not a billing system. Talks to vendor invoices, doesn't replace them.
- Not real-time. Daily/weekly batch.
- Not a finance system of record. Numbers in hypothetical mode aren't auditable.
- Not a hook tracer. Use claude-observatory for that.
| Env var | Default | Purpose |
|---|---|---|
AVT_PROJECT |
~/.claude/projects |
Root directory to walk for JSONL sessions. |
AVT_REPO |
(unset) | GitHub repo (owner/name) for avt-value. |
AVT_OUT |
~/.claude/observatory-logs/avt |
Where avt-weekly snapshots land. |
ai-value-tracker/
βββ README.md
βββ LICENSE
βββ CONTRIBUTING.md
βββ Makefile
βββ pyproject.toml
βββ bin/avt-weekly
βββ docs/
β βββ screenshot.png
β βββ telemetry-spec.md
βββ examples/
β βββ demo-cost.csv
β βββ demo-report.csv
β βββ weekly-cron.sh
βββ src/avt/
βββ spend.py JSONL β cost per session, branch, issue, user
βββ value.py gh β PRs, lines, files per issue
βββ report.py join + CSV
βββ html_report.py editorial HTML render
βββ cost.py unified multi-source cost
βββ telemetry.py product-side stub
βββ sources/
βββ claude_jsonl.py
βββ anthropic_invoice.py
βββ copilot_admin.py
βββ vendor_csv.py
MIT. Use it, fork it, ship it. Attribution welcome but not required.