Skip to content

[FEATURE]: Add a Ralph-style loop plugin built on experimental.idle #61293

Closed as not planned

Description

@Gutem

Describe the enhancement you want to request

Problem

Users who want the Ralph Wiggum technique have to wrap opencode run in an external shell loop. Claude Code implements it as a blocking Stop hook; OpenCode has no on_exit, but experimental.idle already supports the same use case — the built-in /goal plugin uses it as a stop-hook-style loop.

Proposal

Add an official plugin at packages/plugins/ralph-loop built on experimental.idle:

  • /ralph-loop <task> [--completion-promise <text>] [--max-iterations <n>]
  • /cancel-ralph
  • state persisted per session and as a session instruction entry, so compaction does not lose the task
  • waits for the session's own running shell/subagent; that work wakes it again
  • pauses on server restart instead of resuming silently
  • only injects synthetic prompts; it never runs tools or bypasses permissions

No core changes and no new runtime dependency. Local branch with implementation and tests is ready; I am opening this request before the implementation PR, per CONTRIBUTING.

Benefits

  • first-class Ralph loops without external wrappers
  • bounded by --max-iterations
  • safer than a shell loop: provider permissions and session state remain authoritative
  • reuses the mechanism already exercised by /goal

Activity

  1. opencodejr commented on Nov 2, 2026

    @opencodejr
    Contributor

    Thanks for the detailed proposal, and for opening a request before the PR, @Gutem!

    To restate it: you'd like an official ralph-loop plugin built on the existing experimental.idle session hook. It would add /ralph-loop <task> [--completion-promise <text>] [--max-iterations <n>] and /cancel-ralph, so the same task keeps running until the completion marker appears or the iteration limit is reached, without an external shell loop. The maintainers will consider it, including whether it should ship as an official plugin or be listed as a community plugin.

    Because it needs no core changes, you can publish it now as a standalone npm package and load it through the plugin list in your config, so people can use it before any decision on including it.

    Related issues:

  2. neriousy commented on Nov 12, 2026

    @neriousy
    Member

    experimental.idle was built so this can live as a community plugin. We won't ship it as an official one, but feel free to publish it.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions