@ruah-dev/opt

Optimizer

Where did my tokens go?

Read Claude Code session transcripts and canonical traces to reveal exactly where your tokens and money went. Pinpoint context bloat, repeated file reads, and oversized tool outputs with actionable fixes.

Source

See it

Quick start

Up and running in seconds

@ruah-dev/opt
$ ruah opt analyze ~/.claude/projects/<slug>/
# 492 spans  ~$14.59

Features

01Claude Code JSONL transcript adapter (~/.claude/projects/)
02Waste heuristics H1–H4 (oversized tools, repeated reads, dead context)
03Self-contained offline HTML reports (zero CDN, strict CSP)
04Prompt cache read/write efficiency breakdown
05Versioned price tables with custom override support
06Actionable one-line fix suggestions per waste item

CC

JSONL adapter

H1–H4

Waste rules

0

CDN in reports

Command Reference

Commands

ruah opt analyze <dir>Generate session cost, token, and cache summary
ruah opt waste <transcript>Rank top context-bloat and token waste offenders
ruah opt report --out <file.html>Export self-contained interactive visual report
ruah opt pricing --override <prices.json>Show or configure token price tables

Dive deeper

Full API reference, guides, and examples.