r/OpenaiCodex • u/Specific_Shock_3465 • 2d ago
Showcase / Highlight Built a zero-dependency local Codex usage & cache-savings auditor (fixes inclusive cached_input_tokens double-counting across Host + WSL2)
I noticed many local usage trackers sum OpenAI Codex's input_tokens and cached_input_tokens separately — even though Codex's input_tokens is inclusive of cached input (unlike Anthropic/Claude Code, where cache reads are disjoint). On heavy sessions that inflates token counts and breaks cost/cache-hit estimates.
So I built Agent Usage Radar (v1.1.2) — a pure Node.js 24 (node:sqlite, zero npm dependencies, 100% local read-only, Zero-PII) CLI, local loopback GUI, and stdio MCP server that audits Codex alongside Claude Code, Antigravity, Hermes (WSL2), Cursor, and Cline/Roo:
- Exact inclusive-vs-disjoint cache math: subtracts
cached_input_tokens+cache_write_input_tokensfrom Codexinput_tokensand handles compaction segment resets cleanly - Date-range filtering:
--from YYYY-MM-DD --to YYYY-MM-DDin CLI plus interactive presets (Today / 7d / 30d / This Month / Custom) in the local UI - Lock-free Host + WSL2 SQLite WAL reads + identity-keyed ledger that survives rolling JSONL rotation
Quick read-only try (free MIT CLI):
- GitHub (
78/78tests passing): https://github.com/augustfu-droid/agent-usage-radar - npm: https://www.npmjs.com/package/agent-usage-radar
1
u/ChemicalExcellent463 2d ago
i counted 38 billion tokens for october through the 28th from claude code and codex logs on one machine. how much did double-counting cached input inflate the totals in the sessions you checked?