What is a goal?
A goal is not a prompt that gets repeated. It is a persistent control object, and most of the open problems with loops live here.
Every serious loop discussion ends up talking about goals. Since spring 2026 the word has a concrete meaning in the tools: /goal in Codex, Claude Code, Hermes Agent and Antigravity CLI. But the concept is broader than any one command.
A prompt vs. a goal
A prompt is consumed: the agent reads it, works, answers, and the prompt has done its job. A goal persists. It sits outside the conversation, survives individual turns, and is consulted every time the agent tries to stop.
- Receive the task
- Reason and call tools
- The model decides it's finished
- Return a response; the human decides what's next
The only judge of "done" is the model, and the only budget is your patience.
The anatomy every harness converged on
Look at how the four major /goal implementations work and the same five parts appear, under different names:
- Condition
- A natural-language statement of what "done" means. Ideally points at something checkable: a command, an output, a file.
- Judge
- Who decides it's met. Claude Code uses a separate evaluator model (Haiku by default); Hermes uses a judge model that defaults to the main model but can be routed to a cheap one; Codex relies on the model itself, prompted by a continuation template. primary source
- Budget
- Turns (Hermes: 20 by default), tokens (Codex: optional), or the evaluator judging the goal impossible (Claude Code).
- Lifecycle
- States like pursuing, paused, achieved, unmet and budget-limited (Codex), with pause, resume and clear commands.
- State
- Where the goal and its progress live: the thread (Codex), the session (Claude Code), config and session store (Hermes), files and git (Ralph).
Goal = condition + judge + budget + lifecycle + state
If one of the five is missing, the loop is fragile. With no condition it never ends, with no independent judge it ends too early, with no budget it runs up a bill, with no lifecycle you can't pause it, and with no state it can't resume.
Why goals are the interesting part
Running a loop is trivial. The engineering work has moved to questions about goals:
- Specification. How do you turn "make the auth flow robust" into something a machine can check? See Writing goals.
- Verification. Is the agent grading its own homework? Does the judge look at the transcript or at the world? See Judges.
- Economics. What happens when the goal can't be met within budget? What does a goal cost while it is waiting for something? See Budgets and lifecycle.
- Persistence. Where does the goal live when the session restarts, the laptop sleeps or you switch tools?
- Standing goals. Some goals never end: "keep CI green", "watch my inbox". See Standing goals.
- Integrity. How do you stop the goal drifting, being gamed, or being rewritten by injected text?
These are collected as research questions in Open questions.
Further reading
- Claude Code docs: Keep Claude working toward a goal
- Hermes Agent docs: Persistent Goals (source on GitHub)
- Codex: Goal mode, persistent objectives and token budgets and Using goals in Codex
- Antigravity: /goal, run to completion
- Anthropic: Getting started with loops, covering goal-based, time-based and proactive loops