{"slug": "the-ultimate-guide-to-codex-goals", "title": "The ultimate guide to Codex goals", "summary": "Codex has introduced a new \"Goals\" feature that allows users to execute long-running, outcome-driven tasks by moving beyond isolated prompts into an iterative work loop. The `/goal` command, available in both the Codex app and CLI, enables agents to self-evaluate and continue working toward a measurable outcome without requiring constant user input. Goals require a verification surface such as tests or browser use, and users can set, view, pause, resume, or clear goals using simple slash commands.", "body_md": "# The ultimate guide to Codex goals\n\n### Learn how to use goals in Codex to execute on long-running tasks\n\nGoals are an awesome new addition to Codex, and I’m super pumped about what they mean for agentic software development.\n\nGoals are a built-in way to move your conversation away from a sequence of isolated prompts and into a work loop that iterates until it hits a measured outcome.\n\nYou can use `/goal`\n\nin the Codex app or in the CLI, so you can just stick to your preference.\n\nIf this is the first you’re hearing of goals in Codex, you’re probably a bit curious how they differ from ordinary prompts. We’ll start by answering that question, then show you the helpful goal commands, then we’ll wrap up with a real example.\n\nReady to dig in?\n\n## What is the difference between a prompt and Codex goal?\n\n**Prompts work for this workflow**\n\n`ask -> work -> result -> wait `\n\n**Goals work like this**\n\n`work -> self-eval -> loop if not complete`\n\nIn short, Goals are outcome-driven.\n\nIf Codex can learn something from what it just done, a goal can help it keep going without you.\n\nBut do use goals, you need a verification surface (like tests or browser use) and a measurable outcome.\n\n### When to use a goal instead of a prompt\n\nHave you ever been using an agent in Codex or some other tool and found yourself typing the same thing over and over again as responses to agent completions?\n\nNice, do the next test now.\n\nOr\n\nAwesome, clean up the next controller to use this new method in the parent class\n\nOr\n\nDon’t just show me how to do it, keep going and finish it\n\nIf you’re ever in a situation like this, the `/goal`\n\ncommand is probably going to be very helpful.\n\nToday’s newsletter is generously sponsored by **Friday**, a powerful agent harness that connect to the software you already use.\n\nFriday helps you get more done with AI agents, without having to glue tools together. You can **bring your own API key** for your preferred models, bring **your existing skills**, and **connect to the tools you need with MCPs**.\n\nOne of my favorite things in Friday is the incredible support for scheduled jobs. Friday lets you describe recurring agentic workflows in plaintext but gives you the option to edit and extend them *as code*.\n\nCheck it out today!\n\n## Some helpful Codex goal commands\n\nThe `/goal`\n\ncommand is really simple, and there’s a few variations that can help you in both the Codex app and CLI.\n\n### How to set a goal in Codex\n\nSetting a goal in codex is simple with the slash command:\n\n```\n/goal Your goal goes here\n```\n\n### How to view the current Codex goal\n\nIf you have a long-running goal, you might need reminded of what you initially asked for:\n\n```\n/goal\n```\n\n### How to pause the current Goal in Codex\n\nIf you want to pause a goal without losing progress or context, you can do so:\n\n```\n/goal pause\n```\n\n### How to resume a goal\n\nResuming a paused goal is easy with:\n\n```\n/goal resume\n```\n\n### How to delete a goal\n\nDeleting a goal will remove the context and allow you to set a new one. Just run:\n\n```\n/goal clear\n```\n\n## How to write a Codex goal\n\nThe [OpenAI docs](https://developers.openai.com/cookbook/examples/codex/using_goals_in_codex#how-to-write-a-goal) are a great place to go for instructions on writing goals, but I’ll give you the most important stuff here.\n\n**Goals need outcomes**. This is how Codex knows when it’s done.\n\n**Goals need a way to verify the outcome**. Tests, benchmarks, browser use, etc.\n\n**Goals should have constraints**. You’ll get better results if you tell Codex what *not* to change.\n\n**Goals should know when to report as blocked**. If you tell Codex what would indicate that it’s blocked, you’ll save yourself from wasting tokens.\n\n### Template for a good goal\n\nHere’s a template for a good goal:\n\n```\n/goal <desired end state> verified by <specific evidence> while preserving <constraints>. Use <allowed inputs, tools, or boundaries>. Between iterations, <how Codex should choose the next best action>. If blocked or no valid paths remain, <what Codex should report and what would unlock progress>.\n```\n\nYou could simplify this as:\n\n/goal Complete this thing without stopping until you’ve passed this success criteria\n\nHere’s a goal I used to add some test coverage to a project that doesn’t have any tests.\n\n## Goals and token usage warnings\n\nOne word of warning for you is to pay attention to your token usage while using goals. The /goal command lets Codex iterate over and over, which will consume truly absurd amounts of tokens. On a sufficiently large project, you’ll probably start hitting your five hour limits long before five hours (on the Plus plan).\n\nFortunately your limits will reset, so you won’t be stuck for the month, but it’s something to keep in mind.\n\nThis is one reason I keep a Codex, Claude Code, and Cursor subscription all active at the same time. Having all three is cheaper than any top-tier plan, gets me ton more usage, and lets me daily-drive whatever tool as the best edge at a given time.\n\nGoals actually work in Codex too, and I suspect Cursor will follow-suit soon.\n\n## Getting really good at using agents\n\nI firmly believe the future of software development is agent-first. That doesn’t mean I think software development is going away as a profession. But it is changing. It’s getting harder and harder to deny that it’s changing.\n\nWe’ve gone from fancy-autocomplete to agents, and the `/goal`\n\nfeature in Codex is making agents even more autonomous, while increasing their economic utility.\n\nIf you want to **learn how to use agents to ship more software, earn more money, or even get promoted**, you’re in the right place. This substack exists to help you use AI tools like Codex better, so I’m happy to have you here.", "url": "https://wpnews.pro/news/the-ultimate-guide-to-codex-goals", "canonical_source": "https://www.augmentedswe.com/p/codex-goals", "published_at": "2026-06-02 11:04:12+00:00", "updated_at": "2026-06-02 20:49:43.190050+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-products", "large-language-models", "generative-ai"], "entities": ["Codex"], "alternates": {"html": "https://wpnews.pro/news/the-ultimate-guide-to-codex-goals", "markdown": "https://wpnews.pro/news/the-ultimate-guide-to-codex-goals.md", "text": "https://wpnews.pro/news/the-ultimate-guide-to-codex-goals.txt", "jsonld": "https://wpnews.pro/news/the-ultimate-guide-to-codex-goals.jsonld"}}