How numbers are computed
All counts, shares and costs are computed by friskme, not by the model.
- Shares never round a part to 100% or a nonzero value to 0%.
- Tokens count each API response once, including cache reads and writes and subagent runs.
- Claude Code logs one usage record per response, repeated on each line of that response; friskme keeps one per
message.id. - Codex logs cumulative
token_countevents, often repeated unchanged; friskme counts the per-responselast_token_usageonly when the cumulative total changes. Newer Codex builds also logtoken_usage_recordperresponse_id; when a rollout has those, friskme uses them instead. Codex counts cached tokens insideinput_tokens(the OpenAI convention), so friskme splits them out: input isinput_tokens − cached_input_tokens − cache_write_input_tokens, cached tokens are cache reads, and reasoning tokens are already inside output. - Pi logs usage on each assistant message, already split the Anthropic way (input excludes cache reads and writes) for every provider; friskme keeps one per
responseId.cacheWrite1his the 1-hour part ofcacheWriteand the rest is priced as a 5-minute write. friskme also countsusageentries (cache warming), and the usage logged on compactions, branch summaries and tool results. A model id with a provider prefix (anthropic/claude-…) is priced by the part after the slash. Pi’s owncostfield is not used.
- Claude Code logs one usage record per response, repeated on each line of that response; friskme keeps one per
- Dollars are labeled API list-price equivalent, using a rate table bundled with friskme and dated in the report: Anthropic’s for Claude models and OpenAI’s (standard tier, short context) for GPT models. Codex-specific models OpenAI no longer lists (
gpt-5-codex,gpt-5.1-codex,gpt-5.1-codex-max,gpt-5.2-codex) are priced as the base model they shipped with. Models without a rate are named and left out of dollar totals. Most people are on a subscription and do not pay this. - Waste detection is deterministic:
- A loop is a tool pattern repeated 3+ times in a row where at least 2 iterations, and at least half of them, failed.
- Repeated commands are the same shell command (
Bashin Claude Code;exec_command,shellandshell_commandin Codex;bashin Pi) 3+ times in a session.sleeppolling is excluded. - An error streak is 3+ failed tool calls in a row. A Codex tool call failed when its output reports a non-zero exit code; a Pi tool call failed when its result has
isError. - An interrupted ending is a session that ended right after you interrupted the agent.
- Projects are the repo a session ran in. A git worktree counts under its main repo: friskme follows the worktree’s
.gitfile, or, if the worktree is gone, recognizes<repo>/.claude/worktrees/<name>,<repo>/.worktrees/<name>andsuperpowers/worktrees/<repo>/<name>. Any other folder is its own project. - A repeated workflow is 4+ sessions in one intent whose tool mix has cosine similarity ≥ 0.8 with the most typical one.