Project Overview
The Problem
AI coding agents hit a wall. After 50+ tool calls, context fills up with failed attempts. They repeat the same mistakes endlessly. There's no way to pass learnings between sessions.
Context windows are finite. Traditional approaches fill them with noise until the agent can no longer function effectively.
The Solution
Ralph implements Geoffrey Huntley's deliberate context rotation strategy. Each iteration starts with a fresh context window. Progress and learnings persist in files, not memory.
Guardrails (signs) accumulate lessons learned, preventing the same mistakes from being repeated across sessions.
Platform Support
macOS
Intel and Apple Silicon with GPU acceleration for local models via Metal.
- โข Homebrew integration
- โข Apple Silicon GPU support
- โข iTerm2 / Terminal.app
Linux
Ubuntu, Debian, Fedora, Arch, and Raspberry Pi OS with apt/dnf/pacman support.
- โข Raspberry Pi 4/5
- โข Docker support
- โข Systemd services
Windows
PowerShell and Batch scripts with winget package manager integration.
- โข PowerShell 5.1+
- โข Windows Terminal
- โข VS Code integration
Key Features
Context Rotation
Each iteration starts fresh. State is read from files, not agent memory. This prevents context window pollution.
- โข Fresh context each loop
- โข File-based state persistence
- โข Git-based progress tracking
Guardrails System
When agents fail, they write "signs" documenting what went wrong. Future iterations read these first, avoiding repeated mistakes.
- โข Accumulated lessons
- โข Failure prevention
- โข Self-improving loops
10+ AI Agents
Switch between cloud APIs and local models seamlessly. Use what works best for your task and budget.
- โข Gemini CLI (1M+ tokens, free)
- โข Claude, OpenAI, Anthropic
- โข Ollama, LM Studio (local)
Cloud/CI Deployment
Run on any server or integrate into CI/CD pipelines. Includes Docker, systemd, and pipeline configs.
- โข AWS, GCP, Azure, DO
- โข GitHub Actions, GitLab CI
- โข Docker Compose ready
How It Works
RALPH LOOP
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ Read โ โ Execute โ โ Commit โ
โ State โ โโโโบ โ Agent โ โโโโบ โ Progress โ
โ Files โ โ Task โ โ to Git โ
โโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ โ โ
โ .ralph/ โ โ
โ โโโ progress.md โ โ
โ โโโ guardrails.md โ If not done โ
โ โโโ errors.log โ โ โ
โ โ โผ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโ ROTATE โโโโโโโโโ
(Fresh Context)
Quick Start
# One-line install (macOS/Linux)
curl -fsSL https://raw.githubusercontent.com/craigm26/Ralph/main/install.sh | bash
# Run with Gemini (free, 1M+ token context)
./ralph.sh
# Or with local Ollama
./ralph.sh ollama
# Define your task in RALPH_TASK.md
# Ralph works until all checkboxes are checked Use Cases
Multi-Hour Refactors
Set it running overnight. Come back to a refactored codebase with every change committed and documented.
Test Coverage
"Write tests until coverage hits 80%" - Ralph iterates until the success criteria are met.
Documentation
"Document every public function" - tedious but well-defined tasks are perfect for autonomous execution.
Technical Stack
Supported Agents
Infrastructure
Project Stats
Cloud and local
macOS, Linux, Windows, Cloud
Open source
Active development
Credits
- Original Technique: Geoffrey Huntley - The Ralph Wiggum concept of deliberate context rotation
- Cursor Implementation: Agrim Singh - Early Cursor-based implementation
- Cross-Platform Port: This implementation extends the technique to support 10+ AI agents across all major platforms
Ready to Try Autonomous AI Development?
Get started with Ralph in minutes. Define your task, run the loop, check back when it's done.