Ralph Loop for Openclaw

An advanced orchestration framework for agents to execute multi-step planning and building loops with full TTY support for interactive coding tools.

addozhang
v1.1.0
Feb 6, 2026
0
4.2k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install ralph-loop-agent

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install ralph-loop-agent using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Ralph Loop?

Ralph Loop is a specialized technical workflow designed to empower agents within the ecosystem of Openclaw Skills. It implements a structured Ralph playbook flow that separates software development into distinct Planning and Building phases. This ensures that agents do not jump into implementation without a verified architectural strategy.

By utilizing the exec and process tools with PTY support, this skill allows agents to manage interactive CLIs like Claude Code, OpenCode, and Codex without terminal hanging issues. It provides a robust framework for context persistence across iterations using local markdown files, making it a cornerstone for reliable autonomous development when using Openclaw Skills.

Ralph Loop Use Cases

  • Orchestrating interactive AI coding agents that require TTY/terminal support to function.
  • Implementing a rigorous planning-before-coding architecture to reduce hallucinations in complex projects.
  • Automating multi-step software feature development using Openclaw Skills for task management.
  • Monitoring long-running background coding tasks with automated completion detection and log polling.

How Ralph Loop Works

  1. The agent gathers requirements, defines the Job To Be Done (JTBD), and initializes the workdir.
  2. Focus topics are extracted into individual specification files within a specs/ directory to maintain modularity.
  3. A Planning Loop is initiated where the agent updates IMPLEMENTATION_PLAN.md to map out tasks without modifying source code.
  4. A Building Loop follows, where the agent implements specific tasks, runs backpressure test commands, and commits changes to version control.
  5. The agent utilizes the exec tool with pty: true to launch coding agents in the background while capturing session IDs.
  6. The process tool is used to poll logs and detect the STATUS: COMPLETE sentinel in the implementation plan to conclude the loop.

Ralph Loop Setup

To utilize Ralph Loop within your environment, ensure your agent has access to the exec and process tools. Configure your coding agents (like OpenCode or Claude Code) and prepare the project directory.

# The agent typically initiates the loop using a command pattern like:
opencode run --model <MODEL_NAME> "$(cat PROMPT.md)"

Ensure PROMPT.md and AGENTS.md are present in the root directory to provide the necessary context for the Openclaw Skills execution loop.

Ralph Loop Data Schema & Taxonomy

The Ralph Loop skill relies on a specific file-based metadata taxonomy to maintain state across agent iterations:

File Role Description
PROMPT.md Context Primary instructions and references for the current iteration.
AGENTS.md Knowledge Contains test commands, build instructions, and operational learnings.
specs/*.md Requirements Technical specifications for individual focus topics or features.
IMPLEMENTATION_PLAN.md State The source of truth for task progress and the completion sentinel.

Ralph Loop Advanced Features

  • Native TTY/PTY support to prevent interactive CLI sessions from hanging during execution.
  • Integrated backpressure mechanisms that force agents to run tests and update learnings in AGENTS.md.
  • Support for multiple sandboxing environments including Docker and E2B for secure code execution.
  • Flexible completion detection using regex to match various status sentinel formats in the implementation plan.
  • Session persistence allowing agents to poll, log, and kill background processes across different turns.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*