An AI Coding Cost Tracker Needs a Measurement Contract Agent Island released an AI coding cost tracker that reconstructs token activity from Claude Code and Codex session records, applying a dated model-price table to estimate API value. The tool normalizes provider formats and includes replay protection, but its creator warns the calculated number is a counterfactual estimate, not an invoice. The most dangerous number in an AI coding dashboard is the one labeled cost without a definition. A local tool can reconstruct token activity from Claude Code and Codex session records. It can apply a dated model-price table. That produces an estimate with a clear use: comparing periods and understanding the shape of local activity. It does not produce an invoice. Claude Code and Codex do not write identical usage records. Claude can expose input, output, cache creation, and cache-read fields on assistant messages. Codex can separate model context from later token events, and cached input may be included inside total input. Normalize those formats before calculating anything: provider timestamp model input tokens output tokens cache creation tokens cache read tokens Once that boundary exists, the rest of the report does not need to guess what a raw provider field means. For a Codex event, a safe calculation starts by separating cached input: non-cached input = max total input - cached input, 0 Then price non-cached input, output, cache creation, and cache reads with their own rates. Pricing total input and adding cache reads again creates a precise-looking overcount. This is why a generic tokens price function is not enough for a multi-provider tracker. Session files are read repeatedly. Apps restart. Watchers reconnect. Archived files can reappear. If the same event is counted every time it is observed, the weekly report grows while the underlying work stays unchanged. Replay protection is part of accounting. Use stable provider event identifiers when they exist. If a format lacks one, document the fallback and its uncertainty instead of hiding it behind a polished total. New model identifiers can appear before a desktop app knows their rates. API prices can also change. A tracker should: In Agent Island, the calculated number is labeled API value . It is a counterfactual estimate under the embedded rates. A useful dashboard should not collapse these into one metric: Only the fourth is a bill. The local records do not contain enough context to recreate it. Before trusting an AI coding cost tracker, ask: The implementation can be sophisticated, but the contract should be easy to explain. If the number can be mistaken for money paid, the explanation belongs next to the number. The full measurement contract and current Agent Island scope are in the canonical guide: AI coding cost tracker https://agent-island.dev/ai-coding-cost-tracker/?utm source=devto&utm medium=owned social&utm campaign=ai coding cost tracker 20260726 .