Skip to main content
BlackBadHope
Back to Selected Systems

agent-token-forensics

v0.1.1 Agent Observability & Forensics MIT 2026

Read-only offline JSONL trace analyzer and zero-upload browser auditor exposing prompt-cache bust cliffs, compaction inflection points, and retry loops burning 30–55% of agent quota.

View on GitHub PyPI Package Open Live Tool
pip install agent-token-forensics
Verified tests
39 pass
Quota waste exposed
30–55%
Trace case study
232 turns
Server uploads
0 bytes

System Topology

A strictly read-only CLI and 100% client-side zero-upload browser auditor that parses raw agent JSONL session transcripts to separate apparent vs. effective prompt-cache hit rates, pinpoint cache-bust cliffs, and surface compaction inflection points.

Raw JSONL Traces Local session logs Strictly read-only Python Stdlib CLI 0 deps · MCP (Glama) 39 passing tests Zero-Upload Browser integrityharness.dev 0 bytes sent to network Forensic Report Apparent: 97.4% Effective: 10.9% Cliffs & retry loops

Constraint & Failure Mode

Headline prompt-cache hit percentages hide catastrophic prefix invalidations, silent compaction cliffs, and retry loops that quietly burn 30–55% of long-session token budgets.

Mechanical Architecture

  • Read-only JSONL streaming parser built in pure Python 3.10+ stdlib computes turn-by-turn cache prefix continuity, effective vs. apparent hit ratio, and compaction drift.
  • Mirrored zero-upload browser engine at integrityharness.dev/token-audit executes 100% locally in the browser — sensitive transcripts never leave the operator machine.
  • Detects idle cache-eviction cliffs, uncompacted context bloat, and repetitive tool retry spirals with actionable turn-level timestamps.

Engineering Trade-Offs

  • Strictly read-only architecture never modifies session logs or hooks into model providers, guaranteeing zero runtime overhead during coding sessions.
  • Client-side FileReader parsing caps ultra-massive logs to browser memory limits in exchange for absolute zero-upload privacy.