Skip to content

Instantly share code, notes, and snippets.

@mgreenly
Created July 1, 2026 16:25
Show Gist options
  • Select an option

  • Save mgreenly/9b820d855a8467c434d433921895f43f to your computer and use it in GitHub Desktop.

Select an option

Save mgreenly/9b820d855a8467c434d433921895f43f to your computer and use it in GitHub Desktop.
A continue, next, done ralph loop in codex 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, spawn a
Codex 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