Three stop rules for AI coding agents (copy-paste prompts)
Left alone, a capable coding agent tends to keep going. It finishes your task, then notices three other things worth "improving", and soon you are paying for work nobody asked for. The fix is not a smarter model. It is a clear stopping rule. Here are three you can paste into your instructions, and

Left alone, a capable coding agent tends to keep going. It finishes your task, then notices three other things worth "improving", and soon you are paying for work nobody asked for.
The fix is not a smarter model. It is a clear stopping rule. Here are three you can paste into your instructions, and when to use each.
Do ONLY the task marked TODAY in the state file. Once its definition of done is met and you have verified it once, update the state file and stop. Do not start another task.
The key phrase is "verified it once". It prevents both extremes: stopping without checking, and checking forever.
Use it for longer or open-ended tasks. Stop at whichever comes first:
Stop as soon as the first of these happens: (1) the definition of done is met, (2) 60 minutes have passed, (3) three failed attempts on the same problem. In case (3), mark the task BLOCKED in the state file, describe what you tried, and stop. Do not keep retrying.
The third limit matters most. Without it, an agent stuck on a hard bug will happily burn through your budget trying variations of the same idea.
If nothing in the requirements or the inputs has changed since your last run, do nothing and say so in one line.
This turns a daily trigger into something cheap: most days it costs almost nothing, and it only works when there is something to work on.
All three rules depend on a definition of done that can be checked. Compare:
If you cannot tell whether the agent is finished, the agent cannot either, and no stop rule will save you.
Success is meeting the goal in the fewest steps, not working for the longest time.
Agents respond to what you reward. Say that fewer steps is the win.