// COST INTELLIGENCE

EVERY TOKEN.
EVERY DOLLAR.

Token Dashboard scans your local Claude Code JSONL transcripts hourly, deduplicates sessions by message ID, and computes exact USD cost using model-specific input, output, and cache token rates. Seven KPI tiles, a date range selector (7d / 30d / 90d / ALL), and six ECharts panels give you a full picture of your usage. Sessions, Projects, and Settings tabs round out the four-tab dashboard — all backed by Supabase, all derived from data that never leaves this server.

Open Dashboard See How It Works
--
Sessions Tracked
--
All-Time Cost (USD)
--
Projects
--
Cache Hit Rate

Command Center

The Overview tab gives you 7 KPI tiles — Sessions, Turns, Input, Output, Cache Read, Cache Create, and Est. Cost — plus a date range selector (7d / 30d / 90d / ALL). Six ECharts panels cover: daily stacked token bars, daily cache reads, tokens by project (grouped bar), token share by model (donut), top tools by call count, and recent sessions. An expandable glossary explains every number. Every figure is computed from raw token counts using model-specific Anthropic rates.

meltuc.tech/tkn/app — Overview
124
Sessions
5.2K
Turns
47K
Input
1.9M
Output
178M
Cache Read
6.3M
Cache Create
$455
Est. Cost
Daily Cost — Last 30 Days
Cost by Model
claude-sonnet-4 $26.45 — 63%
claude-haiku-4 $10.92 — 26%
claude-opus-4 $4.81 — 11%
Token Volume by Type
Input 38%
Out 22%
Cache R 32%
W
■ Input ■ Output ■ Cache Read ■ Cache Write
Last scan: 44 min ago · Next: in 16 min

Session History

The Sessions tab is a paginated table of every Claude Code session TKN has recorded — 25 per page, sortable by date, cost, message count, or tool call count. Each row shows the project slug, working directory, git branch, model, total tokens, cache hit percentage, USD cost, and session duration. Clicking a row expands an inline detail panel with the full token breakdown and all metadata fields. A search bar and model filter let you zero in on any specific session or project.

meltuc.tech/tkn/app — Sessions
Search sessions…
All Models
Sort: Date ▼
Session Project Model Tokens Cache Cost Date
a8f3c1… meltuc-tech sonnet-4 28.4K 41% $0.42 Apr 21
d2b9e7… -home-ubuntu haiku-4 12.1K 55% $0.08 Apr 21
f4a1c8… meltuc-tech sonnet-4 51.2K 38% $0.89 Apr 20
c7e2a3… mywebsite opus-4 9.8K 22% $0.31 Apr 20
b1d5f9… -home-ubuntu sonnet-4 34.7K 45% $0.56 Apr 19
e9c4b2… meltuc-tech haiku-4 8.3K 61% $0.04 Apr 19
a3f7d6… scripts sonnet-4 19.1K 29% $0.27 Apr 18
SESSION DETAIL
Project
meltuc-tech
Model
claude-sonnet-4-5
Branch
main
Token Breakdown
Input16,820
Output5,240
Cache Read6,340
Duration
47.3 min
Messages / Tools
82 msgs · 34 calls
Showing 1–25 of 124 sessions
1 2 3

Project Breakdown

The Projects tab groups sessions by project slug — the directory name Claude Code derives from your working directory. Each row shows total USD cost, session count, aggregate token volume, average cost per session, and the last active timestamp. A horizontal bar chart makes the biggest spenders immediately visible. This is where you find which codebases are consuming the most compute budget.

meltuc.tech/tkn/app — Projects
Cost by Project (USD)
meltuc-tech
$18.42
100%
-home-ubuntu
$11.15
61%
mywebsite
$8.33
45%
myprojects
$3.21
17%
scripts
$1.07
6%
Project Cost Sessions Tokens Avg/Session Last Active
meltuc-tech $18.42 48 124.2M $0.38 Apr 21
-home-ubuntu $11.15 31 76.8M $0.36 Apr 21
mywebsite $8.33 24 55.1M $0.35 Apr 20
// PROMPTS

Save Prompts Directly To PRL

The Prompts tab surfaces every distinct prompt extracted from your Claude Code sessions — the actual text you sent, de-duplicated and searchable. Each row includes the model used, session context, and token cost. A Save to PRL button on each row pushes the prompt directly into the PromptLibrary as a draft, so useful patterns discovered in sessions don’t get lost. A built-in duplicate detector groups identical prompts by hash and surfaces the estimated wasted spend from re-sending the same prompt — a fast way to spot patterns worth turning into a saved template.

meltuc.tech/tkn/app — Prompts tab
Search prompts…
All Models
Prompt Model Tokens Cost Save
Refactor this function to use async/await and add proper error handling… haiku-4.5 1,240 $0.001
Save to PRL
Write a comprehensive test suite for this module covering edge cases… sonnet-4.5 2,180 $0.009
Save to PRL
Explain what this SQL query does and suggest performance improvements… haiku-4.5 890 $0.001
Save to PRL
// BUDGET ALERTS

Monthly Budget + Telegram Alerts

Set a monthly token budget in the Settings panel and configure Telegram alert thresholds at 50%, 75%, and 90% of spend. A dedicated run_tkn_budget_check.py script runs hourly and fires a Telegram message the moment you cross a threshold — so you find out before the bill arrives, not after. Register outbound budget webhooks to POST a JSON payload to any endpoint when spend crosses your chosen percentage, and wire up a weekly digest that recaps the last 7 days of cost by model straight to Telegram.

meltuc.tech/tkn/app — Settings → Budget Alerts
Monthly Token Budget
Budget (USD)
$50.00
Alert Thresholds
50% — Warning ✓ active
75% — Alert ✓ active
90% — Critical ✓ active
Current Month
Spent $38.22 / $50.00
76% used — 75% alert sent
✓ Next alert at 90% ($45.00)
// MVS COST ATTRIBUTION

Cost Breakdown by Model (via MVS)

The Overview panel now includes a Cost by Model breakdown sourced from the MVS call log. Every Claude API call logged through the Model Vault Service is attributed by model, giving you a precise split of Opus / Sonnet / Haiku spend — not just per Claude Code session, but across all platform blueprints that route through MVS.

meltuc.tech/tkn/app — Overview: Cost by Model
MVS Cost Attribution — This Month
claude-sonnet-4 $26.45 — 69%
claude-haiku-4-5 $8.13 — 21%
claude-opus-4 $3.64 — 10%
Source: mvs_call_log — 1,247 attributed calls this month
// HOW IT WORKS

From JSONL Transcript to Dashboard in 5 Steps

Every session in TKN originates from the JSONL transcript files Claude Code writes locally. A cron job runs hourly, deduplicates messages, computes exact USD costs, and upserts to Supabase atomically — no external calls to Anthropic required.

01
Scan Transcripts
Glob ~/.claude/projects/**/*.jsonl hourly at :15. Each file maps to one Claude Code session.
02
Parse Messages
Read each line as JSON. Extract assistant messages with usage blocks containing input, output, and cache token counts.
03
Deduplicate
Messages keyed by message.id. When the same ID appears in multiple writes, the highest output token count record wins.
04
Price Tokens
Model string matched by prefix to a rate table. Cost = input × rate + output × rate + cache_read × rate + cache_write × rate, in USD per million tokens.
05
Store & Surface
Session rows upserted to tkn_sessions via ON CONFLICT DO UPDATE. Dashboard KPIs and charts update from the live database.
// PRICING MODEL

Model Rate Cards

TKN uses Anthropic's published per-million-token rates for the Claude 4 and Claude 3 model families. Cache read tokens are priced at a deep discount relative to fresh input tokens — the savings accumulate significantly in long-running sessions with large context windows.

Opus 4
claude-opus-4-* — Highest capability
Input $15.00 / MTok
Output $75.00 / MTok
Cache Read $1.50 / MTok
Cache Write $18.75 / MTok
Sonnet 4
claude-sonnet-4-* — Balanced performance
Input $3.00 / MTok
Output $15.00 / MTok
Cache Read $0.30 / MTok
Cache Write $3.75 / MTok
Haiku 4
claude-haiku-4-* — Fast & economical
Input $0.80 / MTok
Output $4.00 / MTok
Cache Read $0.08 / MTok
Cache Write $1.00 / MTok
90%
Cache Read Savings
Cache read tokens are priced at 10% of the input rate for every model tier. In long sessions where Claude Code keeps your codebase in context, the cache hit rate can exceed 50% — cutting effective input costs by more than half. TKN tracks your actual cache hit rate per session so you can see the savings directly.
// WHAT YOU GET

Everything You Need to Understand Your Claude Usage

Seven KPI tiles, six charts, full session history, project breakdown, prompt extraction with duplicate detection, budget alerts and webhooks, a weekly Telegram digest, and model cost attribution — all from your local JSONL files.

📋
Session Tracking
Every Claude Code session recorded — project slug, working directory, git branch, model, duration, message count, and tool call count. 25-per-page paginated table, sortable and searchable.
💥
Per-Turn Token Log
Input, output, cache read, and cache write tokens broken out per assistant turn. Deduplication by message ID ensures no double-counting across JSONL re-writes.
💵
Cost Calculator
Exact USD cost using Anthropic's published per-million-token rates for Opus, Sonnet, and Haiku. Cache read tokens priced at 10% of input rate — savings tracked per session.
📊
Project Breakdown
Sessions grouped by project slug with total cost, session count, aggregate token volume, average cost per session, and a horizontal bar chart for instant visual comparison.
📝
Prompt Extraction
Every distinct prompt you sent, de-duplicated and searchable. One-click Save to PRL pushes any prompt directly into the PromptLibrary as a draft — useful patterns never get lost.
🔔
Budget Alerts & Webhooks
Set a monthly token budget with Telegram alert thresholds at 50%, 75%, and 90%. Register outbound webhooks that POST a JSON payload to any endpoint when spend crosses your threshold — fired by the hourly budget check.
🔍
Duplicate Prompt Detection
Identical prompts grouped by hash with occurrence counts, first/last seen, and estimated wasted spend from re-sending the same text. Find what to turn into a reusable template.
📅
Weekly Digest & Daily-by-Model
A weekly Telegram digest recaps the last 7 days of spend per model, and the daily-cost-by-model endpoint powers a per-date, per-model breakdown over a 7/14/30/90-day range.
🤖
MVS Cost Attribution
Cost breakdown sourced from the MVS call log — Opus / Sonnet / Haiku spend across all platform blueprints that route through the Model Vault Service, not just Claude Code sessions.
// GET STARTED

Stop Guessing. Start Tracking.

Your Claude Code sessions are already writing JSONL transcripts. Token Dashboard turns those files into cost visibility — no API keys, no external calls, no configuration required.

Open Token Dashboard

Requires a MelTuc account. Create one free.