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

Running Multiple Claude Code Sessions in Parallel with Git Worktrees
A developer shares how they use git worktrees to run multiple Claude Code sessions on separate branches without stashing or context switching. Review diffs, merge, and move on.

Dart AI productivity app review with OpenClaw integration
A user reports switching from Things to Dart AI for productivity, finding it better for implementing Getting Things Done methodology with full OpenClaw access, despite UI issues and initial setup complexity.

Two New Open Source Tools for AI Agent Security and Optimization
Two open source tools are available for AI agent developers: AI Agent Defense Kit provides runtime security skills, and AgentGuard (in development) offers cost tracking, security scanning, and activity monitoring.

Claude Code Production Grade Plugin v3.0 Released: Autonomous Software Development Pipeline
Production Grade Plugin v3.0 for Claude Code is now available as free, open-source software under MIT license. The plugin creates a full development pipeline from requirements to deployment with 13 AI skills acting as an engineering team.