Loading...
Loading...
Use when managing Ralph orchestration loops, analyzing diagnostic data, debugging hat selection, investigating backpressure, or performing post-mortem analysis
npx skill4agent add mikeyobrien/ralph-orchestrator ralph-operations| Task | Command |
|---|---|
| List active loops | |
| List all (including merged) | |
| View loop changes | |
| View loop logs | |
| Follow logs live | |
| Stop running loop | |
| Merge completed loop | |
| Retry failed merge | |
| Abandon loop | |
| Clean stale processes | |
a3f2loop-20250124-143052-a3f2| Status | Color | Meaning |
|---|---|---|
| running | green | Loop is actively executing |
| queued | blue | Completed, waiting for merge |
| merging | yellow | Merge in progress |
| needs-review | red | Merge failed, requires intervention |
| merged | dim | Successfully merged (with |
| discarded | dim | Abandoned (with |
ralph run.ralph/loop.lock.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 worktreeralph 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.worktrees/<loop-id>/| File | Contents |
|---|---|
| Event stream: hats, iterations, tool calls |
| Current session summary |
| Handoff context for next iteration |
| Working notes |
| Runtime task state |
.ralph/agent/Queued → Merging → Merged→ NeedsReview → Merging (retry)→ Discardedralph loops merge <id> # Queue for merge
ralph loops process # Process pending merges now
ralph loops retry <id> # Retry failed mergejq -r '.prompt' .ralph/loop.lock 2>/dev/null
tail -20 .ralph/merge-queue.jsonl | jq .RALPH_DIAGNOSTICS=1 ralph run -p "your prompt".ralph/diagnostics/<YYYY-MM-DDTHH-MM-SS>/LATEST=$(ls -t .ralph/diagnostics/ | head -1)
SESSION=".ralph/diagnostics/$LATEST"| File | Contains | Key Fields |
|---|---|---|
| Agent text, tool calls, results | |
| Hat selection, events, backpressure | |
| Timing, latency, token counts | |
| Parse errors, validation failures | |
| All tracing logs with metadata | |
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"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"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"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"jq 'select(.level == "ERROR" or .level == "WARN")' "$SESSION/trace.jsonl"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"ralph loopsralph loops prune.worktrees/ralph loopsralph loops prunegit worktree remove .worktrees/<id> --forceneeds-reviewralph loops diff <id>ralph loops attach <id>ralph loops discard <id>rm .ralph/loop.lockjq -s '[.[] | select(.type == "tool_call")] | group_by(.name) | map({tool: .[0].name, count: length}) | sort_by(-.count)' "$SESSION/agent-output.jsonl"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>git worktree repair
ralph loops pruneralph clean --diagnostics # Delete all sessions
ralph clean --diagnostics --dry-run # Preview deletions