Skip to Content
loop.fun
Goals

Budgets, lifecycle and persistence

Every goal needs a way to end without success, a set of states it moves through, and somewhere to live between sessions.

Budgets: the second exit

A completion condition is the happy exit. A budget is the exit for everything else: the goal is impossible, the judge is broken, the agent is thrashing. Every loop guide published in 2026 repeats the same rule: a machine-checkable exit condition, plus a hard cap (heyuan110, MindStudio).

Budgets come in four units, and the harnesses picked different ones:

UnitExampleGood atBad at
TurnsHermes goals.max_turns: 20, Ralph --max-iterationsSimple and predictableOne turn can cost 5k or 500k tokens
TokensCodex goal token budgetCloser to real costCodex leaves it unset by default; reports disagree on syntax contested
MoneyHermes gateway spending limits (v0.23)What finance actually cares aboutNeeds pricing awareness in the harness
TimeKarpathy's autoresearch gives every experiment exactly 5 minutes (Noqta)Natural for metric loops; makes runs comparableWastes slack or cuts work short

What happens when the budget runs out matters as much as the cap itself. Codex injects a budget-limit prompt telling the model to stop and report (Daniel Vaughan); Hermes auto-pauses with "⏸ Goal paused, 20/20 turns used" and waits for you to resume. Both preserve the work done so far, which is the important part.

Lifecycle: goals have states

Once goals persist, they need states. Codex's are the most explicit (SmartScope, Daniel Vaughan):

pursuingpausedachieved / unmet / budget-limited
Codex goal states. Pause keeps the full audit context; resume picks up where it left off.
  • /goal sets or replaces, /goal alone shows status, /goal pause and /goal resume suspend it, and /goal clear drops it (Codex). Claude Code has /goal <condition>, /goal for status and /goal clear (docs).
  • Changing a goal mid-flight is an underexplored area. Today you mostly clear and re-set, which loses the judge's accumulated sense of progress.

Pacing: what a goal costs while it waits

A special case that has caused real pain: goals that are waiting for something, like CI, a deploy or a long build.

An analysis of Codex sessions by relux.works claims goal mode restarts the model about 0.03 s after each turn. When the agent is waiting, that turns into a hot poll loop: one example fired 173 continuations in 48 minutes, each re-reading 120k–470k tokens of context, until the provider returned 429. anecdotal The same post claims Claude Code pauses between continuations instead, and points to a Codex sleep_tool setting as the workaround.

The lesson applies generally: a goal loop needs a notion of "not done, but nothing to do right now", meaning a sleep, a backoff or a wake-on-event, or it turns waiting into spending.

Persistence: where does the goal live?

HarnessWhere the goal livesSurvives
Ralph (DIY)PROMPT.md plus progress files and gitEverything, because it's just files
CodexThe threadCrash and reboot, but it only runs while a session is open (Daniel Vaughan)
Claude CodeThe sessionThe session; for longer horizons use background sessions or routines
HermesSession store plus config; kanban cards can carry --goalSessions, per secondary sources secondary reporting
OpenClawHEARTBEAT.md and memory/goals.mdEverything, but as unstructured text

No two tools share a goal format. A goal set in Codex means nothing to Claude Code, and vice versa. See Open questions.

Further reading

loop.fun

Patterns, hints and tools for designing the loops that keep agents working, and for widening the set of loops you can think of.

© 2026 loop.fun · CC BY 4.0

On this page