Developer spends $402 on one AI ticket, builds fix to track per-turn costs accurately
A software team lead at Oizom discovered that a single ticket on his AI-powered board had accumulated $402 across nine agent runs, with no cost visibility in the app. The issue stemmed from how Claude Code reports total_cost_usd as a cumulative session total rather than a per-run figure, causing naive readings to double-count earlier runs. To fix this, the open-source orchestrator was updated to subtract the previously saved session total from the new one at the end of each turn, isolating the actual spend per run. Edge cases such as new sessions, resumed sessions, and runs that exit without a result line were all accounted for in the revised logic. The solution was implemented in the project's ticket-tracker orchestrator, which manages headless Claude Code sessions for AI agents acting as board members.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in