PulseAugur
EN
LIVE 05:51:31

AI coding assistants log token usage locally, revealing efficiency metrics

A developer has discovered that AI coding assistants like Claude Code and Codex locally log detailed token usage data, including input tokens, cache hits, and output tokens. This information is available on the user's machine without requiring API calls or provider dashboards. The author explains how to access and interpret these logs, emphasizing the importance of the prompt cache hit rate as a key metric for efficiency. A tool called ModelMeter has been developed to collect this local log data and present it on a dashboard, providing insights into token consumption and cache performance. AI

IMPACT Developers can now monitor their AI coding assistant's token usage and cache hit rates locally, enabling better cost management and efficiency.

RANK_REASON The item describes a tool (ModelMeter) that leverages existing local logs from AI coding assistants to provide usage insights.

Read on dev.to — LLM tag →

AI-generated summary · Google Gemini · from 1 sources. How we write summaries →

COVERAGE [1]

  1. dev.to — LLM tag TIER_1 English(EN) · Rob ·

    Claude Code and Codex are logging your token usage locally. Here is how to read it.

    <p>Your AI coding agent's token data is already on your machine. You just haven't looked at it yet.</p> <p>Claude Code and Codex both write local logs after every session. Those logs include detailed token breakdowns: uncached input, cache hits, cache writes, output. No API call …