A practical way to make Claude Code and Codex work longer

A user shared how they use Claude Code and Codex for longer-running work. The main lesson is simple: give the AI a clear goal, clear finish rules, and clear limits before it starts.

The post focuses on Codex CLI and its /goal feature. /goal saves the task goal, so Codex can continue after a terminal restart, laptop sleep, or pause. The author describes one real run that lasted about 6 hours and 44 minutes in wall time, with about 41 minutes of actual model compute. They also reported about 6.8 million tokens of input and a cache hit rate around 94%.

The post compares this with a Claude Code loop that runs the agent again and again, often using files and git history as memory. Codex /goal is more about keeping one long task alive with continuing context. For a solo maker, this matters for clear jobs like adding tests, refactoring a feature, or chasing a tricky bug. The warning is that settings like approval_policy = "never" and sandbox_mode = "danger-full-access" can be risky, because they let the agent act without stopping to ask.

Key points

  • Codex CLI /goal lets a coding agent keep working after interruptions.
  • The example run lasted about 6 hours and 44 minutes, but used about 41 minutes of actual model compute.
  • The author says long runs need clear finish rules, a file reading list, and guardrails.
  • Claude Code loops and Codex /goal solve a similar problem in different ways.
  • Hands-off agent settings are useful, but risky on sensitive or messy projects.

Quick term guide

Codex CLI
A command-line tool for using OpenAI Codex from a terminal.
terminal
A text-based way to use a computer by typing commands.
compute
The server power and chips needed to run AI systems.
cache hit rate
The share of reused AI processing from earlier context instead of doing it again.
context
The information an AI uses to understand your request, such as files, notes, and past messages.
refactoring
The process of reorganizing and cleaning up the internal code of a program without changing what it actually does on the outside.
coding agent
An AI tool that writes or edits code from a person’s instructions.
guardrails
Rules and checks that keep AI from doing harmful or unwanted things.
Read original