Coding-agent harness
Mothfire Loops
A minimal coding-agent harness that gets work to your standard — and keeps making it better.
The repository opens with the first release
Research explorationWe’re studying the problem and designing the first release. There’s nothing to install yet.About stages
Why
Coding agents can now work on their own for hours. The harness around the model — its loop, tools, record, and sandbox — decides much of what that work costs and how far it can be trusted. And in today’s harnesses, “done” is still the agent’s own call.
Agents declare victory early, and grade their own work generously. Given tests they can’t see, frontier models have tried to game them. The goal loops that harnesses have started to ship leave the decision to a model reading the conversation, or to no one. “Better” is the agent’s own call too: an agent improving work against a score runs the scorer itself, and can’t tell progress from noise. Meanwhile the session itself is fragile: the context window stands in for the state of the work, and a crash or a lossy summary can’t be undone or audited.
What we’re building
- A small kernel. A minimal loop with a few tools models already know, for frontier models through their makers’ own APIs, and a headless protocol; the command line is one client among others.
- A durable ledger. Every session is an append-only, branching record that survives a crash, rewinds the files with it, and can be audited and exported. What the model sees is a view of it.
- Verified completion. The definition of done is explicit, and frozen when a run starts. An independent verifier runs the checks itself — including ones the agent never sees — and the agent can’t change them. Every run stops for a recorded reason.
- Improvement past done. Asked to, the agent keeps making the work better against an objective — a measurement or a judge — in batches of attempts from the best so far. The verifier measures each attempt, and keeps the best of a batch only if it’s better by more than noise, with the work still done; a holdout the agent never sees shows whether the gains are real.
- Measured from the start. A built-in bench that measures how often “done” is really done, whether improving pays, and what it costs — and public benchmarks, alongside other harnesses.
What it isn’t
Not a race for feature parity with Claude Code or Codex, an editor, or a hosted service — and not a library for writing agents. Mothfire Loops is a harness you run, built from scratch and kept small, for frontier models only: it relies on what they do well, and carries no workarounds for weaker ones.