Cost Transparency
The two scarce resources of an agent loop are wall-clock and tokens/context. Make them visible on heavy steps; silence on small steps.
When to surface cost
- A step runs longer than ~30 seconds.
- A step consumes a surprising amount of context (a big file read, a verbose command output).
- A step is being repeated (loop iteration) — show the per-iteration cost so drift is visible.
- A long-running background command (build, test, deploy) returns — report its elapsed time alongside its result.
The shape
Inline, one line, no ceremony:
Wired api telemetry routers (7m 4s · ↑ 14.7k tokens)
- Time first, tokens second.
- For background commands, the elapsed time comes from the shell task metadata.
- For context use, it's an estimate — "↑ 14.7k tokens" is fine; don't fake precision you don't have.
When NOT to surface cost
- Sub-second edits — noise.
- Routine reads/greps — noise.
- Every single step in a fast sequence — only surface the aggregate if the sequence as a whole was expensive.
Why it earns its keep
- User side: a step that took 7m once and is about to be repeated 5× is a 35m problem. Visible cost lets the user catch that before it happens.
- Agent side: if wiring routers cost 7m and 14.7k tokens last time, the agent should not blindly re-run that pattern; it should look for a cheaper path (targeted edit, cached result, smaller read).
Anti-patterns
- Fake precision: "7m 04.312s" — you don't have that resolution; round.
- Cost without action: reporting a 7m step and then casually repeating it. The report should change behavior.
- Cost on every micro-step: trains the user to ignore the signal.