Originally published at devtoolpicks.com
OpenAI just shipped /goal workflows to Codex CLI. The feature lets you give Codex a high-level objective, walk away, and come back later to a paused or completed run. You can create a goal, pause it, resume it, and clear it, all from the terminal interface. The state persists across sessions, so closing your laptop doesn't kill the work.
This is OpenAI's clearest move yet to match Claude Code's agent loop in a way that feels native to the terminal. With over 4 million weekly Codex users, the timing matters. The question for indie hackers: should you switch your agent workflow from Claude Code to Codex, or stay where you are?
Here is what /goal actually does, what it is missing, and how it compares to Claude Code agents in practice.
What /goal Actually Does
The /goal feature is a slash command inside the Codex CLI's terminal interface. You type /goal create followed by your objective, and Codex starts working. Unlike a regular Codex session, the goal persists. You can:
- Create a goal with a multi-step objective ("refactor the auth module to use JWT, then update tests")
- Pause it at any point with
/goal pause - Resume later with
/goal resume - Clear the state with
/goal clear
The persistence layer is built on app-server APIs and runtime continuation. That means the agent can survive process restarts, reboots, and TUI exits. The state is stored locally and tied to the Codex session, so you can pick up where you left off even if your terminal crashed.
Codex pairs /goal with new model tools that are specifically designed for long-running autonomous work. The release notes mention plan-mode nudges (the agent stops to confirm direction at key checkpoints), action-required terminal titles (your terminal title bar tells you when human input is needed), and active-turn /statusline and /title edits (real-time status visibility while the agent works).
This is more than a convenience feature. It is OpenAI building the infrastructure for agents that run for hours or days without sitting in front of a screen.
How Claude Code Agents Compare
Claude Code has had agent capabilities for months, but the architecture is different.
Claude Code agents run inside a single session. You give the agent a task, it works through it, and the session holds context until you close it or hit a limit. There is no native equivalent to /goal pause or /goal resume. If you close the terminal, the conversation context is gone unless you explicitly save the session.
Claude Code does have agent teams (parallel sub-agents) and long-running tasks, but they run inside the active session. The feature set is mature for in-session work but weaker for state persistence across days.
Where Claude Code currently wins:
- Agent quality. Most developers I've seen comparing the two say Claude (especially Opus 4.7) produces cleaner code on complex refactors. This is subjective and changing fast, but the consensus on Hacker News and r/ClaudeAI as of this week leans Claude for agent reasoning.
- Subscription pricing. Claude Max at $200/month covers heavy Claude Code use without surprise bills. Codex bills through your ChatGPT plan or via API tokens, which can stack up unexpectedly.
- Hooks and automation. Claude Code's hook system, despite some recursion bugs, is more mature for wrapping tool calls and integrating with external scripts.
Where Codex wins now with /goal:
- State persistence. This is the headline. If you want an agent that survives across days, Codex just leapfrogged Claude Code.
- Multi-environment management. The same May 2026 release added turn-scoped environment selections, so an agent can switch between dev, staging, and remote environments per task. Claude Code does not have a clean equivalent.
- AWS Bedrock support. Codex now ships first-class Amazon Bedrock support with SigV4 signing. If your team runs on AWS, this is a real advantage.
- External agent imports. You can import sessions from other agent harnesses into Codex, which is useful if you are migrating workflows.
What /goal Is Missing
Two things stand out as gaps based on the release notes.
No spending caps tied to goals. Like Claude Code, Codex does not have a hard "stop spending at $X" cap on goals. If your /goal runs into a loop or chews through tokens unexpectedly, your only protection is the broader plan-level limits or API workspace caps. After watching one developer burn $6,000 in Claude credits overnight, this is the first thing I'd want from any agent system. Neither tool has it natively yet.
Limited visibility during long runs. Codex shows action-required terminal titles, but there is no built-in dashboard for monitoring what an agent is doing in real time. If you create a goal and walk away for six hours, you'll come back to a transcript and a status, not a clear breakdown of what the agent did at each step.
Plan mode is still nudge-based. Plan-mode nudges (asking the agent to confirm direction at checkpoints) are a soft control, not a hard one. The agent decides when to nudge. If it's confident in a wrong direction, it might never stop to ask. Claude Code's permission prompts are more aggressive about asking for explicit approval before risky actions.
Should Indie Hackers Switch?
The honest answer: not for most workflows.
If you are an indie hacker shipping a SaaS solo, the kind of work you do (building features, fixing bugs, writing tests) tends to fit in single sessions. You don't typically need an agent that survives a three-day refactor. Claude Code's session-level agents handle this fine.
/goal becomes valuable in three scenarios:
-
Multi-day refactors or migrations. Moving a codebase from one framework to another, or rewriting a legacy module, can take days.
/goallets you check in on progress without restarting context every time. - Long-running data tasks. Codex-driven data cleanups, schema migrations, or large-scale testing runs benefit from persistent state.
-
Team workflows where the agent might be paused for review. If a senior dev needs to approve direction at certain checkpoints,
/goal pauseis much cleaner than killing and restarting a session.
For most indie hackers building day-to-day, the bigger question is whether Claude Code or Codex is the better tool overall. The answer hasn't changed dramatically with this release. Claude still has the edge on raw code quality. Codex now has the edge on long-running autonomous work.
If you already use Claude Code daily, this isn't a reason to switch. If you've been considering Codex anyway and your work involves multi-day tasks, /goal might tip the balance.
The Bigger Picture
What's interesting about /goal is what it signals about where AI coding tools are heading. Six months ago, agents were a feature. Now they're the platform.
OpenAI added 4 million weekly Codex users since the February launch. Anthropic shipped Claude Code Channels (Discord and Telegram integration) in March. Both companies are betting that the next year of AI coding tools is about agents that run autonomously across days, not chat sessions that need babysitting.
The risk is the same one we covered yesterday: agent loops and runaway billing. The more autonomous the agent, the higher the cost of a bug. Neither Codex nor Claude Code has solved this yet.
If you're testing /goal, do what you should already be doing with any autonomous agent: cap your API spend, disable auto-reload on your billing account, run small test goals before long ones, and check /cost (in Claude Code) or your OpenAI usage dashboard before walking away from a session.
For comparing AI coding tools side by side, see Cursor vs Windsurf vs Zed for indie hackers. For the broader Codex vs Claude Code question, our direct comparison covers pricing, agent quality, and IDE integrations.
FAQ
Is /goal available on the free Codex plan?
The free plan limits how long agents can run autonomously. The /goal feature works on free, but the persistence and long-running aspects shine on Pro, Business, or Enterprise plans where session limits are higher.
Can I use /goal with the Codex desktop app?
The current release focuses on Codex CLI. The desktop app has its own task management UI, but persisted /goal workflows specifically refer to the CLI integration with app-server APIs. Expect parity in future releases.
How does /goal handle errors mid-run?
If the agent hits an unrecoverable error or a tool call fails repeatedly, the goal pauses automatically and surfaces a terminal title indicator. You can resume after fixing the issue or clear the goal entirely.
Does /goal work with the codex update command?
Yes. The same May 2026 release added codex update for self-updates. You can update Codex without losing in-progress goals because the persistence layer is decoupled from the binary.
Can I run multiple /goals in parallel?
Codex supports multi-agent workflows through MultiAgentV2, which the May 2026 release also expanded. You can have multiple goals active across different environments, but each goal is tied to its own thread and configuration. For most indie hacker work, one active goal at a time is the right pattern.
Top comments (0)