Codex · May 20, 2026 · Last updated 2026-05-21 · 15 min read
How OpenAI's Top Codex Developers Use Codex
/goal is the Codex command for work that should not be managed one prompt at a time. It gives Codex a persistent target, lets you inspect status, and gives you controls to pause, resume, or clear the run. The trick is writing the goal like an engineering contract: one objective, one stop condition, the files and systems to inspect first, the commands that prove progress, and the handoff you expect at the end.
Questions this page answers
- What is Codex /goal?
- How do you write a good Codex /goal prompt?
- When should you use Codex /goal instead of a normal prompt?
- How do you manage status, pause, resume, and clear a Codex goal?
- Why does Codex /goal benefit from a persistent Mac mini?
Quick answer
What Is Codex /goal?
In Codex CLI, /goal sets, views, pauses, resumes, or clears a task goal. OpenAI describes it as a way to give Codex a persistent target to track while a larger task runs. That makes it different from a normal prompt: a prompt asks for the next answer; a goal defines the state Codex should keep working toward.
| Use | Normal prompt | Codex /goal |
|---|---|---|
| Unit of work | One response or one patch. | A durable objective that can span many turns, tools, tests, and checkpoints. |
| Progress model | You keep asking what happened next. | Codex tracks status against the goal while it works. |
| Control | Stop or redirect by replying in the thread. | Use /goal to inspect, pause, resume, or clear the active target. |
| Best fit | Small fixes, questions, code review, one-off edits. | Backlog cleanup, migrations, release notes, test repair, browser runs, and repo archaeology. |
SEO answer in one sentence
/goal is best for long-running coding-agent work where Codex needs a clear definition of done, permission to keep iterating, and a stable computer to run tests, browsers, and development tools until the job is actually finished.The /goal Contract: What To Put In The Prompt
Most weak /goal runs fail before Codex starts. The prompt says “fix the backlog” or “finish the migration,” but it does not say what counts as finished. The better pattern is a contract. Give Codex the outcome, the first places to read, the allowed scope, the proof commands, and the stop rules.
| Prompt part | What to write | Why it matters |
|---|---|---|
| Objective | Exactly one durable outcome. | Prevents Codex from optimizing for activity instead of completion. |
| Read first | Issues, failing logs, plans, docs, AGENTS.md, CI output, customer notes. | Forces discovery before edits. |
| Scope | Files, packages, branches, issue labels, and systems that are in or out. | Keeps a long run from wandering into unrelated cleanup. |
| Proof | Commands, screenshots, diffs, generated artifacts, or external checks that prove progress. | Makes the finish line measurable. |
| Checkpoints | How often to summarize, what to report, and how to group related work. | Makes status useful before the final answer. |
| Stop rules | When to pause for product decisions, credentials, risky deletes, unclear tests, or missing repros. | Keeps autonomy from turning into guessing. |
/goal
Clear the Linear view "May cleanup" of all reproducible P0/P1 bugs.
Read first:
- Linear issues in the view, linked logs, recent CI failures, AGENTS.md, and test docs.
Scope:
- Fix only bugs with a clear repro or failing test.
- Do not change billing behavior, auth policy, or data deletion flows without asking.
Proof:
- For each fixed issue, run the targeted regression test.
- Run bun test and bun run typecheck before final handoff.
Checkpoints:
- Group related failures and report status after each group.
- Include issue id, files changed, test command, and result.
Stop if:
- A product decision is needed.
- Credentials are missing.
- The bug cannot be reproduced.
- The fix would require a risky migration.Best use case
Use /goal For Backlogs, Not One-Off Bugs
The famous /goal shape is the overnight backlog run: point Codex at a queue, let it work through related failures, and wake up to a reviewed set of fixes, tests, blockers, and residual risk. The value is not that Codex can fix a bug. The value is that it can keep context across a queue instead of making you restart the investigation every fifteen minutes.
- Good backlog goal: fix every reproducible P0/P1 in one scoped view, with tests and a blocker list.
- Bad backlog goal: fix all bugs everywhere and make the app better.
- Good migration goal: move one package to the new API, preserve rollback, and pass contract tests.
- Bad migration goal: modernize the codebase.
- Good cleanup goal: classify stale issues, close duplicates, draft release notes, and list decisions for a human.
The human still owns judgment
/goal should not hide uncertainty. It should surface it. The final answer should include what changed, what passed, what remains, which decisions are blocked, and what a reviewer should look at first.How To Manage A Running /goal
OpenAI's CLI docs describe /goal as a slash command for setting or viewing an experimental task goal. The same command family gives you the steering loop: inspect status, pause when the run needs review, resume after you answer, and clear the goal when the work is done or the direction changes.
| Moment | What to ask | What you want back |
|---|---|---|
| Early run | What did you read and what is your checkpoint plan? | A short map of the repo, issue groups, and proof commands. |
| Mid-run | What changed, what passed, and what remains? | Checkpoint summary with files, tests, blockers, and confidence. |
| Risk appears | Pause and explain the decision needed before touching that area. | A concrete question, options, and the cost of each option. |
| Final handoff | Summarize changes, proof, failures, residual risk, and next review steps. | A reviewer-ready package instead of a vague “done.” |
Useful status prompts:
What checkpoint are you on?
What evidence says this bug is fixed?
Which issues are blocked and why?
What commands are still running?
Show me the diff summary before continuing.
Pause before touching auth, billing, deletes, migrations, or production config.Hosting angle
Why /goal Wants A Persistent Mac
A long-running Codex goal is only as reliable as the computer underneath it. The official Codex cloud task model checks out a repo, runs setup, executes terminal commands in a loop, uses AGENTS.md when present, validates work, and returns a diff. That loop is also the reason local and remote environments matter: the agent needs the repo, test cache, browser sessions, credentials, simulators, logs, and desktop tools to still be there when the next checkpoint starts.
| Long-running /goal needs | Why a laptop is fragile | Why a Hyperbox Mac mini helps |
|---|---|---|
| Hours of tests, builds, and retries | Sleep, travel, battery, and flaky Wi-Fi interrupt the loop. | The Mac stays online with SSH and VNC recovery. |
| Browser or app sessions | Personal browser state gets mixed with agent work. | A dedicated browser profile and macOS user keep state isolated. |
| Xcode, iOS Simulator, or Mac-only apps | The environment has to be real macOS, not a Linux stand-in. | The runtime is a full Mac with desktop access. |
| Large repo context | Cold clones and missing caches waste the first hour. | The repo, dependencies, and build caches stay warm. |
| Reviewable handoff | Work can disappear into a sleeping session or scattered terminals. | Logs, diffs, screenshots, and running processes remain reachable. |
Recommended host layout:
Hyperbox Mac mini
repo checkout
AGENTS.md with project commands
dedicated macOS user
browser profile for Codex
Xcode / simulator / desktop apps when needed
SSH + VNC recovery
persistent logs and screenshots
Your laptop
review diffs
steer /goal status
pause/resume/clear the run
approve product decisionsGood /goal Examples You Can Reuse
The best goals are boringly specific. They name a queue, a repo boundary, a proof loop, and a stop rule. Here are practical examples that are safer than “go fix everything.”
/goal
Migrate the dashboard package from the legacy REST client to the typed API client.
Read AGENTS.md, packages/dashboard/README.md, existing API tests, and the migration plan first.
Do not touch auth, billing, or analytics behavior.
For each migrated route, add or update a contract test.
Run bun test packages/dashboard and bun run typecheck.
Stop if an endpoint has no typed equivalent or if behavior differs from production logs./goal
Rebuild the public changelog for releases v0.18 through v0.23.
Read release tags, merged PRs, commit history, and existing changelog style.
First produce a candidate table: release, commit or PR, shipped change, confidence, include or skip.
Skip experiments, refactors, and feature-flagged work unless user-facing.
Then draft release notes and list any uncertain entries for review.
/goal
Record the live product demo and produce a timestamped transcript.
Open the event URL in the browser profile named codex-capture.
Verify the page is live, audio is present, and the recording file is growing.
Save the audio, transcript, speaker notes, and a five-bullet decision summary.
Stop if login, consent, or recording permission is unclear.
When Not To Use /goal
/goal is powerful precisely because it encourages autonomy. That is also why it is the wrong tool for fuzzy, high-risk, or decision-heavy work. Use a normal prompt, planning turn, or human review loop when the outcome is not measurable yet.
| Avoid /goal when | Use this instead |
|---|---|
| You do not know what finished means. | Ask Codex to write a plan or options memo first. |
| The task touches irreversible production data. | Use read-only analysis and explicit human approval. |
| The work depends on product taste or strategy. | Ask for prototypes, tradeoffs, and decision points. |
| Credentials, permissions, or legal consent are unclear. | Stop and set up the environment before running the goal. |
| The codebase has no reliable tests or run commands. | Ask Codex to create the verification harness first. |
Make AGENTS.md Do The Boring Work
Codex cloud environment docs call out AGENTS.md as the place Codex can find project-specific lint and test commands. For /goal, that file is leverage. It keeps every long run from rediscovering how the repo works.
# AGENTS.md
## Project commands
- Install: bun install
- Typecheck: bun run typecheck
- Unit tests: bun test
- SEO files: bun run seo:generate
## Goal rules
- Start long tasks by reading linked issues, failing logs, and this file.
- Prefer targeted tests before full-suite tests.
- Never modify auth, billing, deletes, or production config without asking.
- For final handoff, include changed files, commands run, results, blockers, and residual risk.
## Visual work
- Run the local dev server.
- Capture desktop and mobile screenshots.
- Fix layout or image issues before calling the task done.This is where Hyperbox helps SEO and delivery
AGENTS.md, repo caches, browser profiles, screenshots, and logs in one place. That means future goals start warm instead of spending their first thirty minutes rebuilding context.The Practical /goal Checklist
- Write one objective and one stop condition.
- Tell Codex what to read before editing.
- Define in-scope and out-of-scope files, systems, and behaviors.
- Name the proof commands and artifacts that count as progress.
- Ask for checkpoints with files changed, tests run, and blockers.
- Use /goal status to inspect progress instead of waiting blindly.
- Pause before risky areas such as auth, billing, deletes, migrations, or production config.
- Run the goal on a persistent machine when the task needs hours of tests, browsers, desktop apps, or Mac-only tools.
- Make the final handoff reviewable: summary, diff, proof, failures, residual risk, and next steps.
Frequently asked questions
What is Codex /goal?
Codex /goal is a Codex CLI slash command for setting, viewing, pausing, resuming, or clearing a durable task goal. It is useful when a coding task needs multiple checkpoints, tests, and iterations instead of one prompt-response cycle.
What should I include in a Codex /goal prompt?
Include one objective, one stop condition, read-first context, in-scope and out-of-scope areas, proof commands, checkpoint expectations, and stop rules for risky or ambiguous work.
When should I use /goal instead of a normal Codex prompt?
Use /goal for long-running work such as backlog cleanup, migrations, release notes, test repair, browser capture, and repo archaeology. Use a normal prompt for small fixes, questions, one-off edits, and tasks without a measurable finish line.
Why run Codex /goal on a remote Mac mini?
Long-running goals need a stable machine with the repo, build cache, browser sessions, logs, desktop apps, and SSH or VNC recovery. A persistent Mac mini keeps that environment available after your laptop sleeps or disconnects.
Related reading
Always-on Mac runtime
Give your agent a Mac that stays online after your laptop closes.
Hyperbox gives Codex, Claude Code, OpenClaw, and remote dev workflows a persistent macOS machine with SSH, VNC, and full desktop access.