formerly ralph-orchestrator // open source // mit

keep agents looping
until the job is done.

hats runs AI coding agents in autonomous loops. give it a task, it iterates until done or your budget runs out. hat-based personas, backpressure gates, cost tracking, git checkpoints.

$ npm install -g @hats/cli click to copy
also via cargo, homebrew, or pip
0:hats* 1:code "hats" 0:bash
$ hats run -p "add jwt auth with tests" hat: default | backend: claude | max: 15 iterations backpressure: tests, lint, typecheck
[1/15] reading specs... planning implementation [2/15] writing auth middleware + jwt helpers [3/15] writing tests... 14 pass, 2 fail [4/15] fixing token expiry edge case [5/15] all tests pass. lint clean. typecheck clean. LOOP_COMPLETE 5 iterations | $0.43 | 3m 12s
$ _
claude
kiro
codex
gemini
amp
copilot
pi
opencode
// features

what it does

  • hat system agents wear specialized hats -- planning, coding, review, debugging. each hat has its own persona, backend, and constraints.
  • backpressure gates that reject incomplete work. tests must pass. lint must be clean. typecheck must succeed. the loop keeps going until quality is met.
  • cost tracking per-iteration token and cost tracking. set budgets. kill loops that burn too much. know exactly what each task costs.
  • git checkpoints automatic git commits between iterations. roll back to any point. never lose work to a bad iteration.
  • multi-backend claude, kiro, codex, gemini, amp, copilot, pi, opencode. switch backends per hat. use the cheapest model for planning, the best for coding.
  • presets 31 built-in presets: tdd, spec-driven, debugging, refactor, docs, deploy, pr-review. start productive in seconds.
  • telegram human-in-the-loop via telegram. agents ask questions and block until answered. send guidance mid-loop from your phone.
  • web dashboard monitor loops, view iteration history, track costs. hats web opens a local dashboard.
// quickstart

running in two minutes

  1. install npm i -g @hats/cli or brew install hats or cargo install hats-cli
  2. init hats init --backend claude creates a hats.yml config in your project.
  3. run hats run -p "your task here" starts looping. it stops when done or when limits are hit.
# hats.yml hats: default: backend: claude planning: backend: gemini # cheap model for planning review: backend: claude # best model for review event_loop: max_iterations: 15 completion_promise: LOOP_COMPLETE
// the stack

hats is part of a larger system

hats the loop iterate until done
pi the runtime LLM + tools + extensions
rho the home memory, heartbeat, identity

use hats standalone for task loops. pair with rho for persistent agents that remember across sessions.