friskme

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_count events, often repeated unchanged; friskme counts the per-response last_token_usage only when the cumulative total changes. Newer Codex builds also log token_usage_record per response_id; when a rollout has those, friskme uses them instead. Codex counts cached tokens inside input_tokens (the OpenAI convention), so friskme splits them out: input is input_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. cacheWrite1h is the 1-hour part of cacheWrite and the rest is priced as a 5-minute write. friskme also counts usage entries (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 own cost field is not used.
  • 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 (Bash in Claude Code; exec_command, shell and shell_command in Codex; bash in Pi) 3+ times in a session. sleep polling 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 .git file, or, if the worktree is gone, recognizes <repo>/.claude/worktrees/<name>, <repo>/.worktrees/<name> and superpowers/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.