Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphtrack

npm version license

Interactive token-usage dashboard for Claude Code.

Run npx graphtrack, open localhost:9090, and see exactly where your tokens go — as a graph, a table, or a multi-session overview.

Your logs never leave your machine.

graphtrack_marketing_demo_v2

Installation

# No install needed — runs directly from npm
npx graphtrack

# Or install globally
npm install -g graphtrack
graphtrack

Requires Node.js 18+.

Quick Start

npx graphtrack
# → Server starts at http://localhost:9090

Point at a custom log directory:

npx graphtrack --dir /path/to/.claude/projects

Use a different port:

npx graphtrack --port 3000

Features

Four views, one dashboard

View What it shows
Overview Aggregate stats across all sessions — total tokens, per-project breakdown, tool usage share
Aggregate Graph Hub-and-spoke network: each tool is a node, size = token share, color = tool type
Chronological Graph Turn-by-turn chain: each prompt links to the tools it triggered, ordered in time
Table Sortable per-tool and per-turn tables with color-coded token bars

Session picker

A searchable dropdown groups sessions by project — type to filter by ID or project name, then click to load.

What gets tracked

  • Input / output / cache tokens per session, per turn, and per tool call
  • Real timestamps — session start time and wall-clock duration from the actual logs
  • Tool breakdown — which tools consume the most tokens, how many times each was called
  • Project grouping — sessions organized by project in the Overview view

Tool color legend

Tool Color
Edit ● Red
Bash ● Yellow
Read ● Blue
Write ● Green
Glob ● Purple
Grep ● Pink
Agent ● Orange

Project Structure

src/
  types.ts        Data model (Session, Turn, ToolCall, Usage, Overview)
  parser.ts       JSONL → Session + aggregateSessions()
  graph.ts        Session → vis.js nodes/edges (aggregate + chronological)
  server.ts       Express API + static file serving
  cli.ts          CLI entry point (--dir, --port, --help)

public/
  index.html      Dashboard UI (4 views, vanilla JS)
  images/         Icon and assets

test/
  parser.test.ts  Unit tests for parser, aggregation, and graph builders
  fixtures/       Sample session data for tests

License

MIT

About

Interactive token-usage dashboard for Claude Code.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages