Iterative LLM prose improvement loop for books. Evaluate, rewrite, compare, keep or revert.
prose-loop treats a manuscript like agent-loopable code. It scores every chapter on a configurable rubric, rewrites the weakest, compares before and after, and only keeps changes that a separate critic pass judges as improvements. Git is the safety net — rejected cycles revert cleanly; accepted ones land as commits you can read, blame, or undo. The whole thing is a single Bash script wrapping the Claude CLI: no virtualenv, no framework, no platform to maintain.
Code has the luxury of agent loops because compilers and test suites give the loop a hard signal — pass or fail. Prose has no such oracle. A book is judged by readers, not by a linter. prose-loop's bet is that an LLM can stand in for one specific kind of reader — the rigorous editor — and that running this synthetic editor across a manuscript, repeatedly and structurally, surfaces the real weaknesses faster than any single human pass would.
The design refuses complexity. State lives in the git repo of the book being edited. The rubric is a JSON file. The orchestrator is a shell script. Every cycle is a commit you can read. Every reverted cycle leaves no residue. The script is short enough that an author can read it end to end in fifteen minutes and decide whether they trust it before pointing it at their manuscript.
A run begins by tagging the current git state. The evaluator pass reads every chapter and scores it on the seven dimensions of the active rubric — relevance, originality, prose quality, balance, accessibility, commercial value, and accuracy of references — emitting a structured JSON with weighted composites and a per-chapter critique in the book's language. The rewriter then takes the lowest-scoring chapters and rewrites them in place, preserving voice and arguments, sharpening prose. A third pass — the comparator — reads the before and after side by side and votes BETTER, SAME, or WORSE for each chapter. ACCEPT keeps the edit and commits. REJECT reverts and stops. The loop repeats until improvement stalls or the cycle cap is reached.
prose-loop is open source under MIT. The default rubric is tuned for commercial nonfiction; the next iterations will likely come from authors writing fiction, poetry, or technical books contributing their own rubrics. The script has no telemetry and no opinions about your manuscript beyond the rubric you give it. If the rubric is right, the loop converges on a better version of your book. If it's wrong, you find out quickly and adjust.