Skip to content

Instantly share code, notes, and snippets.

@mgreenly
Last active July 1, 2026 16:23
Show Gist options
  • Select an option

  • Save mgreenly/07a2f43e628b93b4ac4cbe6c101b0bef to your computer and use it in GitHub Desktop.

Select an option

Save mgreenly/07a2f43e628b93b4ac4cbe6c101b0bef to your computer and use it in GitHub Desktop.
A continue, next, done ralph loop in claude code with the /goal command
/goal Cycle the prompt sequence gather → build → verify (verify wraps back to gather),
starting at gather, until a subagent returns a DONE status. For each step, dispatch a
subagent to read and execute the current prompt file (./project/prompts/{gather,build,verify}.md);
it ends by emitting a single JSON object of the form {"status": ..., "message": ...}. Parse
its "status" and relay its "message" so progress stays visible. CONTINUE — re-run the same
prompt file. NEXT — advance to the next prompt file (verify wraps to gather). DONE — stop. If
a subagent fails, or its final output is not a JSON object carrying a "status" of exactly
CONTINUE, NEXT, or DONE, stop and surface the raw output — never guess a status. You are only
the orchestrator — never read the prompt files yourself; subagents read and execute them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment