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