YOUTUBE
The new /go (goal) command lets Codex run a self‑directed, long‑running optimisation loop until a clearly defined objective—e.g., “reduce P95 latency by 20 %”—is met, making it especially valuable for exploratory work where the solution shape is unknown.
Ray Amjad demonstrates that Codex’s goal feature acts as an autonomous “agent‑in‑the‑loop”: you give it a concrete, verifiable target, it maps the repo, iterates, and reports progress, while you retain control via pause/resume/clear commands. Proper goal framing and resource provision are critical to avoid runaway token consumption.
Goal vs. Ticket Workflows –
- Ticket‑style tasks have a known solution shape; use Codex for rapid PR generation.
- Exploratory goals have undefined solutions; /go keeps searching until a metric is hit. 1
Setup Is Straightforward –
- Add features.goals = true to config.ml, then run codex in a terminal. The command /go <goal‑prompt> starts the loop; /goal pause, /goal resume, /goal clear, and /goal (status) manage it. 2
Well‑Defined, Verifiable Goals Prevent Token Waste –
- Goals must include a clear stop condition (e.g., a latency target). Vague prompts like “make it better” cause indefinite runs and high token costs. 3
Resource Access Determines Success –
- For performance goals, give the agent live logs, cost data, flame‑graphs, and a staging environment. Without these, the model can only speculate. 4
Compaction Behaviour Matters –
- Codex retains prior reasoning across turns; good compaction preserves signal‑to‑noise, while poor compaction degrades the “value of the Fred” (the remaining useful context). 5
Side‑Thread (/side) Keeps Main Goal Focused –
- Running /side opens a parallel view for ad‑hoc questions without interrupting the main goal’s progress. 6
Post‑Goal Clean‑Up Is Essential –
- After a goal finishes, prune debug prints and temporary branches; synthesize learnings into a PRD before shipping to avoid “scar tissue” in the codebase. 7
“The goal command is most powerful when you don’t know the shape of the solution up front.” — Ray Amjad, ~02:451
“If you just say ‘make this better’ the model will run forever because ‘better’ isn’t a concrete metric.” — Ray Amjad, ~07:103
⚠ UNVERIFIED — “A person got a 25 % FPS improvement on their game by using /go.”
No public benchmark or tweet was located confirming this specific claim.⚠ UNVERIFIED — “Codex’s compaction is widely regarded as better than “claw‑code” compaction.”
“Claw‑code” appears to be a colloquial term; no comparative study found.
/go command and related flags. For solo developers: Deploy /go on performance‑heavy features (e.g., latency reduction) to automate trial‑and‑error without constant prompting.
For engineering teams: Use goal‑driven runs to prototype specs; distill the output into a PRD, then hand‑off to conventional PR workflows for code review and QA.
For product managers: Define measurable acceptance criteria (KPIs) early; the goal agent will stop only when they’re met, giving you a clear “done” signal.
Ray Amjad, ~02:45 – “goal command is most powerful when you don’t know the shape of the solution up front.” ↩↩
Ray Amjad, ~01:30 – Configuration steps for enabling goals. ↩
Ray Amjad, ~06:20 – Supplying logs, cost data, and staging envs. ↩
Ray Amjad, ~08:30 – Compaction’s impact on “value of the Fred.” ↩
Ray Amjad, ~09:00 – Using /side to open a parallel thread. ↩
Ray Amjad, ~11:45 – Post‑goal clean‑up and PRD synthesis. ↩