Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Usage statistics

The usage panel shows how many tokens your agents used today. Detailed usage statistics go further: they count what each project, layer, task and role used. They show what a merged layer costs, how much went into work that was thrown away, and which role uses the most.

Detailed usage statistics are off until you turn them on. They are kept on your computer, and nothing is sent anywhere.

Figure: The Summary tab. Each tile is one figure for the project and range chosen at the top.

Turn them on

  1. Open Settings: press Ctrl+, (Cmd+, on a Mac).
  2. Under Usage statistics, turn on Detailed usage statistics.

Counting starts then. Tokens your agents used before you turned it on are not counted.

To open the statistics, press Ctrl+K (Cmd+K on a Mac) and run Usage statistics…. Or click Open statistics in Settings.

Turning it off stops the counting. What was counted stays, and the sheet still shows it, until you delete it. The time it was off shows as an Off band in the charts.

What is counted, and how

Cuewire reads the same logs as the usage panel: the ones Claude Code, Codex, Copilot CLI and Gemini CLI write on the computer they run on. From each model call it keeps the counts: input, output, cache read and cache write tokens, the model, the time, tool calls and how full the context was. It ties each call to:

  • the terminal that made it, and so its project, canvas, layer and role;
  • the task the agent was working on, found from the task’s banner ([cuewire] Task … from …) when the agent’s prompt hook reports it.

The text of prompts, replies and code is never kept. Only counts and names are. See Privacy below.

A task runs from when its agent starts on it until the agent starts on something else. It also ends with the turn in which the agent answered it. Calls between two tasks still count for the project, layer and role.

Note

Agents started outside Cuewire’s terminals, in a project’s folder, are not in the figures. The Coverage list says how many tokens they used.

Direct conversations

What you type to an agent yourself is a direct conversation. A run of your own prompts in one terminal counts as one. A short “yes” or “go on” doesn’t become a task of its own. It ends when the agent gets a task, when the terminal closes, or after 30 minutes without a turn.

Direct conversations have their own row in the tables and are kept out of the task averages. A turn you interrupted counts as waste. The rest of a conversation never does.

How a task ends

StatusWhen
DoneThe agent answered with cuewire result. A direct conversation is done when its last turn ended normally.
FailedThe agent answered with cuewire result --failed, or the task ran out of its budget.
AbandonedThe sender cancelled it, its terminal closed or its agent stopped while it was open, or Cuewire restarted with it still open. A direct conversation whose last turn you interrupted.
ReplacedAnother task was sent with --replaces in its place.
No resultThe agent went on to the next prompt without answering this one. A result that comes later still counts.
RunningStill open. Running tasks are left out of averages and waste until they end.

Rework

A task that redoes or fixes earlier work is rework. Cuewire doesn’t guess which tasks those are: the sender says so.

  • cuewire ask Builder --rework task-3a-4 "Fix the two findings" marks the new task as redoing task-3a-4. Give the id of the task that produced the work, not of its review.
  • cuewire ask Builder --replaces task-3a-4 "…" sends a task in place of one that is still running. The old one stops and counts as Replaced.

Agents on a canvas are told to use --rework when they send rejected work back. See Agents working together. If nobody uses the flag, the Rework share stays at 0%, however much work was redone.

Cost

Cost is worked out from the tokens at each model’s API list prices, which Cuewire carries in a price table. That is not always what you pay. A subscription, a discount or a plan’s included usage all cost differently. Once its counts are final, a call keeps the price it was given, so a later price change doesn’t change past figures.

A model missing from the price table has no cost. Its tokens are still counted, and costs that leave them out say so. When a later Cuewire’s price table has that model, those calls get its price, once, and their tasks and layers are updated. Calls already added up into daily totals (see Keep, export and delete) are gone, so those totals keep their tokens without a cost.

The Statistics sheet

At the top:

  • Projects: the project of the canvas you are on (shown by its name), or All projects.
  • Range: 7 days, 30 days, 90 days or All.
  • Export… saves the statistics of the projects chosen (see Export).

The sheet has four tabs.

Summary

FigureWhat it means
Total costWhat the tokens would cost at API list prices.
TokensAll tokens, then input, output, cache read and cache write.
Cost per merged layerThe project’s whole cost, divided by the layers merged in the range. Failed work, base-layer work and unmerged layers are in the cost, so it is what a merged layer really took.
Tokens per changed lineThe project’s tokens, divided by the lines added and removed in merged layers. The output tokens per line are shown with it.
Waste shareThe share of tokens, and of cost, spent on tasks that failed, were abandoned or were replaced, and on interrupted turns.
Rework shareThe share of tokens, and of cost, spent on tasks sent with --rework.
Cache hit rateOf the tokens sent to the model as a prompt, the share read from its cache.
CoverageOf the turns Cuewire saw, the share whose usage it found in the logs.

Below the tiles:

  • Where tokens went: tokens by how their task ended, plus direct conversations, the time between tasks, and Not in transcripts (Claude Code’s own count of usage its transcripts leave out, such as the calls it makes for itself).
  • By role, By layer and By agent and model.
  • Coverage: a list of everything that is missing or uncertain (see Lower bounds and estimates).

Layers

One row per layer, the most expensive first: its tokens, cost, roles, how it ended, and, for a merged layer, its lines and tokens per line.

Figure: The Layers tab.

Cuewire finds a layer merged in three ways:

  • Its branch is in the branch it was made from.
  • gh or glab reports its pull request merged.
  • One commit on that branch is exactly the layer’s change applied to the commit before it. That is a squash merge such as git merge --squash, or a one-commit layer cherry-picked or rebased onto it. The layer then shows Merged (squash). Squash detection needs Git 2.40 or newer.

A layer with no commits of its own never counts as merged.

Note

Squash detection has limits:

  • A squash is found only while the layer’s branch still exists and before new commits land on the layer.
  • It is not found when it was edited, had conflicts resolved, or carries other changes too.
  • It is not found when it is more than 500 commits back among those touching the layer’s files.
  • When two layers make the same change, neither is found merged by a squash.
  • The same change made on that branch some other way, such as copied in by hand, also counts.
  • After you delete one project’s statistics, a twin layer in another project on the same repository may be found merged instead.

In those cases, select the right layer and click Mark merged or Mark not merged. Find it out again goes back to finding it by itself.

Tasks

The Kind filter shows Bridge tasks (tasks agents sent each other), Direct conversations or All.

  • Tasks by role: for each role, the tokens and cost of a typical task: the average, the median, the 95th percentile and the largest.
  • Each task: when it started, its role, agent, model and status, its tokens and cost, and how long it took. Then its turns and tool calls, its peak context use, how often its agent compacted its context, and the task it redoes, if any. Only failed, abandoned or replaced narrows the list to the ones that went wrong.

Figure: The Tasks tab.

Trend

Cost and tokens per day (per week over more than 90 days), cost per agent session, and tasks by how full their context got. A task that came close to the model’s limit is the kind that loses detail when its agent compacts.

Figure: The Trend tab. The shaded days were counted with statistics off.

Lower bounds and estimates

The sheet says when a figure is uncertain, rather than show a number that looks exact.

  • — means there is nothing to show: no layer merged in the range, no turns seen, or no known price for any of the tokens. It never stands for zero.
  • At least means some usage is missing, so the real figure is higher. The Coverage list says why, for example:
    • some turns had no usage in the logs;
    • a remote computer’s Cuewire is too old to count, or reads no agent logs;
    • a computer’s store was full, or this computer was away too long, so some statistics were lost (a gap);
    • some tokens have no known price (for cost only).
  • Approximate means Cuewire had to estimate which task or terminal some tokens belong to. That happens when an agent’s prompt hook didn’t report a task: the task is then taken to start when it was delivered. It also happens when a call came before its session was known.
    • A task is marked approximate whenever its start was estimated.
    • A layer, role or project figure is marked approximate when more than 5% of its tokens were estimated. The badge shows the exact share, for example Approximate (8.1% approximate). A share above zero never shows as exact: the smallest is “<0.1%”.

Coverage is the share of turns whose usage was found, for each kind of agent. A total with coverage below 100% is At least.

Remote machines

Statistics include agents on remote projects and other machines. While statistics are on, the Cuewire on each connected computer counts its agents’ usage for you. It keeps the counts only until your computer takes them, every 15 seconds while it is connected. Your computer then ties them to the right project, layer and task, as it does for its own agents.

  • Each desktop turns statistics on or off for itself. Turning them off on one computer doesn’t stop another desktop that has them on.
  • A machine that is not connected when you turn statistics off learns of it when it next connects. What it counted in the meantime is thrown away.
  • A machine keeps counts for a computer that hasn’t connected for 30 days only until then. The Coverage list shows what was lost as a gap.
  • A machine whose Cuewire is too old counts nothing, and the Coverage list says to update it.

Keep, export and delete

Statistics are kept in your data folder, in usage-stats/stats.sqlite. In Settings, under Usage statistics:

  • Each call kept for (90 days unless you change it): how long each call is kept. After that, calls are added up into daily totals and the calls are deleted.
  • Daily totals kept for (365 days unless you change it): how long the daily totals, tasks and layers are kept.

Both take 7 to 3650 days. Over ranges older than the calls, Where tokens went shows fewer kinds, since the daily totals keep only whether a task went well or not.

Some records are kept until you delete the statistics, whatever these settings say:

  • which terminal ran which agent session, each terminal’s role, and when it closed;
  • when prompts, turns and task events happened (never what was said);
  • compactions, the agents’ own totals of a session, and gaps;
  • the projects, their folders and the machines statistics came from.

An archived layer goes with its daily totals. A layer still in use is kept.

Export and delete

  • Export… next to a project, or Export all…, saves four CSV files and a stats.json to a folder you choose. The sheet’s Export… saves the projects chosen at its top.
  • Delete… next to a project deletes that project’s statistics. Delete all statistics… deletes all of them, and connected machines drop what they still hold for this computer. Other computers’ statistics are not touched.

Settings lists a project once it has statistics, so a project you never used with agents isn’t listed.

Deleting can’t be undone, so export first to keep a copy. Each export and delete is written to the audit log.

Figure: Settings: the switch, how long statistics are kept, and each project’s export and delete.

Privacy

Detailed usage statistics keep counts and the names that tie them together:

  • times, models and agent versions;
  • agent sessions, terminals, roles and task ids;
  • project and layer names, and machine names;
  • folder paths, which can include your user name.

They never keep prompts, replies or code. They stay in a database on your computer, and nothing is sent. Each connected machine holds its counts only until your computer takes them. See Privacy and security.

What’s next