Skip to content

Feature request: /loop for live Codex CLI sessions #15950

Closed as duplicate
Closed as duplicate

Description

@QIANSUIMINGMINGMING

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:

  • Feature Request: Long Task Mode #4357 requested a broader "Long Task Mode" and was closed as not planned.
  • Cant do long running tasks #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.

Activity

  1. github-actions commented on Mar 27, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  2. etraut-openai commented on Mar 27, 2026

    @etraut-openai
    Contributor

    Please upvote #15679

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions