Back to browse
GitHub Repository

Local observability tool for Claude Code that tracks runaway (p99) sessions, projected quota usage, per-PR cost, category breakdown (tokens used on planning vs coding), and more.

10 starsRust

Ledger – Claude Code Token Spend Analyzer

by tsv650·May 13, 2026·3 points·0 comments

AI Analysis

●●SolidSolve My ProblemCozy

Local SQLite ledger captures runaway Claude Code sessions before the bill shocks you.

Strengths
  • Content-addressed storage of file snapshots allows precise diffing of agent-driven changes.
  • SwiftBar menubar integration provides glanceable metrics without leaving the workflow.
  • Opt-in cloud sync ensures raw prompts and transcripts never leave the laptop by default.
Weaknesses
  • Currently limited to Claude Code, requiring re-implementation for Cursor or Copilot users.
  • Manual installation script lacks the polish of a signed macOS application bundle.
Target Audience

Developers using Claude Code heavily

Similar To

Wakatime · CodeTime · Cursor Analytics

Post Description

Built this after a single session burned 40x my median token spend. The local JSONL logs have everything you need to figure out why, but nothing surfaces it by default.

cc-ledger is a local Rust binary that registers as a Claude Code hook, capturing runaway sessions and per-PR cost.

Cost analytics can be viewed from the macOS menu bar (SwiftBar plugin), a web dashboard at ccledger.dev, or the CLI.

All feedback and ideas appreciated.

Similar Projects

AI/ML●●Solid

Claude Code's $200 plan is a 17× subsidy on the raw API

150× token inflation finding — you pay to re-read, not generate.

Big BrainDark Horse
Hiteshjain118
92322d ago