CostClaw

CostClaw

Audit Claude Code token usage and workflow signals from local logs

Gallery

About CostClaw

CostClaw is a local audit tool for understanding how Claude Code sessions use tokens and where a setup may be creating avoidable cost. It reads the JSONL session logs already stored under the user's Claude directory, including subagent and workflow logs, then prints a report in the terminal. There is no account requirement for the audit and the free CLI doesn't upload the logs. Its main value is turning a pile of session records into a compact view of estimated API-equivalent value, cache behavior, model mix, tool use, session timing, and configuration signals. It is aimed at developers who use Claude Code enough that intuition and a monthly total no longer explain which habits are expensive.

The audit runs in three stages. First, CostClaw parses the local logs in memory. It then derives summaries from logged token fields using dated list prices for the reported models, deduplicating repeated cumulative updates before it calculates totals. The derived data includes cache hit rate by turn, tool activity, session timing, and estimated value by model. Finally, a rule-based scorer reviews six pillars covering CLAUDE.md quality, context hygiene, prompting patterns, session management, tool and MCP configuration, and cost discipline. If the evidence for a pillar isn't present, the report marks it as unavailable rather than filling the gap with a guess. The finished audit can be read in the terminal or exported as an HTML report, score card, and README badge.

CostClaw focuses on several patterns that are hard to see in a single billing number. It estimates cache-miss exposure by comparing logged usage with a cache-read counterfactual, which can show when repeated context was priced like fresh input. It counts reactive tool loops that repeatedly call the same operation, flags short tasks that may merit review for a cheaper model, and tracks long sessions whose cache reuse falls as the context grows. Its Burn Clock groups estimated value by local day and time so a user can see when usage accumulates. Findings are ranked by modeled exposure and paired with the evidence behind them, giving the developer a review queue instead of an undifferentiated wall of warnings. It is most useful after enough sessions have accumulated to expose patterns that a single run cannot show.

The limits of those numbers matter. CostClaw doesn't reconcile an Anthropic invoice, prove which provider served a model, know every discount or billing modifier, or guarantee that switching models will preserve task quality. Its dollar figures are list-price estimates and counterfactual scenarios based on fields in the logs. They aren't a promise of cash savings or a statement about subscription quota. That makes the tool best suited to investigation and workflow tuning, not accounting. An individual developer can use it to decide whether to compact a long session or improve a CLAUDE.md file. A team lead or consultant can use the same report to discuss model routing, repeated tool calls, and the rhythm of usage with concrete evidence.

Privacy is handled by keeping raw material on the machine. Prompts are analyzed locally, while prompt text, source code, and file paths are dropped from the derived AuditRecord that the product can save. The site describes build tests that insert recognizable prompt and path markers into sample logs, run the pipeline, and fail if those markers survive into the derived record. The free CLI sends nothing to a hosted service. A future hosted dashboard is planned to receive only that reduced record for history and sharing. This design still requires the user to trust and inspect software that reads local Claude logs, but it gives the boundary a specific implementation and test instead of relying only on a broad privacy promise.

The core audit is free and can be run with npx, so it is easy to try on existing logs without creating an account. CostClaw also sells a $39 one-time license for an optimize command. That paid command scans a project and produces five local artifacts, including a filled-in CLAUDE.md, a ranked fix playbook, suggested settings, a work order for Claude Code, and a browser dashboard that compares the token receipt and configuration before and after. The hosted plan is still in progress, so buyers who need shared history or a client-ready hosted reporting workflow have to wait. For current users, the appeal is narrower and practical. It provides an offline way to inspect Claude Code usage, test cost assumptions, and leave with a prioritized set of setup changes rather than another generic optimization checklist.

Key Features

  • Local Claude Code log parsing
  • Dated list-price usage estimates
  • Six-pillar rule-based setup score
  • Cache and tool-loop analysis
  • Time-based Burn Clock view
  • HTML reports and README badges

Pros & Cons

What we like

  • Runs the core audit entirely on-device
  • Explains estimates and their limits clearly
  • Ranks findings by modeled cost exposure
  • Requires no account for the free CLI

Room for improvement

  • Limited specifically to Claude Code logs
  • Estimates don't reconcile the actual invoice
  • Hosted history and sharing are not ready
  • Optimization artifacts require a paid license

Frequently Asked Questions

What is CostClaw?
CostClaw is a local CLI that analyzes Claude Code session logs and reports estimated token value, cache behavior, tool patterns, session timing, and setup scores. It is an auditing aid, not an invoice reconciliation service.
Does CostClaw upload prompts or code?
The free audit runs locally and sends nothing to a hosted service. CostClaw says prompt text, code, and file paths are removed from its derived AuditRecord, with build tests checking that selected private markers don't survive.
Is CostClaw free?
The core audit CLI is free and doesn't require an account. A $39 one-time license unlocks the optimize command, while a hosted dashboard with history and sharing is still in progress.
Are CostClaw's dollar figures the same as an invoice?
No. The tool applies dated API list prices to token fields found in local logs and models counterfactual scenarios such as cache-miss exposure. Provider discounts, subscription inclusion, model provenance, and other billing details can make the actual invoice different.

Best For

Auditing Claude Code usage across projectsInvestigating cache misses in long sessionsReviewing model choices and repeated tool callsImproving local Claude Code configuration

Featured in

Alternatives to CostClaw

Reviews (0)

No reviews yet

Be the first to share your experience with CostClaw

Sign in to write a review

Badge builder

Add CostClaw to your website

Choose a badge style and size, preview it here, then copy the generated HTML. Badge images are self-contained SVGs and do not require an external script.

CostClaw badge preview
<a href="https://toolindex.net/tools/costclaw?ref=badge" target="_blank" rel="noopener">
  <img src="https://toolindex.net/badge/costclaw/medium.svg" alt="CostClaw - Listed on Tool Index" width="180" height="50" />
</a>

How to use the badge

  1. 1. Pick the style, size, and theme that fit your layout.
  2. 2. Copy the generated HTML from the code block.
  3. 3. Paste it into your footer, homepage, or press page.

Standard badge available

The standard listing badge is available now. Score and circle badges are limited to tools currently ranked in the top 10 of a category.

Badge clicks return visitors to this profile with a referral tag so the source remains identifiable.