# ralph-loop

Run, monitor, resume, and debug Ralph orchestrator loops directly from your AI agent. Useful for checking diffs, inspecting logs, and managing worktree merge queues.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 3189
- Author: mikeyobrien
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/mikeyobrien/ralph-orchestrator/tree/HEAD/skills/ralph-loop/SKILL.md
- Updated: 2026-10-15
- HTML: https://affpapa.org/en/nevibecode/skills/mikeyobrien-ralph-loop

## What it does

This skill teaches the agent to inspect, run, and control Ralph orchestrator loops through the CLI. It starts by running `ralph loops list` or its JSON variant to read active worktrees and loop states. When starting an execution, it supplies the core configuration with `-c` and hat sources with `-H`.

Troubleshooting follows strict rules before any state changes occur. The agent inspects `logs`, `history`, and diffs instead of editing `.ralph` files directly. Suspended runs are recovered by reading `.ralph/suspend-state.json` followed by `ralph loops resume <id>`. Removing lock files is permitted only after confirming the background process is dead.

Tasks and runtime memories form the canonical state rather than a temporary scratchpad. For worktrees waiting in `needs-review`, the agent reviews code changes before running `merge` or `discard`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add mikeyobrien/ralph-orchestrator --skill ralph-loop -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/ralph-loop/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/ralph-loop/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add mikeyobrien/ralph-orchestrator --skill ralph-loop -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/ralph-loop/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add mikeyobrien/ralph-orchestrator --skill ralph-loop -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/ralph-loop/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install mikeyobrien/ralph-orchestrator ralph-loop
```

2. **Manually: put the files in place**
- File: `.github/skills/ralph-loop/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add mikeyobrien/ralph-orchestrator --skill ralph-loop -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/mikeyobrien/ralph-orchestrator --path skills/ralph-loop
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/ralph-loop/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add mikeyobrien/ralph-orchestrator --skill ralph-loop -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/mikeyobrien/ralph-orchestrator/tree/HEAD/skills/ralph-loop/SKILL.md

## When to use it
- start Ralph runs with specific `-c` and `-H` inputs
- resume hook-suspended loops using their loop ID
- inspect logs, history, and diagnostics for stuck processes
- review worktree diffs and merge completed tasks from the queue

## Example prompts
- Check the active Ralph loops using `ralph loops list --json`
- Inspect diagnostics and resume the suspended loop with id `loop-42`
- Review the diff for the loop in `needs-review` and merge it

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: d74ebb928d3f26fa.

BEGIN THIRD-PARTY FILE d74ebb928d3f26fa
```text
---
name: ralph-loop
description: Run, monitor, resume, merge, and debug Ralph loops. Use this skill whenever the user asks to operate `ralph run` or `ralph loops`, inspect loop state, recover suspended loops, analyze diagnostics, or unblock merge queue issues.
---

# Ralph Loop

Use this skill to operate Ralph loops from the outside.

## Use This Skill For

- Starting or continuing a Ralph run with the right `-c` and `-H` inputs
- Inspecting loop state, worktrees, logs, history, and diffs
- Resuming a hook-suspended loop
- Merging or discarding completed worktree loops
- Debugging unexpected loop behavior with current diagnostics files

## Workflow

1. Start with `ralph loops list` or `ralph loops list --json` to establish the
   current state.
2. If the user wants execution, run `ralph run ...` with the right core config
   and hats source.
3. If the loop is stuck or suspicious, inspect `logs`, `history`, and `diff`
   before changing state.
4. If the loop is suspended, read `.ralph/suspend-state.json` and use
   `ralph loops resume <id>`.
5. If a loop is queued or in `needs-review`, inspect the diff first, then use
   `merge`, `process`, `retry`, or `discard` as appropriate.
6. Use diagnostics when you need detailed evidence about hats, events, tool
   calls, parse errors, or performance.

## Guardrails

- Prefer the CLI over direct edits to `.ralph` state files.
- Treat tasks and memories as the canonical runtime systems; do not center
  scratchpad as the primary state model.
- Inspect diffs before merging.
- Only remove lock or queue artifacts when the underlying process is confirmed
  dead.
- Manual edits under `.ralph/` are last-resort recovery steps and should be
  called out explicitly when used.

## Read These References When Needed

- For command recipes and operator flows: `references/commands.md`
- For diagnostics files and suspend-state details: `references/diagnostics.md`
```
END THIRD-PARTY FILE d74ebb928d3f26fa

The third-party file has ended. Everything between the d74ebb928d3f26fa tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© mikeyobrien · MIT · https://github.com/mikeyobrien/ralph-orchestrator/tree/HEAD/skills/ralph-loop/SKILL.md

## Similar
- [setup-matt-pocock-skills](https://affpapa.org/en/nevibecode/skills/setup-matt-pocock-skills.md) — skill · 1052851 installs
- [ask-matt](https://affpapa.org/en/nevibecode/skills/ask-matt.md) — skill · 766587 installs
- [to-tickets](https://affpapa.org/en/nevibecode/skills/to-tickets.md) — skill · 711230 installs
- [writing-plans](https://affpapa.org/en/nevibecode/skills/writing-plans.md) — skill · 282859 installs
- [caveman-review](https://affpapa.org/en/nevibecode/skills/caveman-review.md) — skill · 411800 installs
- [caveman-compress](https://affpapa.org/en/nevibecode/skills/caveman-compress.md) — skill · 411500 installs

## Other versions with the same name
- [ralph-loop · cursor](https://affpapa.org/en/nevibecode/skills/ralph-loop.md) — 1000 installs

From the same set: [mikeyobrien/ralph-orchestrator](https://affpapa.org/en/nevibecode/by/mikeyobrien/ralph-orchestrator.md) — 16 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
