Writing goals that can be checked
The hardest part of a goal loop is writing the goal, and turning intent into something a machine can check is a skill.
A goal loop is only as good as its goal. If the condition can't be checked, the loop can't stop. Claude Code's own docs warn that an underspecified or impossible goal can keep Claude looping indefinitely (docs, XDA's "I was using it completely wrong").
What makes a goal checkable
The guidance across vendor docs and practitioner guides converges on a few rules (MindStudio, Daily Dose of DS, Hermes docs):
- Describe a state of the world, not an activity. "All tests in
test/authpass andnpm run buildexits 0" rather than "work on the auth tests". - Reference concrete commands or outputs. The judge needs something to look at.
- Put the scope in the goal. "…without modifying files under
test/" closes the most common loophole (see reward hacking). - Avoid conditions that need taste. "The code is readable" or "the UI looks good" need a human or a carefully designed rubric.
- Split big goals into sub-conditions you can check separately. "Refactor the whole codebase" can be valid but rarely finishes reliably in one run.
/goal make the checkout flow production readyNo observable end state. The judge will either accept the agent's claim or never be satisfied.
Let the agent draft the contract
Two of the more interesting ideas involve not writing the full goal yourself:
- Hermes suggests letting the agent expand a one-line goal into a fuller contract before starting (docs). You review the contract, not the code.
- Anthropic's long-running harness has the generator and evaluator negotiate a sprint contract before each chunk of work, listing the specific behaviours that will be tested (Anthropic, summary). A planner turns a short instruction into a detailed spec first, because without it the generator under-scoped.
Both treat goal-writing as its own step in the loop, done before any of the work.
The "loopability" test
A useful way to sort tasks, from the arXiv paper Stop Hand-Holding Your Coding Agent:
| Task | Loopable? | Why |
|---|---|---|
| Make the failing CI job green | Yes | Exit codes are a deterministic check |
| Reduce p95 latency of endpoint X below 200 ms | Yes | A metric with a threshold |
| Migrate all callers from API v1 to v2 | Mostly | A grep plus the test suite gets close |
| Improve the onboarding UX | Partly | Needs a rubric, a model judge or a human checkpoint |
| Write a Nobel-worthy novel | No | No reproducible check to stop on |
Spec effort is real
Several practitioners note that defining a good loop can take more work than doing the task once by hand
(Firecrawl, HN). Goal
loops pay off for tasks that repeat, run long or are tedious, not for one-off five-minute fixes. The Hermes docs say the
same: tasks where the agent does one turn and stops don't need /goal.
Further reading
- Agentic Loop Design: How to Define Goals and Verification Criteria That Actually Work
- How to Use Claude Code's /goal Command to Run Agents Until Completion
- Claude Code /goal: A Field Guide with Games
- How to Use Codex /goal: steps, commands and objective examples
- What Is Your Agent's GPA? Evaluating Goal-Plan-Action alignment (arXiv)