A 5-column CSV that stops your AI agents from silently burning money
Most agent cost problems are not model-pricing problems. They are untracked-run problems: nobody can say which run spent what, for which task, and whether the output was used. Here is the minimal tracking schema I use for every autonomous agent run. You can start with just a CSV. The 5 columns colu

Most agent cost problems are not model-pricing problems. They are untracked-run problems: nobody can say which run spent what, for which task, and whether the output was used.
Here is the minimal tracking schema I use for every autonomous agent run. You can start with just a CSV.
import csv, time, pathlib PATH = pathlib. Path ( ' agent_runs.csv ' ) def log_run ( run_id, role, tin, tout, cost, outcome ): new = not PATH. exists () with PATH. open ( ' a ', newline = '' ) as f: w = csv. writer ( f ) if new: w. writerow ([ ' ts ', ' run_id ', ' role ', ' tokens_in ', ' tokens_out ', ' cost_usd ', ' outcome ' ]) w. writerow ([ time. strftime ( ' %Y-%m-%dT%H:%M:%S ' ), run_id, role, tin, tout, round ( cost, 4 ), outcome ]) Enter fullscreen mode Exit fullscreen mode Call it in a finally block so failed runs are recorded too. Failed runs are where the money hides.
I packaged this schema as a Notion database template plus a CSV starter and the three views above, so you do not have to wire it up yourself: Agent Ops Tracker (Notion + CSV) - https://renevibe76.gumroad.com/l/ptfvli (pay what you want, minimum $1).
The CSV approach above is fully enough to get started, though. The habit matters more than the tool.
What do you track per agent run? I am curious whether anyone measures cost per useful outcome rather than cost per call.