/goal (Codex)
Codex CLI's /goal directive turns the agent into a long-running autonomous loop. You set a verifiable objective, Codex plans its own steps, executes, checks its own output and keeps going across interruptions, session restarts and budget limits until it reaches the target. It is the Ralph loop the community used to hand-roll, now shipped as a native feature. Generally available since May 2026.
Strengths
- Native autonomous loop: no more hand-rolled Ralph script or external cron
- Explicit goal format (end state, evidence, constraints) that forces a real success condition
- The goal survives interruptions, session restarts and budget limits
Limitations
- Tied to Codex CLI: you stay outside the Claude Code ecosystem (skills, hooks, sub-agents)
- Long-running autonomous loop: watch the cost and give it tight constraints
Best for
- Long tasks with a clear objective: migration, large refactor, getting a test suite to pass
- Teams already on Codex CLI who want an autonomous loop without external tooling