{"slug": "an-agent-loop-for-claude-code-where-done-means-proven-claude-does-the-work", "title": "An agent loop for Claude Code where \"done\" means proven Claude does the work", "summary": "Localix.ai released localix-loop, a Claude Code plugin that runs an external, model-free hook after every change to keep it only if a test suite, build or benchmark score improves, rolling back the rest and ending the loop when the score hits its target rather than when Claude declares completion. In the project's quality bench, run on Sonnet 5.5 with one chain per approach, localix-loop was right the first time in 5 of 6 steps with 1 round of corrections and 0 regressions, matching Claude Code's /goal and trailing a single plain prompt that passed 6 of 6, while the ralph-loop plugin reached 3 of 6 with 6 correction rounds and 9 false \"done\" claims. The bench also found that in each of three runs a wrong examiner-written test (a date in the wrong time zone, a page test that raced the page) stopped a loop on a correct app, and building the bench surfaced over a dozen defects in localix-loop itself, each now fixed and logged in the changelog.", "body_md": "**An agent loop for Claude Code where \"done\" means proven**\n\n  Claude does the work. The loop checks every step itself and keeps only what holds up.\n\n[Install](#install) •\n  [Docs](https://loop.localix.ai/docs) •\n  [Website](https://loop.localix.ai) •\n  [Quality bench](https://github.com/localixai/localix-loop/blob/main/bench/README.md) •\n  [Changelog](https://github.com/localixai/localix-loop/blob/main/CHANGELOG.md)\n\n**\"Done\" is a claim until something checks it.** An agent that says it is done may be right. Often\nyou find out later: you try the result, something is off, you explain it, you wait for the fix,\nyou check the fix broke nothing else. That round trip is the expensive part. localix-loop spends\nits effort before the \"done\" instead: every step is checked against tests Claude can't change.\n\n**① The loop runs the checks, not Claude.** After every change, a hook with no model in it runs\nyour scorekeeper (a test suite, a build, a benchmark), keeps the change only if the score went up\nand rolls back the rest. The loop ends when the score reaches the target, not when Claude says so.\n\n**② The tests aren't the agent's to write or bend.** In a project with no tests, a separate\n`examiner` subagent writes them from your goal or spec before any code exists. Claude can't edit\nthem, and hidden checks it never sees catch code fitted to the visible ones.\n\n**③ What worked keeps working.** Your next goal in the same project, a feature or a bug you found,\nextends the tests instead of replacing them, so a new change can't quietly break an old one.\n\n```\nclaude plugin marketplace add localixai/localix-loop\nclaude plugin install localix-loop@localix-loop\n```\n\nRestart Claude Code, then in a git repository (an empty folder needs only `git init`):\n\n```\n/localix-loop:start make the login test suite pass\n```\n\nClaude finds a scorekeeper or has the examiner write one, shows you the baseline, and starts once\nyou agree. When it ends, `git diff` shows the whole change and `REPORT.md` what was checked; you\ncommit it yourself. It needs Node.js 20 or newer.\n\nThe [quality bench](https://github.com/localixai/localix-loop/blob/main/bench/README.md) doesn't time runs or count tokens. It builds one project from\nan empty folder and changes it five times, the way a person works with an agent. After every round\nits own acceptance test, which no approach sees, checks every feature so far, and what fails is\ntold back to the agent as a person would. Sonnet 5.5, one chain each:\n\n| Approach | Right the first time | Rounds of corrections | Regressions | \"Done\" that wasn't | \n|---|---|---|---|---|\n| one plain prompt | 6 of 6 | 0 | 0 | 0 | \n| Claude Code's `/goal` | 5 of 6 | 1 | 0 | 0 | \n| localix-loop | 5 of 6 | 1 | 0 | 0 | \n| the `ralph-loop` plugin | 3 of 6 (3 never accepted) | 6 | 0 | 9 | \n\nOn this project the model was right on its own: one plain prompt passed every step the first time.\nlocalix-loop matched `/goal` and never said done while the acceptance failed. Its weak point is its\nexaminer's tests: in each of three runs, a wrong test (a date in the wrong time zone, a page test\nthat raced the page) made a loop stop with a right app instead of saying done. A wrong test stops a\nloop; it never passes bad work. So on a well-specified project of this size the loop adds checking,\nnot correctness, and it takes far longer. Building the bench found over a dozen defects in\nlocalix-loop itself, from hidden checks that never ran to a judge that failed in a project that\nignores `.claude/`; each is fixed and in the [changelog](https://github.com/localixai/localix-loop/blob/main/CHANGELOG.md).\n\nOne chain shows what one model got wrong on one project. To see what the loop does with each kind\nof mistake, `npm run sim` runs the same seeded agent, making the same mistakes in the same order,\nwith the real judge and without it. There is no model in it, and the same seeds give the same\nnumbers. Accepted / \"done\" that wasn't, 40 runs each:\n\n| The agent | Without a loop | With localix-loop | \n|---|---|---|\n| never wrong | 100% / 0% | 100% / 0% | \n| wrong a third of the time, runs its tests | 100% / 0% | 100% / 0% | \n| breaks what worked, runs its tests half the time | 68% / 33% | 100% / 0% | \n| fits the visible test | 10% / 90% | 80% / 0% | \n| edits a test it keeps failing | 53% / 48% | 98% / 0% | \n| says done while it sees failures | 5% / 95% | 100% / 0% | \n| all of these, milder | 10% / 90% | 73% / 0% | \n\nWhere the agent's own tests would catch the mistake, the loop changes nothing. Where they\nwouldn't, runs without it said done with defects left; with it, no run did. Each one either passed\nor stopped saying the goal was not reached, at the cost of up to four more turns. The rates are\nassumptions, one kind of mistake at a time, not measurements of a model:\n[the method and the full table](https://github.com/localixai/localix-loop/blob/main/bench/README.md#the-simulation).\n\n| Command | What it does | \n|---|---|\n| `/localix-loop:start [goal]` | Sets up the goal, the scorekeeper, the protected paths and a budget, then starts | \n| `/localix-loop:status` | The goal, the score, iterations kept and rolled back | \n| `/localix-loop:stop` | Stops; the working tree keeps the best version | \n| `/localix-loop:resume [answer] [--more N]` | Goes on after a pause or a stop | \n| `/localix-loop` | Opens the panel | \n\nIt never commits: kept versions are git snapshots under `refs/localix-loop/`, so signing and\npre-commit hooks never stop an unattended run.\n\n**[loop.localix.ai/docs](https://loop.localix.ai/docs)** has the rest:\n[the definition file](https://loop.localix.ai/docs/definition) and every field,\n[how it works](https://loop.localix.ai/docs/how-it-works) (the judge, the guard, hidden checks, the brief, the\nsubagents, long runs), [the commands](https://loop.localix.ai/docs/commands), [quality](https://loop.localix.ai/docs/quality) and\n[the limits](https://loop.localix.ai/docs/limits). To work on localix-loop itself, see [AGENTS.md](https://github.com/localixai/localix-loop/blob/main/AGENTS.md).\n\nlocalix-loop is free and made by a small lab without investors. If it saves you time, you can [buy us a coffee](https://buymeacoffee.com/localix).\n\nMIT", "url": "https://wpnews.pro/news/an-agent-loop-for-claude-code-where-done-means-proven-claude-does-the-work", "canonical_source": "https://github.com/localixai/localix-loop", "published_at": "2026-12-01 13:10:24+00:00", "updated_at": "2026-12-01 13:20:11.219558+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-safety"], "entities": ["localix-loop", "Claude Code", "Localix.ai", "Anthropic", "Sonnet 5.5", "ralph-loop", "Node.js"], "also_reported_by": [], "takeaway": "localix-loop gates each Claude Code change on an external, model-free hook that keeps it only if the scorekeeper's score rises and rolls it back otherwise, so \"done\" is declared by the score reaching its target rather than by the model.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/an-agent-loop-for-claude-code-where-done-means-proven-claude-does-the-work", "markdown": "https://wpnews.pro/news/an-agent-loop-for-claude-code-where-done-means-proven-claude-does-the-work.md", "text": "https://wpnews.pro/news/an-agent-loop-for-claude-code-where-done-means-proven-claude-does-the-work.txt", "jsonld": "https://wpnews.pro/news/an-agent-loop-for-claude-code-where-done-means-proven-claude-does-the-work.jsonld"}}