CostClaw Get started

Local audit for Claude Code

See where your Claude Code spend leaks.

CostClaw reads the Claude Code logs already on your disk, finds the token spend you can get back, and scores your setup across six pillars. It runs on your machine and never reads your prompts.

npx costclaw audit
See what it finds

No account, no upload. It parses the logs on your disk and prints a report.

costclaw audit read-only · nothing uploaded

~/.claude/projects 466 sessions · 38 projects

Recoverable spend $1,308.40 cache-miss exposure
Spend analyzed
$4,182.17
Cache hit
96.3%
Active hours
211.4
Overall setup score 91 / 100 Dialed in
  • CLAUDE.md quality n/a
  • Context hygiene 95
  • Prompting patterns 92
  • Session management 100
  • Tool and MCP config 100
  • Cost discipline 70

Top fix by recoverable spend

$1,308.40 Recover spend lost to cache misses Keep the start of each session stable so the prompt cache is reused instead of rebuilt.
  • Three projects fire one tool 100+ times per session
  • Cost discipline reads 70
Example output. Numbers are illustrative, not from any real account.

The leak

Your invoice is one number. The waste is in the logs.

Anthropic bills you a monthly total. It cannot tell you which dollars you could have kept. Two costs hide there, and both are sitting in the session logs on your disk.

input  $3.00 / MTok cache read  $0.30 / MTok

Cache-miss exposure

Claude Code caches the front of your prompt so repeat tokens cost a tenth of the price. When a session rebuilds that cache instead of reusing it, you pay full input rate on tokens that should have been nearly free. CostClaw measures the gap and prices it.

Read ×142 in one session

Reactive tool loops

A session that fires the same tool a hundred times is usually thrashing: re-reading, re-grepping, circling a problem. It does not show up as a line item, but it burns tokens and time. CostClaw counts the loops and flags the sessions that run hot.

How it works

Three passes over logs you already have.

  1. 1

    Parse locally

    It reads the JSONL session logs under your Claude directory, in memory, on your machine. Nothing is sent anywhere.

  2. 2

    Derive a summary

    From the raw logs it computes totals: spend, cache hit rate, tool use, session timing. Prompts, paths, and code are dropped here.

  3. 3

    Score and rank

    It scores six setup pillars from the evidence and ranks fixes by the dollars they recover. The report prints to your terminal.

Your machine
  • Raw session logs
  • Your prompts
  • File paths and names
  • Your code

Stays here. Always.

Hosted dashboard

Optional, on the Pro plan. It only ever receives the derived record above. The free CLI sends nothing at all.

What crosses the line, and what never does.

What you get

One command. Three answers.

A cost report, with the recoverable part priced

Real spend over the window you audit, your cache hit rate, and the slice you could get back. The recoverable figure is the headline, so you know what fixing the leak is worth before you start.

Spend analyzed
$4,182.17
Cache hit
96.3%
Recoverable
$1,308.40

A six-pillar setup score from evidence

CLAUDE.md quality, context hygiene, prompting, session management, tooling, and cost discipline. Each pillar is scored only from what your logs actually show. A pillar with no evidence reads n/a; nothing is invented to fill a bar.

  • Context hygiene95
  • Cost discipline70
  • Session management100

Fixes ranked by the dollars they recover

Not a wall of warnings. The list leads with the fix that returns the most spend, carries the exact figure, and tells you the one change to make. Smaller issues sit below it, in order.

  • $1,308.40 Recover spend lost to cache misses
  • warn Three projects fire one tool 100+ times
  • warn Short, expensive sessions inflate cost discipline

Privacy as the moat

Checkable, not just promised.

The only thing CostClaw produces is an AuditRecord: totals and generated sentences. No prompt text, no file paths, no secrets. That boundary is held by a test that runs on every build.

The test plants tripwire strings, a fake prompt and a fake client path, into sample logs, runs the full pipeline, and asserts that none of them appear in the record. If a leak ever slipped in, the build would fail before it shipped.

packages/engine/tests/audit.test.ts tripwire passing
// the privacy invariant, enforced on every run
const raw = sessionWith({
  prompt: "TRIPWIRE_secret_prompt",
  path:   "/Users/me/clients/acme",
});

const record = buildAudit(analyze(raw));
const json = JSON.stringify(record);

expect(json).not.toContain("TRIPWIRE_secret_prompt");
expect(json).not.toContain("/Users/me/clients/acme");
expect(hasEmDash(json)).toBe(false);

Pricing

Free today. Hosted next.

The CLI is real and usable right now, at no cost. The hosted plan is in progress, and it will only ever see the derived record, never your logs.

CLI

$0runs on your machine

  • Local cost report with the recoverable figure
  • Six-pillar setup score from your logs
  • Fixes ranked by dollars recovered
  • Runs offline, nothing uploaded
npx costclaw audit

Hosted

In progress

  • Everything in the CLI
  • Hosted dashboard, history over time
  • Shareable PDF report for billing clients
  • Receives only the derived record

Want it when it ships? Leave your email.

Not ready yet. The CLI does the core job today.

Run it on your own logs.

The audit reads what is already on your disk and prints the report. If it finds nothing, you have lost a minute. If it finds the usual, you have found real money.

npx costclaw audit

Reads local logs. Sends nothing. No account.