claude/ai-resources-plugin/skills/analyze-ralph-logs/SKILL.md
This skill should be used when analyzing Ralph Loop workflow executions to diagnose failures, understand execution flow, or review what happened during the most recent run. Use when the user says "analyze ralph logs", "what happened with ralph", "ralph stopped", "ralph failed", "debug ralph", or wants to understand why a Ralph Loop execution ended unexpectedly.
npx skillsauth add amhuppert/my-ai-resources analyze-ralph-logsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Diagnose Ralph Loop workflow executions by analyzing logs, state files, and error conditions. Provides failure analysis with concrete solutions.
The Ralph Loop is an autonomous development system that executes Claude Code in iterations. When execution stops unexpectedly or behaves incorrectly, this skill provides a systematic approach to diagnose the cause and propose solutions.
| File | Purpose | Format |
| --------------------------------------------------- | -------------------------------------------------- | ---------------- |
| .ralph/logs/ralph.log | Main loop activity log | Timestamped text |
| .ralph/logs/claude_output_YYYY-MM-DD_HH-MM-SS.log | Per-execution Claude output | JSON or text |
| .ralph/status.json | Current loop/API status | JSON |
| .ralph/.response_analysis | Latest response analysis | JSON |
| .ralph/.circuit_breaker_state | Circuit breaker state | JSON |
| .ralph/.exit_signals | Rolling exit signal tracking | JSON |
| .ralph/.ralph_session | Session lifecycle tracking | JSON |
| .ralph/live.log | Real-time streaming output (when --live enabled) | Text/JSON |
Find and read the most recent Claude output log:
ls -lt .ralph/logs/claude_output_*.log | head -1
Read this file to understand what Claude was doing in its last execution.
Read these files in parallel to understand the current state:
.ralph/status.json - Shows current loop count, API call usage, and last action.ralph/.response_analysis - Shows how the last response was analyzed.ralph/.circuit_breaker_state - Shows if stagnation was detected.ralph/.exit_signals - Shows recent completion/test-only/done signals.ralph/.ralph_session - Shows session lifecycle and any resetsRead the last 100 lines of the main loop log:
tail -100 .ralph/logs/ralph.log
Look for:
[ERROR])[WARN])Match observations against the failure modes in the "Failure Modes Reference" section below.
Based on the diagnosed failure mode, propose a concrete solution from the reference.
Diagnosis:
Check consecutive_no_progress and consecutive_same_error counts in circuit breaker state.
Root Causes:
Solutions:
.ralph/fix_plan.md - tasks may be too vague.ralph/PROMPT.md for unclear instructionsralph --reset-circuitDiagnosis:
Check denied_commands array in response analysis to see which tools were blocked.
Root Causes:
.ralphrc ALLOWED_TOOLS missing required tool patternsSolutions:
.ralph/.response_analysisALLOWED_TOOLS in .ralphrc to include needed patterns:
ALLOWED_TOOLS="Write,Read,Edit,Bash(git *),Bash(npm *),Bash(pytest)"
Bash(npm *) allows all npm commandsralph --reset-session
</failure-mode>Diagnosis: Check if execution consistently times out at same point.
Root Causes:
Solutions:
ralph --timeout 30 (minutes, max 120).ralphrc: CLAUDE_TIMEOUT_MINUTES=30.ralph/fix_plan.mdDiagnosis: This is an Anthropic API limit, not a Ralph configuration issue.
Solutions:
--calls flag to limit API calls per hour.ralph/.call_count to see current hour's usage
</failure-mode>Diagnosis: Claude is only running tests without implementing changes.
Root Causes:
Solutions:
.ralph/fix_plan.md for incomplete implementation tasksralph --reset-session
</failure-mode>Diagnosis: Claude signaled completion (EXIT_SIGNAL: true) with multiple completion indicators.
Root Causes:
Solutions:
.ralph/PROMPT.md.ralph/fix_plan.md has unchecked tasks for remaining workralph --reset-session
</failure-mode>Diagnosis: Check session file for reset reasons and last_used timestamps.
Root Causes:
Solutions:
SESSION_EXPIRY_HOURS=48 in .ralphrcDiagnosis: Read the Claude output log for error details.
Root Causes:
Solutions:
claude --versionclaude (should prompt or show ready)Diagnosis: Read the raw Claude output log - check if it's valid JSON.
Root Causes:
Solutions:
CLAUDE_OUTPUT_FORMAT=json in .ralphrc--output-format textDiagnosis: Check git status and compare to loop start SHA.
Root Causes:
Solutions:
git status for untracked files.gitignore is excluding changed files
</failure-mode>When reading .ralph/*.json files, extract these key fields:
{
"loop_count": 42, // Total iterations
"calls_made_this_hour": 15, // API usage
"status": "running", // running|stopped|complete
"exit_reason": "" // Why it stopped
}
{
"state": "CLOSED", // CLOSED|HALF_OPEN|OPEN
"consecutive_no_progress": 0, // Loops without changes
"consecutive_same_error": 0, // Repeated errors
"consecutive_permission_denials": 0, // Permission blocks
"reason": "" // Why state changed
}
{
"loop_number": 42,
"analysis": {
"has_completion_signal": false,
"is_test_only": false,
"has_progress": true,
"exit_signal": false, // Claude says done
"has_permission_denials": false,
"denied_commands": [] // Blocked tools
}
}
{
"test_only_loops": [], // Recent test-only iterations
"done_signals": [], // Recent completion signals
"completion_indicators": [] // Loops with EXIT_SIGNAL=true
}
Key .ralphrc settings that affect execution:
# Rate limiting
MAX_CALLS_PER_HOUR=100 # API calls per hour limit
CLAUDE_TIMEOUT_MINUTES=15 # Per-execution timeout
# Tool permissions
ALLOWED_TOOLS="Write,Read,Edit,Bash(git *),Bash(npm *)"
# Session management
SESSION_CONTINUITY=true # Maintain context across loops
SESSION_EXPIRY_HOURS=24 # Session lifetime
# Circuit breaker thresholds
CB_NO_PROGRESS_THRESHOLD=3 # Opens after N no-progress loops
CB_SAME_ERROR_THRESHOLD=5 # Opens after N repeated errors
CB_OUTPUT_DECLINE_THRESHOLD=70 # Opens if output declines >70%
Useful commands for recovery:
# Show current status
ralph --status
# Show circuit breaker state
ralph --circuit-status
# Reset circuit breaker only
ralph --reset-circuit
# Reset session only
ralph --reset-session
# Reset both and restart
ralph --reset-circuit --reset-session
# Start with increased timeout
ralph --timeout 30
# Start with verbose logging
ralph --verbose
# Start with live output
ralph --live
tools
Use when picking or vetting a keyboard shortcut on macOS. Triggers include "what hotkey should I use for X", "is `<combo>` available", "does this shortcut conflict", "recommend a keybinding for…", "check `<combo>` against my setup", "pick a hotkey for…", or any mention of choosing/binding/changing a shortcut in WezTerm, tmux, Zed, Chrome, Claude Code, or macOS. Determines whether a proposed combo collides with OS-reserved bindings, app defaults, or the user's customizations, and recommends ergonomic alternatives when needed.
development
Detect and remove dead code with knip. Use when the user asks to "run knip", "find unused files", "find unused exports", "find unused dependencies", "clean up dead code", "remove dead code", "set up knip", "configure knip", "knip.json", "knip false positive", "knip CI", or mentions a `knip` config, dependency bloat, bundle bloat from unused imports, or tree-shaking unused exports. Covers the configuration-first workflow, confidence-gated deletion, framework-specific gotchas (Next.js 15+, Tailwind, Storybook, Jest, Bun's test runner and `bun build --compile`), monorepos, CI integration, and performance tuning.
tools
This skill should be used when the user asks to "set up react-scan", "install react-scan", "diagnose React re-renders", "find unnecessary renders", "find unstable props", "automate React render checks with Playwright", "react-scan + playwright", "measure component renders programmatically", "check why a React component is slow", or mentions React rendering issues, slow React interactions, render counts, or component-level perf attribution. Covers install across Next.js/Vite/Remix/script-tag/browser-extension, the lite headless API for CI, and the canonical render-attribution → fix → validate loop driven through Playwright.
documentation
This skill should be used when integrating source material into a knowledge base, including when the user asks to "integrate this document into the knowledge base", "add this transcript to the memory bank", "ingest this document", "update the knowledge base", "analyze a new source document", or "sync current-state docs with this source".