anomalyco / anomalyco/opencode
[FEATURE]: /loop — dynamically repeat a command N times
Open
@rekram1-node is already working on this.
Since Aug 12, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Requested feature
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 existing
session.interruptpath.
Benefits
- Native retry/iterate workflows for flaky tests, convergence loops, or repeated formatting/lint passes without writing a script.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.