loop-virtuoso
A deterministic, backlog-driven autonomous execution loop for Claude Code. Feeds an agent one small backlog step at a time. Gates completion on an exit code and a write-boundary guard, not the agent's claim. Compile a spec into a backlog, point the loop at it; a step flips to verified only when a script - not a model - confirms it, and an item is done only when all its steps are.
Installation
/plugin marketplace add krzysztofsurdy/loop-virtuoso
/plugin install loop-virtuoso@loop-virtuoso
This repository is loop-virtuoso's canonical home. It is also distributed through the code-virtuoso marketplace, whose entry points back here, so /plugin install loop-virtuoso@code-virtuoso installs the same plugin.
Quickstart
- Compile a backlog. Run
/loop-virtuoso:backlog-compiler (or just describe the work and let Claude reach for the skill) on a PRD, ticket, or freeform feature description. It produces .code-virtuoso/loop/backlog.json - each item is one or more steps, each step sized to a single context window, ordered by dependency, with a literal verifyCommand per step.
- Run the loop. Either:
/loop-virtuoso:start - session-supervised (Mode A), inside your current Claude Code session.
scripts/run-batch.sh .code-virtuoso/loop/backlog.json - unattended batch (Mode B), a fresh process per iteration.
- Check progress with
/loop-virtuoso:status, and stop early with /loop-virtuoso:cancel (backlog state is preserved either way).
Why an exit code, not a claim
An agent that can write the files grading its own work will sometimes game the check - edit a test, a fixture, or the verify command instead of fixing the code. So the agent never makes the call. A script runs the step's literal verifyCommand, checks the exit code, and writes the status. The agent is never asked whether it succeeded. (The iteration-loop skill covers the mechanics in full.)
Commands
| Command | What it does |
|---|
/loop-virtuoso:backlog-compiler [source] | Compile a PRD, ticket, or feature description into .code-virtuoso/loop/backlog.json. Implemented as a skill, not a commands/*.md file, but invokable the same way. |
/loop-virtuoso:start [backlog] | Start the session-supervised loop (Mode A) over the backlog (default <git root>/.code-virtuoso/loop/backlog.json). Refuses to start on a dirty tree or on the default branch; see "Start-of-run checks". |
/loop-virtuoso:status [backlog] | Report verified/pending/blocked counts (item and step level), iteration vs. max, stall/violation counts, and the progress-log/events tail. Cost is Mode B-only, tracked in its own run output, not shown here. |
/loop-virtuoso:cancel | Remove the session-local file to stop the loop and record a run_stopped event with reason cancelled; the backlog is left untouched. |
/loop-virtuoso:harden [--scope user|project] [--with statusline,telemetry,sandbox] | Show a dry-run diff of a guardrail baseline for your Claude Code settings and the loop.guard defaults; applies it only after you approve. See "Harden and the statusline". |
/loop-virtuoso:doctor | Read-only audit of your Claude Code setup: duplicate skills and agents, skill listing size, dead CLAUDE.md skill references, plaintext MCP secrets (key names only), settings gaps, orphan plugin caches. |
/loop-virtuoso:eval-setup [suite] [-k N] [--arms setup,vanilla] [--max-cost-usd N] | Measure your setup against vanilla Claude Code on a fixed task suite: pass@k, pass^k, delta, cost. Dry run first; real runs cost money. |
/loop-virtuoso:scaffold <devcontainer|issue-to-pr|pilot-backlog> [--force] | Copy a starter template to the git root. Refuses to overwrite; --force backs up first. |
/loop-virtuoso:init-setup [--capture on|off] [--retry N] | Scaffold the self-improvement workspace in the plugin's persistent space (survives updates) and set the capture opt-in. Idempotent; never deletes learnings. |
/loop-virtuoso:improve | Review captured signals and the learnings store, optionally research current best practice, refresh the store, and report what is worth committing as a ready-to-apply diff. Human-gated: commits nothing itself. |
/loop-virtuoso:help | Show a short overview of the plugin and its commands. |
Two modes
| Mode A - session-supervised | Mode B - unattended batch |
|---|
/loop-virtuoso:start | scripts/run-batch.sh path/to/backlog.json |
Runs in your current session via a Stop hook | Fresh claude -p process per iteration |
| Watching it work, brief unattended stretches, backlogs of ~5-15 items | Large backlogs, overnight or CI runs; adds a cumulative cost cap |
Pick Mode A to supervise a modest backlog. Pick Mode B for large or unattended runs. Mode B is not a slash command - it spawns long-running detached processes that don't fit a single tool-call turn.
Pipelines and participants