I Parsed My Local Claude Code JSONL Logs to Find Out Why My Token Quota Evaporates So Fast
Description and use
Claude Code users experienced rapid token quota depletion due to hidden costs from prompt caching, conversation history, and tool integrations. The author built the CATO plugin to parse local logs, identify three silent token killers, and automatically optimize them, cutting costs by 35‑80 %.
Problem
Claude Code users experience rapid token quota depletion due to hidden token costs in prompt caching, conversation history, and tool integrations.
Outcome
CATO reduced token costs by 35‑80% by preventing cache rewrites, pruning noisy output, and compressing large MCP responses, while providing instant audit and live monitoring.
Workflow
- Parse .jsonl logs to identify token consumption per turn, tool call, and cache event.
- Discover three silent token killers: 5‑minute cache cliff, turn‑5 compound interest, and fixed overhead from MCP servers.
- Build CATO plugin to run inside Claude Code, tracking cache TTL, pruning noisy output, and compressing large MCP responses.
- Install CATO via /plugin install cato.
- Run /cato-import to audit past sessions and /cato-doctor to check for leaks.
- Use live cache countdown and expensive‑prompt guard to avoid costly rewrites.
- Leverage BM25 sandbox for large MCP responses and Git‑aware read blocking for noisy files.
Evidence
I wanted something that runs 100% inside Claude Code's native process (zero Python, zero external processes per hook, zero network calls, zero telemetry) and protects the entire session lifecycle.
CATO cuts Claude Code token costs by 35-80% with prompt-cache TTL tracking, pre-read structural indexing, noisy CLI pruning, and multi-session subagent ledger.
On standard API keys (and subagents), the cache TTL is 5 minutes (60 minutes on subscriptions). If your context is at 300k tokens and you pause for 6 minutes to test your app in the browser, your very next prompt forces a 100% full cache rewrite at 12.5x the warm-read price.
- Record date: 2026-11-01T06:29:39.185Z