npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-ralph-loop

v1.0.7

Published

Minimal Ralph Loop plugin for opencode - auto-continues until task completion

Readme

opencode-ralph-loop

Minimal Ralph Loop plugin for opencode - auto-continues until task completion.

Inspired by Anthropic's Ralph Wiggum technique for iterative, self-referential AI development loops.

Why this plugin?

oh-my-opencode is a fantastic, feature-rich plugin that includes Ralph Loop along with many other powerful capabilities like the Sisyphus orchestrator, background agents, and more.

However, we personally found the full suite a bit heavy for our workflow. We also noticed others in the community expressing interest in specific features without needing the complete package. So we extracted just the Ralph Loop functionality into this standalone, lightweight plugin.

If you want the full-featured experience, definitely check out oh-my-opencode. If you just want auto-continuation loops with minimal overhead, this plugin is for you.

Installation

Add to your ~/.config/opencode/opencode.json:

{
  "plugin": ["opencode-ralph-loop"]
}

Restart opencode. That's it!

On first run, the plugin will automatically install skills and commands to your ~/.config/opencode/ directory.

Usage

Start a loop

/ralph-loop "Build a REST API with authentication"

The AI will work on your task and automatically continue until completion.

Cancel a loop

/cancel-ralph

Get help

/help

How it works

  1. /ralph-loop creates a state file at .opencode/ralph-loop.local.md
  2. When the AI goes idle, the plugin checks if <promise>DONE</promise> was output
  3. If not found, it injects "Continue from where you left off"
  4. Loop continues until DONE is found or max iterations (100) reached
  5. State file is deleted when complete

Completion Promise

When the AI finishes a task, it outputs:

<promise>DONE</promise>

Important: The AI should ONLY output this when the task is COMPLETELY and VERIFIABLY finished. False promises are not allowed.

State File

The loop state is stored in your project directory:

.opencode/ralph-loop.local.md

Format (markdown with YAML frontmatter):

---
active: true
iteration: 3
maxIterations: 100
sessionId: ses_abc123
---

Your original task prompt

Add .opencode/ralph-loop.local.md to your .gitignore.

Features

  • Plug-and-play: Just add to config and restart - no manual setup
  • Auto-setup: Skills and commands are automatically installed on first run
  • Minimal: ~300 lines, no bloat
  • Project-relative: State file in .opencode/, not global
  • Completion detection: Scans session messages for DONE promise
  • Progressive context: Skills provide context only when needed
  • Commands: /ralph-loop, /cancel-ralph, and /help

Architecture

Following Anthropic's Claude Code plugin pattern:

opencode-ralph-loop/
├── src/
│   └── index.ts        # Main plugin with event hooks and tools
├── skills/
│   ├── ralph-loop/     # Progressive context for starting loops
│   ├── cancel-ralph/   # Context for cancellation
│   └── help/           # Plugin documentation
├── commands/
│   ├── ralph-loop.md   # Slash command for starting
│   ├── cancel-ralph.md # Slash command for cancelling
│   └── help.md         # Slash command for help
└── package.json

Credits

License

MIT