Skip to content

[FEATURE]:Implement /loop command for automated iterative task execution #18001

Closed as not planned

Description

@doko89

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Currently, performing repetitive or time-based tasks in OpenCode requires long, descriptive natural language prompts or external scripting (Python/Bash). While OpenCode is powerful at autonomous execution, it lacks a shorthand, native command to handle iterative workflows—similar to the /loop feature in Claude Code.

Implementing a native /loop command would bridge the gap between "one-off task execution" and "autonomous background agent."

User Story
"As a developer, I want to execute a command like /loop 60m 'check MCP kanban, code task, commit, and push' so that I can automate my entire development lifecycle without manually re-triggering the interpreter or writing custom cron-logic."

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Mar 17, 2026
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 17, 2026
  3. github-actions commented on Mar 17, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Please review that issue and consider whether your request is covered there or adds something distinct.

  4. viniciusdebruin commented on Mar 22, 2026

    @viniciusdebruin

    I need this too

  5. itstamhn commented on Apr 4, 2026

    @itstamhn

    me too

  6. bradystroud commented on Apr 15, 2026

    @bradystroud

    +1 on this. For reference, Claude Code shipped a similar feature that could inform the design here:

    https://code.claude.com/docs/en/scheduled-tasks#run-a-prompt-repeatedly-with-/loop

    Key aspects of their implementation worth considering:

    • Fixed interval mode: /loop 5m <prompt> runs the prompt every N minutes/hours.
    • Dynamic/self-paced mode: /loop <prompt> (no interval) lets the model decide when to wake itself up based on what it's waiting for — e.g., poll a build every 60s vs. check an idle queue every 30min. This avoids burning prompt-cache TTL (5min on Anthropic) with pointless short sleeps.
    • Stop conditions: the loop ends when the model decides there's nothing left to do, or the user interrupts.
    • Autonomous variant: a sentinel prompt that fires without user input for fully unattended runs.

    The dynamic-pacing piece is what makes it meaningfully different from just wrapping cron or a bash while loop — the agent picks its own cadence based on what it's actually waiting for.

  7. bradystroud commented on Apr 15, 2026

    @bradystroud

    Related: #11232 (Native Scheduling for Opencode) — overlapping scope. A native scheduler could provide the underlying primitive that /loop builds on top of (fixed-interval mode), while /loop's dynamic self-paced mode is a distinct capability.

  8. danieliyahu1 commented on Apr 25, 2026

    @danieliyahu1

    Anyone one know if there is a plan to add it?
    It will be amazing to have it

  9. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  10. neuralnexus commented on May 23, 2026

    @neuralnexus

    this would be a good improvement.

  11. huybuidac commented on Jun 11, 2026

    @huybuidac

    I see OpenCode feature release too slow.
    Let see CC: agent-team, dynamic workflow, loop, goal, etc... they create and copy so fast

  12. sabateen2github commented on Jun 16, 2026

    @sabateen2github

    Hi team, any updates?

  13. yondifon commented on Jun 25, 2026

    @yondifon

    https://github.com/yondifon/opencode-loop

    guys, i've been testing all morning. will love to get your feedback on it.

  14. SheldonGrant commented on Jul 13, 2026

    @SheldonGrant

    https://github.com/yondifon/opencode-loop

    guys, i've been testing all morning. will love to get your feedback on it.

    Like @yondifon approach here. Isn't the whole point of opencode that the plugin primitive is enough to build which ever functionality you would need. And have community contribution to maintain functionality. Only bringing functionality back in to the core codebase when it's universally agreed upon?

  15. github-actions commented on Sep 12, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions