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.
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).
~/.claude/projects/*/*.jsonl
~/.codex/sessions/*/*.jsonl
agy --output-format stream-json
.jsonl agent transcripts herePrompt-Cache Mirage Check (Apparent vs Effective Hit Rate)
Provider dashboards count cached re-reads of bloated >80k tails & retry loops as "hits".Turn-by-Turn Token & Cache Timeline
agent-token-forensics on GitHub or install the CLI in one command:
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.
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.
Local Forensics & Killswitch 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
Integrity Pro
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
Integrity Team
Zero per-seat or per-trace overage traps. Cuts redundant agent test loops & uncompacted tails across your whole team.
- +Up to 15 connected hosts & 30 scoped agent sub-keys
- +Central Killswitch, per-vendor & per-scope browser toggles
- +Cryptographic JIT GO-Tokens for privileged writes
- +JSON/CSV Audit Timeline + HMAC Witness export
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.
Offline MCP skill pack for production coding-agent reliability.
Complete 4-skill offline MCP governance bundle, lifetime access.
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 Family | Input | Output | Cache Read | Cache 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
Bashruns) 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_resultpayloads ≥24 KB or single-turn +15k context jumps after tool calls, plus their compounding re-read cost across remaining turns.