CC-Ledger: Track Claude Code Costs Per Session and Per PR with Local SQLite

CC-Ledger is a local Rust binary that registers as a Claude Code hook and writes each turn to a local SQLite database the moment it completes. This gives you live visibility into session costs — catching runaway sessions before they drain your quota — and per-PR cost breakdowns without needing an API key.
How It Works
The tool was built after a single Claude Code session consumed most of the author's quota, with the Claude dashboard never flagging it. Additionally, one PR was found to cost 40x the median, with no built-in visibility into why. CC-Ledger addresses this by recording every turn to SQLite in real-time.
View analytics in three ways:
- macOS menu bar — via a SwiftBar plugin
- Web dashboard — hosted at
ccledger.dev - CLI — direct terminal queries
Getting Started
Clone the repo and build the Rust binary:
git clone https://github.com/delta-hq/cc-ledger
cd cc-ledger
cargo build --release
Then configure it as a Claude Code hook (refer to the repo README for detailed setup). The hook writes each turn to SQLite automatically.
Who It's For
Claude Code users who need granular cost tracking per session and per pull request to debug anomalies and avoid quota overruns.
📖 Read the full source: r/ClaudeAI
👀 See Also

Detrix MCP Server Adds Runtime Debugging to AI Coding Agents
Detrix is a free, open-source MCP server that enables MCP-compatible agents to observe live variables in running code without restarts or code changes. It supports Python, Go, and Rust applications running locally or in Docker.

mcp-india-stack: Open-source MCP server for Indian financial APIs
mcp-india-stack is an open-source MCP server that provides Claude with native access to seven Indian financial and government API tools, including GSTIN validation, IFSC lookup, and PAN validation. It requires zero authentication, is offline-first, and is available via pip install.

cstat: A Native Rust Status Line for Claude Code with 2ms Performance
cstat is a native Rust binary that replaces claude-hud's 62ms status line with a 2ms implementation by eliminating 24 subprocess spawns per invocation. It displays model info, rate limits, git status, context window usage, active tools, subagents, and task progress.

Relvy improves Claude's root cause analysis accuracy by 12 percentage points on OpenRCA benchmark
Relvy, a tool that automates runbooks, has demonstrated a 12 percentage point improvement in Claude's accuracy on the OpenRCA benchmark for root cause analysis. The results were shared via a Hacker News post with 11 points.