Feature request: /loop for live Codex CLI sessions

Resolved 💬 2 comments Opened Mar 27, 2026 by QIANSUIMINGMINGMING Closed Mar 27, 2026

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 resume is 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:

  1. Session-scoped recurring prompts in the current live session.
  2. The session stays open and reviewable while the loop is active.
  3. Clear controls such as list/pause/resume/cancel for active loops.
  4. Optional "quiet while healthy" behavior to avoid noisy intermediate replies.
  5. 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗