← Return to Index Archived May 27, 2026
The Lead — May 27
HOW I AI · CLAIRE VO

The Codex feature that works while you sleep

Claire Vo makes the case for Codex Goals as the missing layer between one-off prompts and true autonomous work, where an AI agent keeps iterating until it can prove a task is done. Her examples range from debugging stubborn software errors to cleaning out thousands of unread emails and triaging an unruly project backlog.

30m / May 27, 2026 /aiproducttechnology / Transcript sourced from openai
All episodes from How I AI →·Listen on Apple Podcasts →

Overview

Claire Vo explains how "Goals" in Codex changes AI from a turn-by-turn assistant into something that can keep working toward an outcome on its own. The episode is a practical walk-through of when to use Goals, how to write them well, and why this mode is what people often mean when they talk about AI handling long-running work "overnight."

She grounds the feature in real use cases: fixing recurring engineering errors, cleaning up thousands of emails, and clearing stale project-management tasks. The thread through all of them is simple: if you keep telling the model "keep going" or "try the next thing," a goal-based loop may be a better fit.

Key Takeaways

The main distinction Claire makes is between a prompt and a goal. A prompt asks for one task and waits for the next instruction. A goal gives Codex an end state, then lets it work in a loop: do work, check results, choose the next step, repeat until there is evidence the job is done.

That loop matters because autonomy depends less on raw model intelligence and more on whether the system knows how to keep going without human nudging. Claire says that before Codex Goals, she had not been able to get coding agents to sustain multi-hour work reliably; with Goals, she says she got one task to run for about five hours and 45 minutes.

A strong goal looks a lot like a well-written OKR or success criteria doc. Claire highlights six parts: the desired outcome, how to verify it, what cannot break, what tools or files are in scope, how the agent should pick the next step, and when it should stop and ask for help. That framing is useful beyond engineering because it forces you to define "done" in a way a machine can test.

Her examples show that non-coding work may be one of the best fits. She says Codex processed roughly 3,900 emails over nearly four hours, categorized them, helped unsubscribe from mailing lists, and got the inbox down to 68 items needing review. She also shows a Linear cleanup task where the agent closes stale issues from old podcast episodes based on a clear rule.

She is also clear about limits. Goals are a bad fit for tiny edits or fuzzy objectives like "make customers happy" or "refactor this code." The sweet spot is a stable objective, a measurable finish line, and a task that takes several rounds of investigation.

Practical Steps

If you want to try Goals well, start with work you already micromanage. Good candidates include bug burn-downs, inbox cleanup, backlog triage, repetitive QA, or performance improvements with a measurable target.

When you write the goal, include:

  • End state: what should be true when the work is done
  • Verification: what test, metric, or evidence proves success
  • Constraints: what must not regress
  • Scope: what tools, systems, or files it may use
  • Iteration rule: how it should decide what to try next
  • Stop condition: when it should pause and ask for help

A practical template from Claire's discussion is: define the result, say how to measure it, set guardrails, limit the working area, tell it how to report progress, and tell it what to do when blocked.

Also, pick the right size task. Do not use Goals for one-line fixes. Save it for work where you expect multiple passes and where success can be checked without guesswork.

Notable Quotes

  • Claire Vo: "If you find yourself in that process, using /goal in codex might be a tool that you want to add to your toolkit."
  • Claire Vo: "Goals written are a lot different than prompts. Prompts are an instruction of what to do. Goals is a description of what a good outcome is and it's observable."
  • Claire Vo, citing the OpenAI guidance: Goals are strongest when they have "a durable objective, an evidence-based finish line and a path that may require several turns of investigation."
Goals are strongest when it has three properties: a durable objective, an evidence-based finish line, and a path that may require several turns of investigation. — From the episode

Full Transcript

Source: openai 30m runtime

Welcome back to How I AI. I'm Claire Vo, product leader and AI obsessive here on a mission to help you build better with these new tools. Today, I'm going to walk through my favorite feature in my most recent favorite AI product, Goals in Codex. If you've been wondering how all these people on the timeline are getting their AI to run, quote unquote, overnight, or handle very complex long-running tasks, I'm going to show you Goals is the answer. We're going to walk through what it is, how I might use it, and a technical use case, along with some non-technical examples of how Goals can help you even if you're not coding. Let's get to it. This episode is brought to you by Mercury. As an AI founder, I'm constantly tracking run rate, watching revenue growth, paying vendors, and making sure I'm getting paid on time. Mercury makes all of it feel effortless. The app is genuinely beautiful. It actually looks and works like modern software, which sounds obvious, but apparently isn't when it comes to banking. What I use it for the most? Bill pay for my vendors is just clean and easy. And wires and transfers, getting paid from clients, moving money, Mercury makes it so simple. Everything you need is right there. No phone calls, no hunting through menus, no wondering if something went through. I think about how much I've optimized every other tool in my stack. Mercury is the one where I don't have to think about it at all. It just works. Visit mercury.com to learn more and apply online in minutes. Mercury is a fintech company, not an FDIC insured bank. Banking services provided through Choice Financial Group and Colony NA, members FDIC. Before I go into how to use goal, I want to talk about what goal is and when it's appropriate and when it's not the right tool for the job. So I'm looking at this blog post by the OpenAI developers team. It's called Using Goals in Codex. And the first thing that they have in this blog post is this awesome diagram that talks about the difference between a prompt and a goal-based loop. In a prompt, you all are used to this. It's sort of the turn-based requests that we're all used to. You ask the LLM, the model, the harness, to do something. It works. It returns to you its result. And then it waits for you to prompt it again. If you're like me, the number one thing that you're saying in your coding tool is, OK, what's next? And then it tells you. And you say, great, do it. If you find yourself in that process, using slash goal in codex might be a tool that you want to add to your toolkit. So what's the difference between this turn-based, one-response, wait, and goal? Well, with goal, when you give codex a goal, it actually has something that it can work towards. And it will continue to loop to the next step and verify until it can measure that it has met that goal. And so if you look at this, the goal is the overarching kind of description of the outcome that the model wants to get towards, and that will work. It will check its work. It will decide the next step. And it will continue that three-step process until it can gather evidence that it has met the goal. Once it gathers evidence that it has met the goal, it will mark the goal as complete. And then it will tell you it is done. Now, if you've been watching people online talk about how they get these long-running autonomous tasks out of codex, cloud code, et cetera, you're really talking about people who are using some framework of this goal. There's also a version of this called a Ralph loop that people were talking about. But functionally, the framework is the same. It's saying, keep going until X behavior or Y outcome is validated. Otherwise, I want you to re-prompt yourself and re-prompt yourself until you're there. And what's really fascinating about goals, I've been using AI coding agents for many years now. And until codex and goal, I was not able to get these multi-hour, long-running autonomous tasks. Now, I don't have the most complex coding tasks in the world. I'm not building an operating system. I'm not doing complex mathematics. And so part of that was my problems were pretty well-constrained. But I did have things that I thought a long-running harness could really help me with. But until slash goal was part of the codex tool, I really just wasn't able to get my AI to self-manage enough to do that autonomously over time. But the first time I used goal, I was actually able to get a coding task running for about five hours and 45 minutes, which is longer than I've ever had anything run before. Now, quick introduction on how to use goal. There are four sort of ways to manage the lifecycle of goal. The one that I use is slash goal, and then I walk away. So if you write slash goal and then prompt it with your goal, it will start working. You can use slash goal to see what the current goal is. Again, you can pause the goal. You can resume the goal. And then you can remove the goal. So you don't have to let your AI run for 6, 12, 24 hours, whatever. If it gets off the wrong track, you can absolutely manage the lifecycle. But it's a really useful tool. And I love that they give the example here because this is 100% what I spend most of my time going. They say, you really want to use goals when you would otherwise find yourself saying the same thing after turn. Like, keep going. Try the next thing. Run it again. Now run the test. Continue until it's actually done. So if you're micromanaging your AI and having to tap it on the shoulder and say, can you pretty please go to the next step? Goal is for you. Now, how do you prompt and design a real goal? This is where product managers tune in. Engineers that write success criteria, tune in. These are where those skills on setting really measurable, well-defined goals come into play. Because when you prompt something, you're really just saying, do this task, right? Like, rewrite this code. Redesign this page, et cetera. When you're talking about a goal, you want to talk about what the outcome is if that task was successful. And the technical example that they give here in this blog post is reducing P95 checkout latency. So if you know that a specific page is loading kind of slow and you want to reduce that below a threshold, and you know that can be measured because you can just load the checkout page over and over and over again, and then you create a guardrail on it, like keeping the correctness suite green, that is a really great goal. It's measurable. It's testable. It has a guardrail on it. And there is a executable surface area that you know an LLM can be successful for. Writing goals is its own skill set, but OpenAI has given a really great outline to what makes a strong goal. And again, product managers, let's pay attention. If you've written an OKR, developers, if you've argued that an OKR was not well-written, this is where those skills come into play. The strongest goals, I mean, for anything, but in particular for codex, kind of have six things as part of it. It has an outcome, what should be true when the work is done. So once we're done, what is the outcome we're trying to deliver? Verification, how can you test it? Do you have a test suite? Do you need to pull up the browser? Is there a number that you're trying to go to or a measure? Constraints, what can't regress while codex works? For example, on our P95 checkout latency, you could delete the page. The latency goes away, but that's not what you want. So you want constraints. You want the features to stay the same. You want particular technologies to stay the same. The boundaries, so what tools and files and things it's allowed to use in pursuit of this goal. The iteration policy, how it should decide what to try next. Kind of what would you try next? And then when it should stop and say, sorry, I just can't continue. I don't have a good next idea. And they give this great pattern here, which is slash goal. You know, my end state verified by specific evidence. I need you to preserve these constraints. Please use these tools. Between iterations, decide the next step by doing X, Y, and Z. And if you're blocked or no valid paths remain, this is what you should do next. You should tell me. You should report. You should ask me for help. And so they give an example of how to make this P95 checkout latency goal a lot better. And it's basically by saying, bring it below a threshold, which was already in the original prompt. But you're going to verify it by the checkout benchmark. You're going to keep the correctness suite green. You're going to use only the checkout system between iterations. You're going to tell me what changed, what the benchmark shows, and the next experiment to try. And if you can't come up with something else, stop and give me the evidence, the blocker, and what you need from me. This is a really great goal. And this is a technical goal, but you can also do this with non-technical projects. And I'm going to show you a little bit of how that works. So again, a goal is a new way to prompt a LLM in this instance, codex, to work autonomously in a loop of work, verify, check until it hits a goal. Goals written are a lot different than prompts. Prompts are an instruction of what to do. Goals is a description of what a good outcome is and It's observable. It definitely can eliminate those errors, so it can ship a fix. It can eliminate it or it can run the same code and it can show that the error wouldn't be hit. And then it has the success criteria and an ending state to me, which is, I want to list a PRs and any blockers or things that I need to review. And so it's going to go ahead and go through and try to find the right logs. It's going to continue to work on this. Now, we are in a mini episode today. It's one minute into the school. I suspect that this is going to take two to three hours to get through. I've run something very similar on this. It's taken about two or three hours to get through. So I will have to put in the show notes or a follow-up whether or not this was super successful, but it's just an example to you. I love this idea of just like sentry zero, error zero, where you can point goal at any kind of like lingering errors that have really haunted your team and developers out there. You know that these exist. And you can actually say, just go get rid of these. And with goal, it really is possible. And I've seen very high quality success on using goal to burn down errors. So that is a technical example of how to use goal, but I want to make this more applicable to people who aren't developers because I honestly think goal for non-coding use cases is even more exciting. Today's episode is brought to you by Mercury, the banking solution I use for ChatGPT. I build AI tools. I talk about AI every day. So when people ask what I use to run my business, Mercury is a genuinely easy answer because an AI founder who still deals with clunky, outdated banking is kind of a walking contradiction. Mercury is how I track run rate and revenue growth, pay my vendors through bill pay and get paid by clients. Wires and transfers that used to feel like a whole thing, sending money, accepting payments, knowing it arrived. Mercury just makes it simple. The whole platform is clean, fast, and modern in a way that most banking honestly isn't. I've banked with them for years. It's one of those tools where I don't think about switching because it's never given me a reason to. Visit mercury.com to apply online in minutes. Mercury is a fintech company, not an FDIC insured bank. Banking services provided through Choice Financial Group and Column N.A. members FDIC. For this next example, I want to give you my favorite use case of slash goal. It has blown my mind. And if you leave this episode with nothing else, I hope you go do this, which is use the goal to clean up all your unread emails. So Codex has access to my Gmail plugin. That means it has MCP access. It means it can go through and read my email. I had yesterday truly 3,900 emails, something like this. I'm going to see if I can find the resume, the save chat. So I'm going to type in goal and see what my goal was that I did yesterday. It is the much worse written prompt. Categorize all bulk promotion spam emails, unsubscribe from unnecessary emails and clean up your inbox. Ask for help while needing judgment. It ran for three hours and 52 minutes and it used about 6 million tokens. So it was not token cheap. I'm going to just show you what it did, which is it just read like literally read every email, categorize them, put nice labels on them so then I could go decide, including labels like needs judgment. Clicked unsubscribe links for me, gave me a list of unsubscribe links that I could use. And at the end of the day, I went from about, let's actually ask how many emails did I start with uncategorized and how many are now left to filter? So it's going to go ahead and check its own work and you're going to hold me accountable to show that I did not make this up. And it's going to show how many emails I started with and how many do I have left. I'm pretty sure it was about 4,000 and I think we got down to about sub 1,000 that needed to get done. Okay, it took a little prompting to remember what it did, but again, we started about 3,900 emails. Now I'm down to 68 that I need to look at. So that's my today project. So it categorized almost 4,000 emails for me and it put it in lovely folders. Again, it unsubscribed for me. It gave me nice categories of emails that I needed to respond to. If you've been waiting on me for a couple of weeks, you now got a response. And now I have a much cleaner email that I can run over time. So again, slash goal. My prompt was very simple. Just categorize all my emails, unsubscribe and clean up my inbox. It ran for four hours and now I have a much cleaner inbox to work with. Okay, I'm going to give one other example of a non-technical use case that I think is going to be really useful for the product managers out there, which is I have let my linear, my task management software go completely off the rails. This is partly an OpenClo problem, which is I gave my agents, my OpenClo's YOLO access to linear and they created a bunch of tasks, not all of which that they have done. And so I want to clean up my linear tasks and get them to only the ones that I need to complete. And I want this in particular for our podcast linear because we had aspirations of all the things we would do with every episode. We usually do about 70% of those and I just want to clean it up. So I'm going to say slash goal, clean up the How I AI podcast team issues in linear. Anything from a previously released episode that is not marked as done should be marked as will not do. Our goal is to have open only future tasks this week and forward for episodes, not old tasks. We'll never get around to. So I'm going to let that do that. It should have access to the linear plugin. It's going to go through. And again, I'm telling you, this is like hundreds and hundreds and hundreds of tasks. It's going to go through and make this judgment call of, can I close this? Can I update the data? If you want to have better task hygiene where you want to make sure everything is tagged correctly, assigned correctly, this is a really good use case. And so it's found the linear team. It's going to work at the team level. It's going to identify stale episode tasks. It's going to go through, clean them up. The task status we want is not won't do. It's called canceled. And it's just going to process through and go ahead and do that. So I suspect that this one will go a little bit faster, but we'll probably take 30 minutes to an hour to go through really high quality judgment. And at the end of it, I'm going to have a much cleaner linear workspace to work with. And again, it's saying a clear rule is emerging. Keep current week future episode work. Cancel non-done episode release work before Monday. It's going to scope the bulk update. It's going to validate that the outcome I wanted, which is a clean linear, is done and it will complete this over time. So those are my three examples of how to use goal. One is a technical one. Again, it's continuing to run. So it's gotten through the first two steps here. The technical goal of looking at all my error logs and basically classifying them, fixing them, burning them down with the goal of having no more errors ever. There is the second very practical goal of clean up my email inbox and so I can actually read my email. That one took about four hours. I think useful for everyone. And I did not have to have a very good prompt there. And then my third one for project management, make sure that my projects and my tasks and issues are clean. My backlog is clean. Everything is labeled the way I want and I only have to focus on the things that matter to me. These are three ways I think you can use goals in codex. Before we end, I want to take a step back and talk about when you shouldn't use goals and then what I think is next. So goals are not the right tool for every job. And I'm pulling up this blog post again because I think they say it better than me. Do not use goal for something that is a very simple one line edit. It is just too big of a tool for the job. Your goal wouldn't be like, make sure this line of code is removed. You really want an outcome, not an output almost for it to be a good goal. Also don't use a goal when the finish line is vague. So you can't do, I mean, maybe you can, if you're like slash goal, make my customers happy. I think that is just a very vague goal. It's very hard to measure and there's no reliable definitive completion condition. And so that's not very good. The other example they give is like refactor this code. Not a good example of when to use slash goal. And in fact, I'm doing a refactor this code initiative with codex, but I'm not using a goal. They say, and I just want to reiterate this for you. Goals are strongest when it has three properties, a durable objective, an evidence-based finish line and a path that may require several turns of investigation. So if you have an objective that stays steady over time, you know you want to hit that objective. It can be evidence-based and you can measure it. And you think getting there is going to require a couple turns. Goals are for you. So before we wrap a couple thoughts on slash goal and why I'm just really excited about this framework of working with AI. One,