Skip to main content

Coding Agent Spend

Every night, prices your coding agents' token usage by type, compares repositories on cost per merged PR, finds where the tokens go, and opens the fix as a pull request.

How it works​

  1. Runs when: every night, over the last seven days of coding-agent sessions.
  2. Prices correctly: each token type at its own rate. Cache reads are most of the tokens and a tenth of the price. The total must match the tool's own cost figure within 3%, or it stops and says so.
  3. Compares fairly: repositories by cost per merged pull request, not by total spend.
  4. Finds the sink: where tokens went, by tool and by path, and the largest sink in each repository.
  5. You get: a pull request per fix: an ignore rule for generated or vendored code, or a settings change benchmarked on the team's own tasks first, with pass rate, cost and time for every setup tested.

What it needs​

  • Datadog: read coding-agent usage
  • GitHub: read merged pull requests, open fixes
  • Slack (optional): post the summary