CASOON Open Source
See where your agent tokens go.
agentmeter reads the session logs Claude Code and Codex already write to your disk and explains your usage: context size, cache rebuilds, session length, the size of the first request. Each number comes with its evidence and what it does not prove. Read-only, local, no network; only --probe starts another program, Claude Code itself.
cargo install agentmeteragentmeter · Claude Code · last 7 days
READ
✓ logs 1,299 files, 856,227 lines from ~/.claude/projects · version
2.1.170 – 2.1.309
✓ observed 2026-06-14T17:33:36Z – 2026-10-30T19:35:35Z · 130,425 requests in all
✓ quality every line readable
✓ rules 5 of 5 measurable in this source
✓ probe /context in 4 of 4 places (empty directory, web-casoon-dev, kestrel,
chartlet); answered locally, no model request · claude -p /context
--no-session-persistence --output-format json
FINDINGS ? 3 to look at ✓ 1 fine ✓ 1 nothing found
────────────────────────────────────────────────────────────────────────────────────────
? baseline-load look at it · notice · observed · v1
⇒ today's configuration is 34k of the median start 79k (43 %); 34k more is in every
start (front end, project instructions, a short first prompt) and 11k varies per
session; 146 of 146 starts came from claude-desktop, whose own instructions and
tools /context in the CLI does not see; project kestrel adds 8k (project
instructions or MCP servers)
spread of session starts ├──┃━━───────┤
smallest 68k · quartiles 76k / 87k · median 79k · largest 114k
median start, split ██████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░ 79k
█ configuration (/context, empty directory) 34k
▓ rest of the smallest start 34k
░ varies per session (median minus smallest) 11kWhat it does
Context, not only cost
A high cache share hides large contexts: every request rereads them. agentmeter shows how much of your input comes from requests above 500k.
First-request size
How large a session already is before you type anything. Growth over time points at configuration, but the logs cannot say which part.
Cache rebuilds
Large cache writes after a pause, with the cause marked unknown when the logs do not show it.
Data gaps stated
Observed period, files without usage, unreadable entries and rules a source cannot support are listed, so "no findings" never hides "no data".
Generated at build time
All examples →agentmeter Claude Code last 7 days requests 30,590 sessions 135 input 7.9 G tokens cache read 98 % output 23.0 M tokens compactions 30 (auto 30, manual 0) projects by input chartlet 21 % kestrel 17 % web-casoon-dev 13 %
Summary view with figures from one author's Claude Code logs over seven days. The tool is in early development.
examples/summary.ansiNew in v0.1.1
Changelog →- CLI: text output stays within the terminal width, at most 88 columns: evidence lines and long paths break after
/and before·with an indent, and the sessions and projects tables shrink their bars instead of spilling over (#2).
Quickstart
Install it, run it. On a terminal it opens a menu; with a flag or in a pipe it prints text.
- Install with
cargo install agentmeter, or take a binary from the GitHub releases. - Run
agentmeterand open a row, or name a view:agentmeter --findings. - Narrow it with
--tool codex,--since 7dor--project <name>.
agentmeter # menu on a terminal
agentmeter --findings # rules with measure, evidence and next step
agentmeter --tool codex --since 7d
agentmeter --json # the same data, one entry per source
agentmeter --check data-quality # exit 1 on unreadable or missing dataFrequently asked questions
How is this different from tools like ccusage?
Existing tools aggregate tokens and cost. agentmeter derives hints from the same logs and states how sure each one is. Claude Code has its own /usage recommendations; agentmeter adds a view across sessions and across Claude Code and Codex, and shows data gaps.
Which agents are supported?
Claude Code and Codex CLI are the targets. Other agents are possible later because every source is its own adapter.
Can it show my remaining subscription quota?
No. Subscription limits are not stored locally, so agentmeter cannot know how much of a quota is left.
Is it released?
Yes, as 0.x: on crates.io and as signed binaries for macOS and Linux on the GitHub releases. Output and JSON may still change between minor versions; the changelog lists every change.