@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.
See it
Quick start
Up and running in seconds
@ruah-dev/opt
$ ruah opt analyze ~/.claude/projects/<slug>/
# 492 spans ~$14.59Features
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 summaryruah opt waste <transcript>Rank top context-bloat and token waste offendersruah opt report --out <file.html>Export self-contained interactive visual reportruah opt pricing --override <prices.json>Show or configure token price tablesEcosystem
Part of the ruah toolchain
CLI Router
@ruah-dev/cli
One command. Every agent tool.
Guard
@ruah-dev/guard
Can I trust the agent not to do damage — in any harness, with proof?
Verify
@ruah-dev/verify
Did the agent actually finish?
Watch (Lite)
@ruah-dev/watch
Can I show someone what this session did?
Eval
@ruah-dev/eval
Same task — which executor wins, and what did it cost?
Converter
@ruah-dev/conv
How do I make this API agent-sized?
Orchestrator
@ruah-dev/orch
Parallel agents. Zero collisions.