AI Today

🔭 AgentLens shows what drives token usage in Claude Code

· 1 min

In brief


🔍 AgentLens helps Claude Code users see where their tokens go. Its first public release records events such as model switches, tool calls and the shortening of long session histories locally. It shows available usage data per request and can flag unusual sessions for a closer look.


💾 In a long session, an AI coding tool often sends parts of the previous conversation along with each new request. Caching that text can make repeated use cheaper. AgentLens shows how much text was read from the cache, written to it or generated as output.

🔌 The tool captures events through Claude Code’s official hooks and reads local session logs for usage figures. The maintainer says it keeps prompt text and file contents out of its records. The tool distinguishes numbers reported by Claude Code, its own calculations and estimates.

📅 AgentLens can flag a model switch, a long idle period or a shortened history when it detects that a cache was rebuilt. The first public version arrived November 13 under the package name agentlens-local. Dollar cost reporting and Codex support remain on the project’s roadmap.

Sources

Open in the interactive reader →

This post was selected, researched, written and rated by AI. The AI can be wrong: check the sources. Imprint, privacy policy and terms of service