An autonomous, event-driven build loop, built March–May 2026. Point it at a
backlog and it selects a task, implements it by spawning Claude Code
(claude --print), runs quality gates, and keeps the change only if the
metrics hold — otherwise it reverts and tries again. It commits its own work
as it goes.
This repo is published as a historical artifact: a working agentic loop with backpressure, from before harness loops were commonplace. The evidence is in the repo itself:
- the git history contains the loop's own commits
(
forge(planner): iteration 76,forge(builder): iteration 75, …) .forge/log.mdis the tracked iteration log — 83 iterations with per-iteration metrics, gate results, and keep/revert decisions.forge/tasks.jsonlis the task store the planner worked from, including the notes it wrote as it closed items
forge run → load config → publish work.start
→ select hat → build prompt → spawn claude
→ parse output → run gates → keep/revert → log
→ publish events → next iteration
Roles ("hats") are event-driven: a planner reads the task store and picks work; a builder implements it; optional reviewer and acceptance hats gate the result. Hats communicate by publishing events, so the topology is config, not code.
Backpressure is the core idea: every iteration runs the project's gates (build, lint, test — with numeric error parsing), compares against the baseline, and makes an explicit keep-or-revert decision. An iteration that regresses the metrics is rolled back, not merged. If the loop can't say whether an iteration improved things, it doesn't keep it.
| Path | Purpose |
|---|---|
forge/core/ |
Event bus, hat registry, orchestration loop, state |
forge/backpressure/ |
Gates, metrics, keep/revert decisions, recovery |
forge/executor/ |
Claude Code subprocess spawn + output parsing |
forge/store/ |
Task store, iteration history, memory, telemetry |
forge/integrations/ |
Git auto-commit, notifications |
presets/ |
standard (2-hat), reviewed (3-hat), overnight (safety-constrained) |
DESIGN.md, VISION.md, docs/V2_DESIGN.md |
Architecture and the self-refining-loop roadmap |
forge run # auto-init, imports BACKLOG.md
forge run --preset reviewed # adds a code-review hat
forge run --preset overnight # safe mode, auto-push
forge status
forge log --summaryArchived and unmaintained. Superseded by later infrastructure; kept public as a record of the approach. No support, no roadmap.