Learning paths / Vibe coding to production / Operate, cost and when to stop

Cost and when to stop

Reading · 5 min · Module 9, lesson 2 of 440 min left in this module

Module 9 · Operate, cost and when to stopLesson 2 of 4

Goal: Keep an eye on both the agent's bill and the platform's, recognise an agent stuck in a loop, and take over by hand.

Key idea

Two bills run while you build with an agent: the agent's, for the work it does, and the platform's, for what you leave running. The costliest failure is neither. It's a loop: the agent trying the same wrong idea again and again. Learn the signs, and take over.

The agent's bill

Agents are paid for by usage or by a subscription with limits. Either way, cost grows with how much the model reads and writes. A long session costs more per turn than a short one, because the conversation so far is part of what it reads each time.

So the habits from earlier modules also save money: a brief instead of back-and-forth, small steps, and a fresh session for each new task. Your tool's usage page shows where the spend went.

The platform's bill

On ComputeSphere, services are billed per spherelet, by shape, and SphereStor volumes by the GB. An agent adds to that when it:

  • scales up to fix something that more copies won't fix, like one slow request;
  • creates extra services or environments while experimenting;
  • leaves test services running after the task is done.

Scaling and creating are changes, so they get your approval (lesson 4.9.1). Before approving a scale-up, ask what the logs say the cause is. Stop services you no longer need, and delete the ones you won't come back to.

Signs of a loop

  • The same error returns after the third "fixed it".
  • The diff keeps growing while the problem stays the same size.
  • It edits a test, skips one or turns off a check to get to green.
  • It undoes a change it made earlier, then makes it again.
  • It wants a new package to work around a problem it can't explain.

When to stop

Set yourself a rule before you start, such as three attempts at the same problem, or twenty minutes without progress. When you hit it:

  1. Stop the session. More attempts in the same context repeat the same idea.
  2. Keep only what you've checked. Commit the good steps; throw away the rest (git restore . discards uncommitted changes).
  3. Write down what you learned: what failed, and why you think it did.
  4. Then choose: a fresh session with a smaller brief that includes those notes, or fix it by hand.

Often the fix the agent kept circling is two lines you can see in the log. Taking over isn't the agent failing, or you failing. Knowing when to do it is part of the job.

Check yourself

The build has failed with the same error after four agent 'fixes'. What now?
The agent proposes going from 1 to 3 spherelets because one page loads slowly. What do you ask first?