/goal
Updated 2026-06-03
Questions this answers
- My AI agent stalls and I have to keep coming back to it
- How do I run my AI agent overnight
- My AI agent keeps asking me to confirm before proceeding
- My AI agent stops before my thing works
The Fix
Type /goal in Claude Code or Codex, then describe what "done" looks like. For example, "/goal the whole report is drafted and every section has a chart." Claude or Codex starts working right away, and instead of stopping after each step to ask "what now?", it checks its own work, keeps going, and only comes back to you once it's actually finished (or you tell it to stop with /goal clear).
When to Use It
Use /goal on bigger tasks that have a clear finish line: working through a long to-do list, cleaning up a messy document, anything where you'd otherwise be babysitting it and typing "keep going" over and over. Skip it for quick one-off asks or anything where you can't really say what "finished" looks like.
In the Wild
Pretty incredible You have to try the new '/goal' feature in Codex It worked for over an hour and built me an entire complex extraction shooter video game You give it a goal, then it works endlessly until the goal is complete. It's like a Ralph loop. Can run for days If you Show more
Building a complex video game using /goal
The best use case I’ve seen so far from /goal - lady has excess on her farm - tells codex to sell it - codex sells it
Been helping a handful of business owners with AI implementation. One of them has a side business for fun because she lives on a farm where she sells Dahlia tubers. She had 300 left to sell. To test Codex /goal mode we gave codex a goal to sell 200 Dahlia tubers for Mother's Day.
/goal enabled selling flowers for a local farm until the entire inventory was sold
Best Practices
@ericosiu on X
x.com
Specify a definition of done so the agent knows when the task is complete
@milesdeutscher on X
x.com
Full goals should include context, success criteria, operating rules, quality bar, and final-deliverable non-negotiables
@ChrisHayduk on X
x.com
Include quantitative metrics so the agent has something concrete to test against
Lenny's Newsletter
lennysnewsletter.com
A detailed walkthrough of including demos and a framework to ensure /goal prompts are effective

