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]: /loop — dynamically repeat a command N times #41907
Add a /loop <command> slash command (inspired by Claude Code's /loop) that repeats a command dynamically — either a fixed count or until a condition is met.
Why
openCode's session.command execution path (packages/opencode/src/command/index.ts) is single-shot: one slash command maps to one template invocation. There is no built-in looping/iteration primitive for rerunning a task until success, until a test passes, or a fixed N times.
Proposed behavior
/loop 5 <cmd> runs a command 5 times.
/loop until-pass <cmd> retries a command until it exits successfully.
Loop state (count, per-iteration result/timestamps) surfaced in the TUI; interruption via the existingsession.interrupt path.
Benefits
Native retry/iterate workflows for flaky tests, convergence loops, or repeated formatting/lint passes without writing a script.
Activity
github-actions commentedon Aug 12, 2026
This issue might be a duplicate of existing issues. Please check:
/loopslash command with count and condition-based retry variantsgithub-actions commentedon Oct 11, 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.