AI Engineering Intelligence Platform · Built by Aditya Bikram Dash
Stop tracking AI spend.
Start governing it.
TokenLens turns raw Claude Code session logs into efficiency scores, actionable savings, and a defensible ROI story — all from a single command, zero cloud dependencies.
Total Spend
$634
tracked across all projects
Cache Efficiency
71.9%
context served from cache
Efficiency Grade
D
57 / 100 · real score from scan
Developer ROI
41.9×
212h saved · $26,618 value
The Problem
Engineering teams are flying blind
on AI tool spend
Every team adopting AI coding tools hits the same three walls — not from lack of data, but lack of intelligence on top of it.
No visibility at team scale
Usage lives on individual machines. Engineering managers have zero insight into which projects burn the most budget — or which patterns are wasteful.
Data without action
Existing tools show charts of what you spent. They don't explain why a session cost 4× more than average, or that one config change halves the next bill.
No ROI story for leadership
When a CTO asks "is our $X/month on AI worth it?" — there's no answer. No hours saved, no value created, no multiplier to justify the investment.
"We spent $634 on Claude Code over 45 days. We had no idea if that was good, bad, or how to improve it — until TokenLens gave us a grade, a recommendation list, and a 41.9× ROI number to show leadership."
— What every engineering team says before they have a tool like this
What It Is
Not a tracker. An intelligence platform.
Three layers stacked on top of the same local JSONL logs every Claude Code user already has. One command to launch everything.
👁
Layer 1 — Visibility
Full spend breakdown across projects, sessions, models, and token types. Real-time. Auto-refreshes every 30 seconds. No accounts.
Spend charts Token breakdown
⚡
Layer 2 — Optimisation
Efficiency Score (A–F), anomaly detection, and specific recommendations with dollar savings. Not "consider caching" — exact fixes with ROI.
Efficiency Score Recs + $
📊
Layer 3 — ROI
Dev hours saved, dollar value created, ROI multiplier. Converts AI spend into business language your CTO actually acts on.
Hours saved 41.9× ROI
STACK
scanner.py
analyzer.py
server.py
index.html + pitch.html
Zero external dependencies · Python stdlib only
Feature — Efficiency Score
An A–F grade for every project and session
The single most important number in TokenLens. A composite 0–100 score that tells you, at a glance, how efficiently your team uses AI.
Score breakdown — from real scan
Cache Hit Rate28.8 / 40
71.9% of context from cache · weight 40pts
Output Density0.2 / 30
Very low ratio — agentic workflows, fixable with scoping
Cache Warm Rate20 / 20
Cache writes active · full points
Context Efficiency8.2 / 10
Low fresh-input ratio · good context reuse
BUSINESS IMPACT
A project moving from D → B typically cuts spend by 30–50% with no change in output quality.
Grade scale
D40–57Significant waste — clear savings available · You are here (57)
A88–100Highly optimised — cache warm, dense output
B74–87Good — minor inefficiencies only
C58–73Moderate waste — caching partially used
F0–39Severe — no caching, expensive patterns
Feature — Recommendations Engine
Specific actions. Specific savings.
Not dashboards with charts you stare at — precise, per-project recommendations with estimated dollar savings, generated automatically on every scan.
3 sessions with abnormal token burnMEDIUM
Session in 'insight-brain' cost $164.98 — 3.5× above project average. Indicates large file dumps without chunking, or runaway tool-call loops.
→ Review sessions in Session Explorer. Add explicit context limits.
Save ≈ $223.54
Low output density in insight-brainMEDIUM
Only 0.5 output tokens generated per 100 context tokens consumed. Prompts are too verbose or context windows too large for the task.
→ Audit system prompts for verbosity. Break large tasks into focused sub-prompts.
Save ≈ $122.92
Five pattern types the engine detects automatically
1
Cache cold start
Hit rate <25% → save 40–80% of input cost
2
Zero-cache projects
cache_write = 0 → save 45% with one config line
3
Session anomaly
Cost >3.5× project average → investigate
4
Low output density
Output <5% of context → tighten prompt scoping
Feature — Developer ROI Calculator
The answer to "is this worth it?"
Every CTO eventually asks. TokenLens gives the answer automatically — dev hours saved, value created, and a defensible ROI multiplier.
The model (conservative)
Output tokens1.6M
× 4 chars/token~6.4M chars
÷ 200 chars/min31,942 mins
× 40% attribution12,776 mins = 212.9h
× $125/hr rate= $26,618 value
The CTO script
"We spent $634 on Claude Code AI tooling this quarter. Based on output generated and a conservative 40% attribution model, we estimate 212.9h of developer time saved — at $125/hr, that's $26,618 of developer value. ROI: 41.9×. And we're currently at a D grade, meaning with basic cache optimisation we reduce spend by 30–40% while maintaining the same output — improving ROI to an estimated 60×."
— Ready-made pitch. TokenLens generates this automatically on every scan.
40% attribution is intentionally conservative. Stanford/GitHub research shows 30–55% productivity gains from AI coding tools.
Competitive Position
Same raw data.
Entirely different value.
The closest existing tool (claude-usage, 1.6k stars) reads the same JSONL files but stops at charts. TokenLens starts where it ends.
| Capability | claude-usage (OSS) | TokenLens |
| Token counts & cost charts | ✓ Yes | ✓ Yes |
| Per-model breakdown | ✓ Yes | ✓ Yes |
| Session list | ✓ Yes | ✓ Yes |
| Efficiency Score (A–F) | ✗ No | ✓ TokenLens only |
| Cache hit rate analysis | ✗ No | ✓ TokenLens only |
| Actionable recommendations | ✗ No | ✓ TokenLens only |
| Dollar savings per recommendation | ✗ No | ✓ TokenLens only |
| Anomaly detection | ✗ No | ✓ TokenLens only |
| Developer ROI calculator | ✗ No | ✓ TokenLens only |
| Project benchmarking & grades | ✗ No | ✓ TokenLens only |
| Built-in pitch deck | ✗ No | ✓ TokenLens only |
One sentence: claude-usage tells you what you spent. TokenLens tells you why, what's wasteful, how to fix it, and proves the ROI.
Roadmap
Individual tool → Enterprise governance
Phase 1 is built and running today. Phases 2 and 3 evolve it into a platform with a natural fit for security-first engineering organisations.
Phase 1 — BuiltDone
Incremental JSONL scanner + SQLite
Efficiency Score (A–F) per project + session
Recommendations engine + $ savings estimates
Anomaly detection (3.5× threshold)
Professional dashboard + built-in pitch deck
CLI for terminal workflows
Phase 2 — Team6 weeks
—
Central collection agent (self-hosted)
—
Team + org-level efficiency roll-up
—
Per-engineer breakdown for managers
—
Budget guardrails + Slack/email alerts
—
Weekly PDF digest reports
—
GitHub Copilot + Cursor support
Phase 3 — GovernanceQ4
—
Data residency + model audit trail
—
Sensitive-data pattern detection
—
CI/CD pipeline agent cost tracking
—
SOC2-aligned compliance reports
—
JetBrains + VS Code extension
—
Multi-tool cost consolidation
Get Started
One command.
Full intelligence.
No pip install. No Docker. No accounts. Python 3.10+ standard library only. Works on macOS, Linux, and Windows.
Install
$ git clone https://github.com/abdash1994/tokenlens
$ cd tokenlens
$ python3 cli.py dashboard
CLI Commands
dashboard # Full browser dashboard
scan # Scan + print summary
today # Today's spend
week # Last 7 days
projects # Project efficiency table
recs # Recommendations + savings
roi # Developer ROI estimate
Built by Aditya Bikram Dash
Product Specialist at Sonatype with half a decade of experience delivering platform-based products. Built TokenLens to solve a real problem felt daily — understanding and optimising AI engineering costs.
Attribution required: If you fork or build on TokenLens, you must visibly credit the original author: "Originally created by Aditya Bikram Dash — github.com/abdash1994"