Categories
Uncategorized

Codex /goal and Claude Code /goal: How Each Works and Which a PM Should Use

How /goal works in Claude Code and in Codex: setup, commands, who decides the goal is done, and how to write a condition that holds up.

A codex goal is a way to hand Codex a finish line once and let it keep working across turns until it gets there. Claude Code has the same command, and it works differently under the hood. I use Claude Code first, so this page covers it first, then Codex, then what a PM should do with each. Every product fact below comes from the vendors’ own documentation, which I checked on November 20, 2026. My own tested PM guide to the command is here.

/goal in Claude Code

According to the Claude Code docs, /goal sets a completion condition and Claude keeps working toward it without you prompting each step. After each turn, a model checks whether the condition holds. If it is not met, Claude starts another turn instead of returning control to you.

Card comparing /goal in Claude Code and in Codex: how to set it, how to enable it, controls and who decides the goal is met, checked against each vendor's docs on November 20, 2026
/goal in Claude Code and Codex, checked against each vendor’s documentation on November 20, 2026.

What to know:

  • Setting it: run /goal followed by the condition. One goal can be active per session, and a new one replaces the old one.
  • Checking and clearing: /goal with no argument shows status, and /goal clear removes it.
  • Who judges: a small fast model reads the conversation after each turn. It does not run commands or read files, so Claude has to show the evidence in its own output.
  • How a condition should look: one measurable end state, a stated check and constraints that matter. It can be up to 4,000 characters, and you can add a clause such as “or stop after 20 turns” to bound it.
  • Unattended runs: a goal does not change your permission mode, so run it in auto mode if you want turns to proceed without approval prompts.
  • Requirement: the evaluator is part of the hooks system, so /goal is unavailable if hooks are disabled.
  • Non-interactive: it works with claude -p, which runs the loop to completion in one call.

In my guide, I ran three PM use cases myself, without /goal first and then with it, same repo, same models. The guide also notes that /goal only works in Claude Code, not Claude web or Claude Cowork.

/goal in Codex

The Codex docs say /goal is for tasks where Codex should keep working toward a verifiable stopping condition. If the command does not appear in the slash menu, add this to config.toml:

[features]
goals = true

You can also run codex features enable goals. The controls are /goal <objective> to set it, /goal to check it, and /goal pause, /goal resume and /goal clear to control a run. The docs say Codex can work independently for multiple hours and stops when it is confident it has reached the stopping condition, and they do not describe a separate checking step, so the stopping point depends on the condition and validation loop you write. The docs suggest defining what to achieve, what must not change, how to validate progress and when to stop, plus working in checkpoints with a short progress log. They warn against using goals for a loose list of unrelated work.

Related: how to set up Codex from scratch.

How they differ

The main difference is who decides the work is done. Claude Code runs a separate model against your condition after every turn, which is why the condition has to be something the transcript can prove. Codex’s docs put the weight on you writing a precise stopping condition and validation loop. Codex also has pause and resume as named controls, and Claude Code documents clear.

If you want something that repeats on a clock instead, the Claude Code docs compare /goal with /loop and Stop hooks. I cover that on my Claude Code loop page and in my loops guide for PMs.

Which a PM should use

Start with Claude Code, because its evaluator gives you a built-in second opinion on whether the job is done. Use the same discipline in either tool: one measurable end state, a command that proves it and a limit on how long it may run. If you work in Codex, I wrote a Codex guide for PMs as well.

Frequently asked questions

What does /goal do in Codex?

It keeps Codex working across turns toward a stopping condition you define, until Codex is confident it has been reached.

How do I enable /goal in Codex?

If it does not show in the slash menu, add goals = true under [features] in config.toml, or run codex features enable goals.

What is the difference between /goal in Claude Code and Codex?

In Claude Code, a separate small model checks your condition after every turn. In Codex, the docs say it stops when it is confident the condition is met.

Can I run /goal without watching it?

In Claude Code, run it in auto mode so tool calls do not need approval, and add a turn limit to the condition. In Codex, the docs say it can work independently for multiple hours.

Get my PM guides by subscribing to the newsletter.

By Aakash Gupta

15 years in PM | From PM to VP of Product | Ex-Google, Fortnite, Affirm, Apollo

Leave your thoughts