$johnhartquist
Toggle theme
← Back to projects

rloop

Agent orchestration framework — structured task execution for AI coding agents, built in Rust

RustSQLiteMCPClaude APIratatui

rloop is an agent orchestration framework that wraps Claude Code for structured, autonomous task execution. The core idea comes from what Geoffrey Huntley calls the "Ralph Wiggum Technique" — when an agent fails a task, you capture what it learned, feed those learnings back into a fresh attempt, and try again. Each retry starts with clean context but accumulated knowledge.

The problem

AI coding agents are powerful but chaotic. Give Claude Code a complex task and it might nail it or go in circles. The failure mode isn't stupidity — it's context degradation. Long sessions accumulate noise. The agent loses track of what it was doing. You end up babysitting.

rloop solves this with structure: break work into atomic tasks with clear specifications, execute them with full context engineering, and when things go wrong, capture the failure and retry with learnings rather than throwing everything away.

How it works

Tasks are defined with specifications, verification commands, and dependency relationships forming a DAG. rloop manages:

  • Session lifecycle — each task attempt gets a fresh Claude Code session with curated context
  • SQLite persistence — task state, attempt history, and learnings survive across sessions
  • MCP tools — the agent communicates completion, failure, or questions back to rloop through Model Context Protocol
  • Parallel execution — independent tasks in the DAG run concurrently
  • Human task queue — when the agent needs human input, the task moves to a review queue rather than blocking

Architecture

Five-crate Rust workspace: core library, CLI, TUI dashboard, MCP server, and shared types. The TUI (built with ratatui) shows task status, active sessions, and attempt history in real time.

Why build this

Two reasons. First, I needed it — running a startup solo as CTO with AI tools taught me that the bottleneck isn't the AI's capability, it's the human's ability to specify work clearly and recover from failures gracefully. Second, it's a portfolio piece that demonstrates real Rust engineering: async runtime, SQLite integration, IPC via MCP, terminal UI, all hand-written with no vibe coding.