You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Add /loop command for automated iterative task execution #23578
Add a built-in /loop command to OpenCode for automated iterative task execution.
The goal is to support a workflow similar to Claude Code's /loop, where the agent can continue working on a task across repeated iterations without the user having to manually re-prompt each time.
Requested behavior:
/loop <prompt>
Starts a self-paced loop for the current session
Runs one iteration immediately
If the model indicates more work is needed, it continues automatically
Stops when the task is complete, blocked, or the user stops it
/loop <interval> <prompt>
Example: /loop 5m check whether the deploy finished
Runs one iteration immediately, then repeats on the requested interval
/loop stop
Stops the active loop for the current session
/proactive
Optional alias for /loop
If /loop is run without a prompt:
Use a project-level default prompt from .claude/loop.md if present
Otherwise fall back to a built-in default maintenance prompt
Expected benefits:
Makes long-running and check-back-later workflows much easier
Improves support for proactive/autonomous agent usage
Reduces repeated manual prompting for monitoring, validation, and follow-up tasks
Brings OpenCode closer to expected behavior from other coding agents that already support loop-style execution
Suggested implementation constraints:
Keep it server-backed so it works consistently across app/TUI
Reuse the existing session/command runtime instead of building a separate scheduler in the frontend
Make loop state session-scoped
Ensure users can stop loops explicitly
Avoid exposing internal loop control markers in visible assistant output
Examples of use cases:
Monitor a deploy and report back when it is complete
Periodically rerun tests or checks during ongoing work
Continue a multi-step maintenance task until there is nothing left to do
Perform proactive project checks when the user asks the agent to “keep going until done”
This would be a core workflow feature, so I’m opening this as a feature request first for discussion and design review.
Reacted by Trevon, Carbo, leonam, Jatin K Malik, Mehdi Memar and Akshay Iyyadurai Balasundaram
Activity
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.