XJM-free

Claude Agent Ledger — Development skill for Claude Code

Development community

Per-subagent cost attribution for Claude Code.

How to install Claude Agent Ledger

This entry records only its repository, not the path inside it, so there is no exact command to give. Open XJM-free/agent-ledger and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Agent Ledger does

Per-subagent cost attribution for Claude Code. Reads local JSONL session logs, computes shadow cost at marginal Anthropic API rates with proper TTL pricing.

Alternatives in Development

  • Third-party Notices — THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THI 94.7k ★
  • Om Dump — Freeform capture mode 4.6k ★
  • Memory Gc — Inspect or rotate the autopilot ledger JSONL files (findings.jsonl, negatives.jsonl) 3.8k ★

README

claude-agent-ledger

See exactly where your Claude Code budget goes — per subagent, per model, per day.

[![npm](https://img.shields.io/npm/v/claude-agent-ledger.svg)](https://www.npmjs.com/package/claude-agent-ledger) [![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE)

Use `--anonymize` before sharing output. It replaces project paths and session IDs, but it does not rename subagent or tool names — review those before you post a screenshot.


Why

Claude Code's invoice at month-end tells you one number. It doesn't tell you:

  • Which of your subagents burned most of it
  • Which model (Opus / Sonnet / Haiku) ate the budget
  • Which day of last week was the expensive one
  • Whether your "cheap" Haiku agent is actually quietly expensive

If you run **one** Claude Code session, this is fine — you already know. If you run **seven** subagents daily (reliability, release, review, iOS factory, docs, ...), you're flying blind.

`claude-agent-ledger` reads Claude Code's local session logs and gives you a per-subagent ledger. That's it.

Install

Requires [Bun](https://bun.sh/) 1.1 or newer. The CLI is Bun-native even when you install it from npm.

bun install -g claude-agent-ledger
# or, with Bun already available: npm install -g claude-agent-ledger

agent-ledger week --summary        # the dashboard (start here)
agent-ledger week --tree           # parent → child subagent attribution
agent-ledger week --by tool        # which tool ate the budget (Read/Bash/Grep/MCP)
agent-ledger week --by model       # opus vs sonnet vs haiku
agent-ledger week --by project     # which project ate your tokens
agent-ledger week --by session     # which single sessions went sideways
agent-ledger week --by day         # daily bar chart with peak/avg/variance
agent-ledger today --budget 50     # CI gate: exit 2 if today > $50
agent-ledger week --json | jq      # JSON output for any view, including summary
agent-ledger month --md > report.md

# Live tail