ralph-claude-code

frankbria/ralph-claude-code

Autonomous AI development loop with intelligent exit detection

9.5k
Stars
726
Forks
25
Open issues
46
Watchers
Shell MITLast pushed Jul 4, 2026

Overview

Ralph is an autonomous AI development tool that helps Claude Code iteratively improve projects, complete them autonomously with safeguards to avoid infinite loops and excessive API usage.

Categories

Tags

Similar tools

Install

git clone https://github.com/frankbria/ralph-claude-code

README

Ralph for Claude Code

Autonomous AI development loop with intelligent exit detection and rate limiting

Ralph is an implementation of the Geoffrey Huntley's technique for Claude Code that enables continuous autonomous development cycles he named after Ralph Wiggum. It enables continuous autonomous development cycles where Claude Code iteratively improves your project until completion, with built-in safeguards to prevent infinite loops and API overuse.

Install once, use everywhere - Ralph becomes a global command available in any directory.

Project Status

Version: v0.11.5 - Active Development Core Features: Working and tested Test Coverage: 784 tests, 100% pass rate

What's Working Now

  • Autonomous development loops with intelligent exit detection
  • Dual-condition exit gate: Requires BOTH completion indicators AND explicit EXIT_SIGNAL
  • Rate limiting with hourly reset (100 calls/hour, configurable)
  • Circuit breaker with advanced error detection (prevents runaway loops)
  • Response analyzer with semantic understanding and two-stage error filtering
  • JSON output format support with automatic fallback to text parsing
  • Session continuity with --resume flag for context preservation (no session hijacking)
  • Session expiration with configurable timeout (default: 24 hours)
  • Modern CLI flags: --output-format, --allowed-tools, --no-continue
  • Interactive project enablement with ralph-enable wizard
  • .ralphrc configuration file for project settings
  • Live streaming output with --live flag for real-time Claude Code visibility
  • Log rotation: ralph.log rotates at 10MB, keeping 4 archived files
  • Dry-run mode (--dry-run) to simulate loops without API calls
  • Metrics tracking with ralph-stats analytics command (JSON Lines per-loop metrics)
  • Desktop notifications (--notify) for key loop events (macOS/Linux/terminal-bell)
  • Automatic git backup branches (--backup) with --rollback restore
  • Multi-line error matching for accurate stuck loop detection
  • 5-hour API limit handling with user prompts
  • tmux integration for live monitoring
  • PRD import functionality
  • GitHub issue import: ralph-import --github-issue plus metadata filters (labels, title, assignee, milestone, state) with first/interactive/priority selection and --dry-run preview
  • CI/CD pipeline with GitHub Actions
  • Dedicated uninstall script for clean removal

Recent Improvements

v0.11.5 - Community Bug Fixes (latest)

  • Fixed API limit false positive: Timeout (exit code 124) no longer misidentified as API 5-hour limit (#183)
  • Three-layer API limit detection: timeout guard → structural JSON (rate_limit_event) → filtered text fallback
  • Unattended mode: API limit prompt now auto-waits on timeout instead of exiting
  • Fixed bash 3.x compatibility: ${,,} lowercase substitution replaced with POSIX tr (#187)
  • Added 8 new tests for API limit detection (548 → 566 tests)

v0.11.4 - Bug Fixes & Compatibility

  • Fixed progress detection: Git commits within a loop now count as progress (#141)
  • Fixed checkbox regex: Date entries [2026-01-29] no longer counted as checkboxes (#144)
  • Fixed session hijacking: Use --resume <session_id> instead of --continue (#151)
  • Fixed EXIT_SIGNAL override: STATUS: COMPLETE with EXIT_SIGNAL: false now continues working (#146)
  • Fixed ralph-import hanging indefinitely (added --print flag for non-interactive mode)
  • Fixed ralph-import absolute path handling
  • Fixed cross-platform date commands for macOS with Homebrew coreutils
  • Added configurable circuit breaker thresholds via environment variables (#99)
  • Added tmux support for non-zero base-index configurations
  • Added 13 new regression tests for progress detection and checkbox regex

v0.11.3 - Live Streaming & Beads Fix

  • Added live streaming output mode with --live flag for real-time Claude Code visibility