Claude Code Ledger — Security skill for Claude Code
Local-first cost & tool-call audit for Claude Code.
How to install Claude Code Ledger
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open caiqianha/claude-code-ledger and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Code Ledger does
Local-first cost & tool-call audit for Claude Code. Finds wasted context: repeated reads, blind retries, huge tool outputs.
Alternatives in Security
- ThinkWatch — Self-hosted AI API and MCP gateway for organizations: SSO and RBAC, per-user identity for MCP tool calls, PII 817 ★
- Data Viz Audit — Audit a data visualization for chart type selection, accessible color palette, annotations, and anti-patterns 309 ★
- Memory Self Review — Mine recent agent history (claude-mem + usage stats) for recurring failures and repeated patterns, audit MEMOR 297 ★
README
ccledger
[](https://www.npmjs.com/package/claude-code-ledger) [](./LICENSE) [](./package.json) 
**Local-first cost & tool-call audit for [Claude Code](https://claude.com/claude-code).**

[Open the demo HTML report](https://caiqianha.github.io/claude-code-ledger/) · Demo recorded on synthetic data from `scripts/demo-data.mjs`. No real session appears anywhere in this repo.
Reads the session logs Claude Code already writes to `~/.claude/projects/`, and tells you where the tokens went: per day, per project, per session, per model, per tool, plus the call patterns that burn context for nothing.
Why
Token dashboards tell you *how much* you spent. `ccledger` also tells you *on what*, at the tool-call level:
- which tool is called most, fails most, and returns the most bytes into your context
- the same file read 8 times in one session
- an identical command re-run right after it failed
- a 60 KB tool output that gets re-sent on every following turn
- long sessions whose cache hit rate collapsed
- what each tool result actually cost once it sat in the context window for the rest of the session
Each finding comes with a one-line hint, and `ccledger advise` turns the lot into a paste-ready `CLAUDE.md` block.
Install
npm install -g claude-code-ledger # installs the `ccledger` command
npx claude-code-ledger # or run it once without installing
Node 18+. Zero runtime dependencies. The npm package is `claude-code-ledger`; the CLI is `ccledger`.
Usage
ccledger [command] [options]
Reports
summary Totals, per-model split, top tools, top context
Related Skills
Flake Audit
Detect intermittently-failing tests from recent CI history (or repeated local runs); dedupe against tracked fl
Audit Deadcode
Comprehensive dead code audit — finds all unused files, functions, classes, and variables by walking the call
Eliniscan
AI full codebase scanner. Opens a separate Claude session for every file — reads every line, misses nothing. F
Agent Overwatch
A deterministic guard for AI coding agents — checks each tool call before it runs (allow/ask/deny) and blocks
Hub Audit
Monthly adversarial self-audit of the hub — a fresh, context-free worker hunts for drift, stale rules, and sel
Cost Autopsy
Session token-burn autopsy (TCO v1). Reads the TIS telemetry log and reports per-session token spend (input /
Related Agents
Dr Efficiency
Deep-review finder angle. Finds wasted work the diff introduces - repeated expensive construction, re-parsing,
Ops Sentinel
Interprets the back office's own run ledger, flagging failing or missed jobs, repeated failures, cost spikes a
Ddw Impact Scanner
Read-only codebase scanner. Given a draft technical plan, finds every file the change actually touches — sibli