skills$openclaw/ralph-operations
paulpete599

by paulpete

ralph-operations – OpenClaw Skill

ralph-operations is an OpenClaw Skills integration for coding workflows. Use when managing Ralph orchestration loops, analyzing diagnostic data, debugging hat selection, investigating backpressure, or performing post-mortem analysis

599 stars1.9k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

nameralph-operations
descriptionUse when managing Ralph orchestration loops, analyzing diagnostic data, debugging hat selection, investigating backpressure, or performing post-mortem analysis OpenClaw Skills integration.
ownerpaulpete
repositorypaulpete/ralph-operations
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @paulpete/ralph-operations
last updatedFeb 7, 2026

Maintainer

paulpete

paulpete

Maintains ralph-operations in the OpenClaw Skills directory.

View GitHub profile
File Explorer
2 files
.
_meta.json
286 B
SKILL.md
7.1 KB
SKILL.md

name: ralph-operations description: Use when managing Ralph orchestration loops, analyzing diagnostic data, debugging hat selection, investigating backpressure, or performing post-mortem analysis tags: [loops, diagnostics, debugging, analysis]

Ralph Operations

Manage, monitor, and diagnose Ralph orchestration loops.

Loop Management

Quick Reference

TaskCommand
List active loopsralph loops
List all (including merged)ralph loops --all
View loop changesralph loops diff <id>
View loop logsralph loops logs <id>
Follow logs liveralph loops logs <id> -f
Stop running loopralph loops stop <id>
Merge completed loopralph loops merge <id>
Retry failed mergeralph loops retry <id>
Abandon loopralph loops discard <id>
Clean stale processesralph loops prune

Loop ID format: Partial matching works - a3f2 matches loop-20250124-143052-a3f2

Loop Status

StatusColorMeaning
runninggreenLoop is actively executing
queuedblueCompleted, waiting for merge
mergingyellowMerge in progress
needs-reviewredMerge failed, requires intervention
mergeddimSuccessfully merged (with --all)
discardeddimAbandoned (with --all)

Starting & Stopping

Loops start automatically via ralph run:

  • Primary loop: Runs in main workspace, holds .ralph/loop.lock
  • Worktree loop: Created when primary is running, isolated in .worktrees/<loop-id>/
ralph loops                       # Any loops running?
cat .ralph/loop.lock 2>/dev/null  # Primary loop details
ralph loops stop <id>             # Graceful stop
ralph loops stop <id> --force     # Immediate stop
ralph loops discard <id>          # Abandon + clean worktree

Inspecting Loops

ralph loops diff <id>             # What changed
ralph loops logs <id> -f          # Live event log
ralph loops history <id>          # State changes
ralph loops attach <id>           # Shell into worktree

Worktree context files (.worktrees/<loop-id>/):

FileContents
.ralph/events.jsonlEvent stream: hats, iterations, tool calls
.ralph/agent/summary.mdCurrent session summary
.ralph/agent/handoff.mdHandoff context for next iteration
.ralph/agent/scratchpad.mdWorking notes
.ralph/agent/tasks.jsonlRuntime task state

Primary loop uses the same files at .ralph/agent/ in repo root.

Merge Queue

Flow: Queued → Merging → Merged or → NeedsReview → Merging (retry) or → Discarded

ralph loops merge <id>            # Queue for merge
ralph loops process               # Process pending merges now
ralph loops retry <id>            # Retry failed merge

Reading state:

jq -r '.prompt' .ralph/loop.lock 2>/dev/null
tail -20 .ralph/merge-queue.jsonl | jq .

Diagnostics

Enabling

RALPH_DIAGNOSTICS=1 ralph run -p "your prompt"

Zero overhead when disabled. Output: .ralph/diagnostics/<YYYY-MM-DDTHH-MM-SS>/

Session Discovery

LATEST=$(ls -t .ralph/diagnostics/ | head -1)
SESSION=".ralph/diagnostics/$LATEST"

File Reference

FileContainsKey Fields
agent-output.jsonlAgent text, tool calls, resultstype, iteration, hat
orchestration.jsonlHat selection, events, backpressureevent.type, iteration, hat
performance.jsonlTiming, latency, token countsmetric.type, iteration, hat
errors.jsonlParse errors, validation failureserror_type, message, context
trace.jsonlAll tracing logs with metadatalevel, target, message

Diagnostic Workflow

1. Errors first:

wc -l "$SESSION/errors.jsonl"
jq '.' "$SESSION/errors.jsonl"
jq -s 'group_by(.error_type) | map({type: .[0].error_type, count: length})' "$SESSION/errors.jsonl"

2. Orchestration flow:

jq '{iter: .iteration, hat: .hat, event: .event.type}' "$SESSION/orchestration.jsonl"
jq 'select(.event.type == "hat_selected") | {iter: .iteration, hat: .event.hat, reason: .event.reason}' "$SESSION/orchestration.jsonl"
jq 'select(.event.type == "backpressure_triggered") | {iter: .iteration, reason: .event.reason}' "$SESSION/orchestration.jsonl"

3. Agent activity:

jq 'select(.type == "tool_call") | {iter: .iteration, tool: .name}' "$SESSION/agent-output.jsonl"
jq -s '[.[] | select(.type == "tool_call")] | group_by(.iteration) | map({iter: .[0].iteration, tools: [.[].name]})' "$SESSION/agent-output.jsonl"

4. Performance:

jq 'select(.metric.type == "iteration_duration") | {iter: .iteration, ms: .metric.duration_ms}' "$SESSION/performance.jsonl"
jq -s '[.[] | select(.metric.type == "token_count")] | {total_in: (map(.metric.input) | add), total_out: (map(.metric.output) | add)}' "$SESSION/performance.jsonl"

5. Trace logs:

jq 'select(.level == "ERROR" or .level == "WARN")' "$SESSION/trace.jsonl"

Quick Health Check

SESSION=".ralph/diagnostics/$(ls -t .ralph/diagnostics/ | head -1)"
echo "=== Session: $SESSION ==="
echo -e "\n--- Errors ---"
wc -l < "$SESSION/errors.jsonl" 2>/dev/null || echo "0"
echo -e "\n--- Iterations ---"
jq -s 'map(select(.event.type == "iteration_started")) | length' "$SESSION/orchestration.jsonl"
echo -e "\n--- Hats Used ---"
jq -s '[.[] | select(.event.type == "hat_selected") | .event.hat] | unique' "$SESSION/orchestration.jsonl"
echo -e "\n--- Backpressure Count ---"
jq -s 'map(select(.event.type == "backpressure_triggered")) | length' "$SESSION/orchestration.jsonl"
echo -e "\n--- Termination ---"
jq 'select(.event.type == "loop_terminated")' "$SESSION/orchestration.jsonl"

Troubleshooting

Stale Processes

ralph loops shows loops that aren't running → ralph loops prune

Orphan Worktrees

.worktrees/ has directories not in ralph loopsralph loops prune or git worktree remove .worktrees/<id> --force

Merge Conflicts

Loop stuck in needs-review:

  1. ralph loops diff <id> — see conflicting changes
  2. ralph loops attach <id> — resolve manually, commit, retry
  3. ralph loops discard <id> — abandon if not worth fixing

Lock Stuck

"Loop already running" but nothing is → rm .ralph/loop.lock (safe if process is dead)

Agent Stuck in Loop

jq -s '[.[] | select(.type == "tool_call")] | group_by(.name) | map({tool: .[0].name, count: length}) | sort_by(-.count)' "$SESSION/agent-output.jsonl"

Red flag: Many iterations with few events = agent not making progress.

Merge Stuck in "merging"

Process died mid-merge. Unblock:

echo '{"ts":"'$(date -u +%Y-%m-%dT%H:%M:%S.000000Z)'","loop_id":"<loop-id>","event":{"type":"needs_review","reason":"Merge process died"}}' >> .ralph/merge-queue.jsonl
ralph loops discard <loop-id>

Worktree Corruption

git worktree repair
ralph loops prune

Cleanup

ralph clean --diagnostics              # Delete all sessions
ralph clean --diagnostics --dry-run    # Preview deletions
README.md

No README available.

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

  • OpenClaw CLI installed and configured.
  • Language: Markdown
  • License: MIT
  • Topics:

FAQ

How do I install ralph-operations?

Run openclaw add @paulpete/ralph-operations in your terminal. This installs ralph-operations into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/paulpete/ralph-operations. Review commits and README documentation before installing.