{"slug": "a-5-column-csv-that-stops-your-ai-agents-from-silently-burning-money", "title": "A 5-column CSV that stops your AI agents from silently burning money", "summary": "A developer published a five-column CSV schema for tracking autonomous agent runs, logging run_id, agent_role, tokens_in/tokens_out, cost_usd and outcome to attribute spend per run and per task. The writeup argues that untracked runs, not model pricing, drive agent cost problems, and that runs ending in no_action often account for 20-40% of spend in loops that re-read state without acting. The schema is packaged as a Notion database template and CSV starter sold on Gumroad for a minimum of $1.", "body_md": "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.\n\nHere is the minimal tracking schema I use for every autonomous agent run. You can start with just a CSV.\n\n| column | why it matters | \n|---|---|\n| `run_id` | lets you join logs, costs and outcomes | \n| `agent_role` | which agent spent the money | \n| `tokens_in / tokens_out` | the raw driver of cost | \n| `cost_usd` | computed at write time, not at month end | \n| `outcome` | `shipped` ,`no_action` ,`failed` ,`retried` | \n\n`cost_usd` divided by the count of `outcome = shipped`. If it is rising, your agents are getting less efficient.` outcome = no_action`. This is pure waste, and it is often 20-40% of spend in loops that re-read state without acting.\n\n``` python\nimport csv, time, pathlib\n\nPATH = pathlib.Path('agent_runs.csv')\n\ndef log_run(run_id, role, tin, tout, cost, outcome):\n    new = not PATH.exists()\n    with PATH.open('a', newline='') as f:\n        w = csv.writer(f)\n        if new:\n            w.writerow(['ts','run_id','role','tokens_in','tokens_out','cost_usd','outcome'])\n        w.writerow([time.strftime('%Y-%m-%dT%H:%M:%S'), run_id, role, tin, tout, round(cost, 4), outcome])\n```\n\nCall it in a `finally` block so failed runs are recorded too. Failed runs are where the money hides.\n\nI 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](https://renevibe76.gumroad.com/l/ptfvli) (pay what you want, minimum $1).\n\nThe CSV approach above is fully enough to get started, though. The habit matters more than the tool.\n\nWhat do you track per agent run? I am curious whether anyone measures cost per *useful* outcome rather than cost per call.", "url": "https://wpnews.pro/news/a-5-column-csv-that-stops-your-ai-agents-from-silently-burning-money", "canonical_source": "https://dev.to/renev3408/a-5-column-csv-that-stops-your-ai-agents-from-silently-burning-money-3o98", "published_at": "2026-10-15 22:39:03+00:00", "updated_at": "2026-10-15 22:58:52.297226+00:00", "lang": "en", "topics": ["ai-agents", "mlops", "ai-tools"], "entities": ["Notion", "Gumroad"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/a-5-column-csv-that-stops-your-ai-agents-from-silently-burning-money", "markdown": "https://wpnews.pro/news/a-5-column-csv-that-stops-your-ai-agents-from-silently-burning-money.md", "text": "https://wpnews.pro/news/a-5-column-csv-that-stops-your-ai-agents-from-silently-burning-money.txt", "jsonld": "https://wpnews.pro/news/a-5-column-csv-that-stops-your-ai-agents-from-silently-burning-money.jsonld"}}