Developer Builds agent-cost Tool to Separate AI Session Tracking from Task Attribution
A developer created agent-cost, a local CLI tool designed to measure Claude Code and Codex usage while keeping session measurement and task attribution as distinct, separate claims. Existing tools like ccusage, token-tracker, and OpenTelemetry stacks were already available, but none enforced a clear boundary between raw usage observation and task-level cost assignment. The tool reads logs already written locally by Claude Code and Codex CLI, normalizes each usage event into auditable facts, and makes no network calls at runtime. Its price catalog carries a version and SHA-256 digest, and machine-readable output can be consumed by other tools or dashboards. Rather than inferring task context from branches or timestamps, agent-cost requires the calling workflow to explicitly supply session IDs, ensuring cost numbers reflect actual observations rather than allocation rules.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in