Every prompt sent to a coding agent runs one of these loops implicitly: the agent reads files or searches, edits or executes, observes what happened, and decides whether to go again. By default the same model doing the work also judges when it is finished, which is why unattended agents tend to stop at “looks done”.
Goal and loop features externalize the stop condition. A goal command hands the “is it done?” question to a separate evaluator that checks a user-written condition after each turn, while interval loops and scheduled routines restart the cycle on a timer or an event instead of a judgment call.
