Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I Parsed My Local Claude Code JSONL Logs to Find Out Why My Token Quota Evaporates So Fast

Описание и применение

Пользователи Claude Code столкнулись с неожиданным ростом затрат на токены из-за скрытых расходов на кэширование запросов, историю диалога и интеграцию инструментов. Автор создал плагин CATO, который анализирует локальные логи, выявляет три скрытых источника потерь токенов и автоматически оптимизирует их, снижая расходы на 35‑80 %.

Задача

Claude Code users experience rapid token quota depletion due to hidden token costs in prompt caching, conversation history, and tool integrations.

Результат

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.

Рабочий процесс

  • 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.

Доказательства

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.

Источник

  • Дата записи: 2026-11-01T06:29:39.185Z