A lightweight Copilot implementation of the autonomous agent loop Ralph Wiggum as a "software engineer pattern by Geoffrey Huntley, using custom agents with automatic handoffs.
Based off only four agent.md markdown files, this pattern enables an autonomous coding loop with fresh context every iteration, using the filesystem as memory and git for version control.
Ralph loop = Fresh context + Filesystem memory & Git versioning
An autonomous coding pattern where:
- User provides requirements to a
RalphPlanneragent, which creates aPRD.mdwith a list of specific tasks and file to track progressPROGRESS.md - User reviews
PRD.mdand starts the loop withRalphCoordinatoragent who dispatches tasks toRalphExecutoragents. RalphExecutoragent picks a task fromPRD.md- Executes it with fresh context, code is tested and quality checks ensured
gitcommits and updatesPROGRESS.md- Code is reviewed by
RalphReviewer - Loops until all tasks complete
sequenceDiagram
participant H as 👤 User
participant P as 🤖 Planner
participant C as 🤖 Coordinator
participant E as 🤖 Executor
participant R as 🤖 Reviewer
participant FS as 📝 Filesystem
H->>P: Requirements
P->>FS: Write PRD.md + PROGRESS.md
P-->>H: Handoff button: Start Ralph Loop
H->>C: Start loop
loop Until all tasks complete
C->>FS: Read PRD.md + PROGRESS.md
C->>+E: Spawn subagent (task + criteria)
E->>FS: Read PRD.md + PROGRESS.md
E->>E: Implement task
E->>+R: Spawn subagent (verify task)
R->>FS: Read code + acceptance criteria
R-->>-E: Verdict (pass / fail + notes)
E->>FS: Update PROGRESS.md
E->>FS: git commit
E-->>-C: Completion summary
end
C-->>H: COMPLETE
- 🤝 Automatic handoffs - Agents pass control automatically with fresh context
- 📝 Progress file and filesystem memory - Fresh context every iteration via
PROGRESS.mdandgit - 🌐 Language agnostic - Works with any programming language/stack
- ⚛️ Atomic tasks - One task per iteration, committed immediately
- 🔄 Context reset - Avoids context pollution, uses filesystem as memory
- 🔍 Built-in review - Reviewer subagent verifies every task before moving on
- ✅ Code that lasts - Maintainable code with tests and quality checks at every iteration
- 🖥️ VS Code Copilot - save agents in the workpace
.github/agentsor customize your settings.json - 🤖 Copilot CLI - save agents in workspace
.github/agentsor in global~/.copilot/agents
- Clone repository and copy agent files to your project:
git clone git@github.com:giocaizzi/ralph-copilot.git
cp ralph-copilot/agents/*.agent.md <your_project>/.github/agents/-
Restart VSCode/Copilot CLI
-
Verify agents are available:
- Open Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) - Type "Select Agent"
- Should see:
RalphPlanner,RalphCoordinator
- Open Command Palette (
💡 Tip — use Ralph globally across all your projects
VSCode: Instead of copying agent files per project, point VS Code to your local clone of this repo once via
and the agents will be available everywhere.
Copilot CLI Save your agents in the global folder
~/.copilot/agents
-
Create PRD with
RalphPlanneragent:Open VSCode Chat Select: Planner agent Prompt: "Create a PRD for [your feature]" -
Review PRD.md - Edit as needed
-
Start Loop with
RalphCoordinatoragent:Select: Coordinator agent Click: "Start Ralph Loop" handoff button -
Let it run - Agents will:
- Pick tasks from PRD.md
- Execute them
- Update PROGRESS.md
- Commit changes
- Review, test and run quality checks
- Repeat until done
-
Monitor progress in PROGRESS.md and git history
Based on:
