Feature request: /loop for live Codex CLI sessions
What variant of Codex are you using?
CLI
What feature would you like to see?
I would like a first-class /loop feature for live CLI sessions.
This request is narrower than a general "long task mode". I am not asking for unlimited autonomous execution or broad auto-approval. I am asking for a session-scoped loop that lets Codex keep checking a condition and take action inside the same open session, so I can review the situation at any time without restarting or resuming manually.
The concrete workflow is long-running experiments:
- I start an experiment in a Codex CLI session.
- I keep that session open because I want to inspect progress and intervene if needed.
- While the experiment runs, I want Codex to periodically check logs/status.
- If the experiment is still healthy, Codex should keep waiting.
- If the experiment fails, Codex should inspect the error, fix the bug, restart the experiment, verify recovery, and then continue monitoring.
Example UX:
/loop every 60s check logs/train.log and job status.
If healthy, continue looping quietly.
If failed, inspect the failure, fix the issue, restart the experiment, confirm recovery for 5 minutes, then continue looping.
Why this matters:
codex exec resumeis useful after the fact, but it is not the same as a live loop inside the current CLI session.- For review-heavy workflows, I want the main session to stay open and be the source of truth while the monitoring behavior continues.
- This is especially useful for experiments, builds, deployment checks, and other long-running local processes.
The key product behavior I am asking for:
- Session-scoped recurring prompts in the current live session.
- The session stays open and reviewable while the loop is active.
- Clear controls such as list/pause/resume/cancel for active loops.
- Optional "quiet while healthy" behavior to avoid noisy intermediate replies.
- Reasonable safety limits such as minimum interval, loop visibility, and easy interruption.
Related issues:
- #4357 requested a broader "Long Task Mode" and was closed as not planned.
- #7145 describes the same pain point from a user perspective: Codex reports back after each chunk instead of staying in a monitor/check/fix/restart loop.
- This request is intentionally narrower and more concrete than those issues.
From the outside, this also seems aligned with the newer app-server / thread primitives. Even if the implementation is internal, a first-class CLI /loop command would cover a real workflow gap without forcing users to build custom external schedulers around Codex.
Additional information
- I am using
codex-cli 0.116.0. - I would vote strongly for even a minimal v1:
/loop every <duration> <prompt>/loop list/loop cancel <id>- If useful, I would also be happy with this being explicitly session-scoped and non-persistent across CLI restarts for a first release.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗