Command reference ยท Codex CLI
/goal
Sets a persistent task goal that Codex works toward across the session.
According to the official Codex CLI docs, /goal sets a persistent task goal. Unlike a one-off instruction, this goal persists across the session and guides Codex.
โ WHEN TO USE IT?
Set an overarching goal for a longer work session
/goal โ e.g. set 'fix all open type errors in the project' as an ongoing goal
Keep focus across multiple individual steps
/goal โ set a goal so Codex doesn't lose track across several consecutive instructions
โ WHEN NOT TO?
The task is a permanently recurring routine, not a one-off goal
/goal is meant for a goal within a session, not for recurring, time-triggered workflows.
Better: Set up a loop/automation for permanently recurring tasks instead of a one-off /goal
SOURCES
- Codex CLI Doku: Slash Commands โ developers.openai.com