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.
Analyses you ask for
Two periods side by side, a timeline of starts, compactions and pauses, sub-agent usage, repeated tool calls, instruction files and unused skills: each is a flag of its own and reads nothing without 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.3.1
Changelog →- CLI: reading the logs shows a progress bar on stderr per source once it takes longer than a second, so the menu and the reports no longer wait on an empty screen with large logs. Nothing is shown when stderr is not a terminal.
- CLI: the text output marks every state with one set of symbols:
➜for a lever or an observed rule,ℹto look at,✔fine or nothing to report,⊝not measurable, and⚠/✖for notes and problems while reading. They replace◆,?,✓,·,!and✗; the JSON output is unchanged. - CLI: on a terminal the log file of an evidence line is a link that opens the file. Pipes and
NO_COLORget the plain path as before. - CLI: compressed Codex rollouts are decompressed on several threads, so reading large Codex logs takes a fraction of the time. The figures are unchanged.
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 of reports on a terminal
agentmeter --report overview # totals, findings and projects in one
agentmeter --report waste # repeats, compactions, sub-agents; reads tool calls
agentmeter --findings # rules with measure, evidence and next step
agentmeter --tool codex --since 7d
agentmeter --compare 7d # the last 7 days next to the 7 before
agentmeter --tool-calls # repeated reads and failures, large outputs
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.