A compact prompt workflow for using OpenAI Codex CLI /goal well: set a short persistent outcome, keep acceptance checks visible, pause or clear goals safely, and avoid stuffing long specs into the command. Use this quick-start pack when a Codex task will span multiple turns, resumes, queued follow-ups, or several files. The point is not to make Codex magically smarter; it gives the agent a persistent target to keep checking against while the work continues. Copy-paste starter Best pattern Keep the goal under one screen: outcome, constraints, validation. Put long requirements in a file, then reference it from the goal. Use the normal prompt for the current step; use /goal for the durable north star. Pause the goal when exploring alternatives; resume it when returning to implementation. Clear the goal after the task is done so it does not steer the next task. When to use it Use /goal for migrations, debugging sessions, release preparation, refactors, long review loops, and tasks where you often say 'continue' or resume the thread later. For one-shot questions, a normal prompt is enough. Evidence notes OpenAI documents /goal as an experimental Codex CLI slash command that sets or views a long-running task goal, with pause, resume, and clear controls. The May 2026 Codex changelog says experimental goals became discoverable, stay paused across resume unless the user opts back in, and gained clearer validation and multi-day duration output. Companion article Read the full evidence-based breakdown here: https://linkloot.io/blog/openai-codex-goal-advantage-long-running-coding-tasks