This Slash Command Was Quietly Costing Me $800 a Day

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

A developer discovered their custom /ship slash command was generating $800/day in AI agent costs due to a polling loop pattern. When an agent watches CI pipeline status, each poll appends output to the growing context window, making every subsequent call more expensive than the last. The cost compounds further with Claude Opus's short cache window and flaky tests that trigger retries. The fix is to avoid in-context waiting by using webhooks, longer poll intervals, or a cheaper model to summarize state between checks.

6m read timeFrom blog.kilo.ai
Post cover image
Table of contents
The workflowHow the cost actually accumulatesWhat the curves showThe worst case is Opus plus flaky testsWhat to look for in your own setup

Sort: