Skip to content

Back to the catalog

Raytar (@Raytar) on X
x.comthread

Raytar (@Raytar) on X

A Twitter/X thread explaining Claude Code's /goal and /loop commands, which let Claude repeatedly prompt and check itself against a defined finish condition rather than requiring a human to babysit each turn. It contrasts single-prompt workflows (which can produce confidently wrong output, e.g. fabricated sources) with loop-based workflows that self-verify, and gives a copy-pasteable "charter" template covering goal, work discovery, self-checking, state persistence (LOOP-STATE.md), and stop conditions.

TL;DR Explains Claude Code's /goal and /loop commands for building self-verifying agentic work loops, with a ready-to-paste loop charter template.
Document

What it claims

The thread argues for "loop engineering" — writing loops that prompt Claude repeatedly and self-check until a job is done — over typing prompts one at a time. Its framing anecdote: Boris Cherny (credited as the person who built Claude Code) reportedly said in June 2026 "I don't prompt Claude anymore." The two Claude Code commands it names are /goal and /loop, and the summary already covers the charter template and the fabricated-sources example. What the summary does not carry is the distinction between the two commands and the explicit guidance on when a loop is the wrong tool.

How it works

The key distinction the summary flattens:

  • /goal — the loop with a finish line. You describe what "done" looks like; after every turn a second copy of Claude checks whether the goal is met and, if not, tells the first copy why. Stops itself when the condition is true.
  • /loop — the loop with no finish line, running on a rhythm. Example given verbatim:
/loop 30m check whether my live site is back up by loading the homepage.
The moment it returns a normal page, tell me and stop checking.

The 30m means every 30 minutes; the page claims you can also phrase a schedule in plain language ("every morning, triage my inbox").

The page distinguishes a loop from a cron job: a cron job runs a fixed script; a loop puts Claude inside as the decision-maker that picks the next action, retries, undoes, or stops mid-job.

Limits

The page's own "when not to build a loop" section is the actionable part the summary omits:

  • One-off tasks — a plain prompt is faster; loops only earn their setup cost on repeating or many-piece work.
  • Cost — a self-checking, retrying loop runs Claude several times per item, so you hit usage limits faster on a Claude plan.
  • Vague work — "think of a better product strategy" is not a loop; define the measurable goal first.

The charter also bounds retries: three tries per item, then log as blocked and move on.

Note the provenance caveat: the Boris Cherny quote and the "built Claude Code" attribution are the thread author's claims, dated June 2026, unverified here.

Organisations named here

Technologies named here

Techniques named here

Also named here

  • Boris Cherny