100% OFFLINE BROWSER AUDITOR · ZERO UPLOAD · CLAUDE CODE · CODEX CLI · GEMINI

See Which Turns Burned Your Coding Agent Budget (100% Offline).

Drop one or more local .jsonl logs from Claude Code, Codex CLI, or Gemini. Computes turn-by-turn USD spend, apparent vs effective prompt-cache hit rate, and concrete waste from prompt-cache busts, retry loops, uncompacted >80k tails, and oversized tool outputs.

★ Star on GitHub (MIT) PyPI: agent-token-forensics
pipx install agent-token-forensics
uvx agent-token-forensics
100% client-side JS. Disconnect your Wi-Fi and drop a .jsonl file: 0 bytes ever leave your machine.

Parsed strictly in browser memory with the native File API and /token-audit-engine.js. Zero uploads, zero telemetry, zero outbound requests during analysis (verify in DevTools Network tab).

Typical local log paths: ~/.claude/projects/*/*.jsonl ~/.codex/sessions/*/*.jsonl agy --output-format stream-json
token-audit-engine.js · local FileReader · 0 outbound requests
ZERO-EGRESS OFFLINE
Drop one or more .jsonl agent transcripts here
Supports Claude Code, Codex CLI, Gemini, Antigravity, and generic JSONL. Multi-file drop supported; malformed lines are skipped safely.
No log handy? Try instant offline samples:
—
Total Session Spend
$0.00
0 turns · 0 ctx tokens
Estimated Wasted Spend
$0.00
0.0% recoverable waste
Peak Turn Context
0 tok
0k inflection · 1-dev 20d pace
Effective vs Apparent Cache Hit
0.0%
Apparent: 0.0%

Prompt-Cache Mirage Check (Apparent vs Effective Hit Rate)

Provider dashboards count cached re-reads of bloated >80k tails & retry loops as "hits".
Apparent Cache Hit
0.0%
Effective Cache Hit
0.0%

Turn-by-Turn Token & Cache Timeline

Cache Read Cache Write Uncached Input 80k Compact Threshold
Hover or focus any turn bar to inspect exact token counts, cache hit ratio, cost, and waste flags.
Run this audit locally across every session or in CI (0 runtime deps, MIT). Star agent-token-forensics on GitHub or install the CLI in one command:
★ Star on GitHub PyPI
pipx install agent-token-forensics
uvx agent-token-forensics

97.4% dashboard cache hit hid $12.06 of waste in one session.

I run coding agents daily on a Windows/Linux ISP ops repo. One real 232-turn marathon session reported a 97.4% headline prompt-cache hit rate, yet still burned $16.01 because context rode up to 352.7k tokens without compacting, hit 6 retry loops, and re-read 2 oversized tool dumps.

Built this client-side parser and the MIT Python CLI (agent-token-forensics v0.2.0, 0 runtime deps, 41 tests) so I could inspect raw local .jsonl logs without uploading private repo context anywhere.

Apparent vs Effective Hit
97.4% vs 10.9%
Recoverable Waste
$12.06 / $16.01 (75.3%)
Peak Context / Turns
352.7k tok · 232 turns
Detectors Fired
2 busts · 6 loops · 2 blobs
Real 232-turn coding agent JSONL audit showing 97.4% apparent vs 10.9% effective cache hit rate and $12.06 recoverable waste
Actual output of this page on a sanitized 232-turn local transcript (token counts & timestamps only, 0 bytes uploaded).

Run It in Your Terminal, CI, or MCP (MIT, 0 Deps).

The browser auditor and local Python CLIs are free and MIT forever. If you also want multi-host killswitch toggles, signed cloud audit trails, or Telegram/Slack panic alerts across machines, optional flat tiers are below.

Free Forever · MIT Open Source

Local Forensics & Killswitch CLI

$0 / local MIT CLI

Audit entire ~/.claude & ~/.codex folders locally and install OS-level loop & process-ancestry brakes.

pipx install agent-token-forensics
pipx install integrity-killswitch
pipx install integrity-evidence-gate
Solo Power User · Instant Checkout

Integrity Pro

$19 / month

Web Fleet Dashboard, Cloud Witness, and instant Panic alerts across up to 3 developer machines.

  • +Up to 3 hosts (Win / Linux / macOS) + 5 scoped sub-keys
  • +Cloud Fleet Dashboard & 1-click Big Red PANIC
  • +Tamper-evident HMAC-SHA256 Cloud Witness chain
  • +Telegram & Slack/Discord instant loop & panic alerts
Start Integrity Pro ($19/mo) →
One-Time Lifetime Pack · Zero Subscriptions

Prefer Offline MCP Skill Packs Without Recurring Billing?

Skip the Cloud Dashboard and multi-host sync — grab our one-time lifetime offline MCP governance & reliability skill bundles directly on Agensi.

All one-time packs & individual skills: Agensi Storefront (BLACKHOPE) →
Reliability Suite
$35 one-time

Offline MCP skill pack for production coding-agent reliability.

Get Reliability Suite ($35) →

Deterministic Pricing Table from agent-token-forensics.

Same deterministic math as the open-source Python CLI (v0.2.0, 41 tests, 0 runtime deps). Every dollar figure maps directly to logged token counts and public API list rates (USD per 1M tokens), not your live invoice.

Reference Pricing Table (USD / 1M Tokens)

Model FamilyInputOutputCache ReadCache Write
Claude Opus$15.00$75.00$1.50$18.75
Claude Sonnet$3.00$15.00$0.30$3.75
Claude Haiku$0.80$4.00$0.08$1.00
GPT-4o$2.50$10.00$1.25$2.50
Codex / o3$2.00$8.00$0.50$2.00
Gemini Pro / Flash$1.25$10.00$0.31$1.25

How the 4 Waste Detectors Work

  • D1Prompt-Cache Busts: Flags any turn ≥10k context where cache-hit ratio drops below 30% immediately after a warm (≥70%) turn (up to 12.5× per cached token).
  • D2Consecutive Retry / Bash Loops: Flags ≥3 consecutive turns executing the exact same tool signature (e.g. repeated failing Bash runs) and quantifies redundant repeats 2..N.
  • D3Uncompacted Context Tail (>80k): Identifies the exact turn crossing 80,000 tokens and models realistic 85%-capture savings from compacting down to a 20k working baseline.
  • D4Oversized Tool Output Blobs: Detects raw tool_result payloads ≥24 KB or single-turn +15k context jumps after tool calls, plus their compounding re-read cost across remaining turns.