update
May 13, 2026
By Teun
cc-ledger tracks Claude Code spend on the local machine
cc-ledger is a local-first ledger for Claude Code activity that records prompts, edits, and per-turn token cost on the user’s machine. Cloud sync to ccledger.dev is optional and only sends aggregates, not raw prompts or transcripts.
A new project called cc-ledger aims to give developers a local ledger of Claude Code usage, with token spend, session activity, and per-PR cost tracking stored on the user’s own machine. According to the project description, every Claude Code edit, prompt, and per-turn token cost is captured through hooks and written to ~/.cc-ledger/ledger.db on the laptop.
The project is built around a local-first model. The developer said raw prompts, transcripts, and file blobs never leave the machine, and that pushing aggregates to the cloud dashboard at ccledger.dev is optional. To sync, users must run cc-ledger auth and then cc-ledger sync, which sends only summary data.
The install flow is designed to be simple. The project provides a curl-based installer at https://ccledger.dev/install that selects the correct tarball for macOS or Linux on x86_64 or aarch64, verifies the SHA256 checksum, installs cc-ledger into ~/.local/bin, and runs cc-ledger install to wire Claude Code hooks.
The author also exposed a set of environment variables for customizing the setup. Examples include CC_LEDGER_INSTALL_DIR for changing the install path, CC_LEDGER_VERSION for pinning a release, and CC_LEDGER_NO_HOOKS=1 for skipping the hook setup. The project also supports CC_LEDGER_HOME for moving the entire data directory, and CC_LEDGER_NO_AUTOSYNC to disable automatic background sync.
Once installed, cc-ledger collects data for local reporting. The tool includes commands such as cc-ledger stats for a six-panel summary and cc-ledger pr-cost for cost-per-PR estimates on the current branch. The stats view breaks down daily activity, top repos, top models, heavy sessions, spend distribution, and activity categories.
The project also includes a macOS menubar companion in the menubar/ directory. According to the README instructions, it shows the same local data in a glanceable interface, including 5-hour session pacing, active-session breakdown by repo, and 24-hour and 30-day usage trends. The menubar build requires macOS 14+ and Swift 6.
Under the hood, cc-ledger stores data in one directory by default, ~/.cc-ledger/. That directory contains the SQLite ledger database, content-addressed file blobs, optional pricing overrides, authentication tokens after login, and cached version-check data. The project says it does not auto-prune, rotate, or expire anything in that directory, and local data stays until the user deletes it.
The project also says it does not duplicate Claude Code prompt history. Claude Code already writes transcripts to ~/.claude/projects/<cwd>/<session>.jsonl, and cc-ledger reads from those logs as needed. For users who want cloud sync, the sync command shows the rows that will leave the machine and waits for confirmation unless --yes is used.
Pricing is calculated from token counts and an active pricing table, with support for different token classes and service tiers. According to the project, each turn stores the pricing version it used so older cost data stays understandable even if prices change later. The project also notes that subscription users can label sessions as Pro, Max, Team, or Enterprise so the cost field reflects what the session would have cost on API.
The project is written in Rust, pinned to Rust 1.85, and released under MIT. For users who want local visibility into Claude Code usage without sending raw content to a cloud service, cc-ledger now provides that ledger, the optional dashboard, and the install-and-sync flow.