Why do long AI coding sessions cost more?

Compare context, retries, and delegated work to see what drives the cost of a long AI coding session.

Long AI coding sessions get expensive as the agent processes more context or retries work. Delegated work can add to the bill. Look at the bill first. Compare elapsed time with the units billed for each attempt, because a long test wait and a long response from the model can contribute very differently to the final charge.

A migration agent can spend half an hour waiting for a test suite and send very little new text to a model. Another agent can spend ten minutes reading logs and retrying a failed change three times. It might also delegate an investigation. A stopwatch records the first run as longer. Your provider may record more billable activity for the second.

Start with the unit on the bill

Track output for a token-priced API. Separate fresh input from cache hits. Later turns may reuse conversation history. Check the price of a cache hit separately from the price of new input. Anthropic also distinguishes cache writes from reads. Record any separate compute or tool charges shown by the service. A subscription has its own quota and overage charges. Keep those separate from an API-price estimate. OpenAI API pricing · Claude API pricing

Compare two runs on the same task

Pick a repeatable task, such as adding a regression test and fixing the behavior it exposes. Start both attempts from the same commit. Use the same model and acceptance checks. Let one session carry the whole task. For the other, start a fresh implementation session after investigation and give it a short handoff with the failing test and relevant files. Include decisions already made.

Record usage and elapsed time for each attempt. Count retries separately. Note any delegated work. After review, record whether the change passed and how much cleanup it needed. Count unsuccessful attempts in the total. Say you spend $24 in four attempts and two changes pass review. The cost is $12 per accepted change.

Check what splitting actually saved

A fresh chat starts smaller. It can also cause the agent to rediscover a dependency the old session had already found. Repeated file reads after the handoff are a signal to improve the handoff. If delegated agents repeat the same investigation, give each a separate question to answer so you can see whether splitting the work saves time or simply adds another billable response.

Unstoppable Code’s desktop Cost panel is one place to look for charges or estimates associated with chat turns and delegated work. The panel can also show workflow retries. Use the provider’s billing view to reconcile actual charges. Keep unpriced usage visible in the pilot records so it does not disappear from the comparison. Unstoppable Code Cost panel

Cookie preferences

Optional cookies measure ads and feature usage, and improve the site with session recordings. Change anytime. Privacy policy