turbo-flow: A Rules Layer for AI-Written Code
turbo-flow v5 is a fail-closed cross-model review gate, a written constitution, and git-versioned memory for AI-written code. Here's how it works — and where it falls short.
What you will learn
- What turbo-flow v5 is: a rules layer that sits between AI coding agents and your repository
- How the fail-closed cross-model review gate works, and why "fail-closed" matters
- How to install and wire it into any harness (Claude Code, Codex, etc.)
- What the written constitution and git-versioned memory actually do
- Where the project is young and what it does not solve
What is turbo-flow, and why should you care?
You have probably already handed a non-trivial task to a coding agent and watched it produce a diff that looked plausible, passed its own tests, and was still wrong in a way only a second reader would catch. That is the problem marcuspat/turbo-flow is built around. The repo describes v5 as "the rules layer for AI-written code" — specifically, a component called rig-lite that adds three things on top of whatever agent harness you already use: a fail-closed cross-model review gate, a written constitution, and git-versioned memory. The project says it works with any harness and any repo, and that versions 1 through 4 were an agentic development environment — meaning v5 is a deliberate narrowing, not a feature pile-on.
The differentiator is the phrase "fail-closed." Most agent review loops are advisory: a second model reads the diff, leaves comments, and the first model decides whether to act. turbo-flow's gate is described as the opposite — the review has to pass before the change is accepted, and if the review cannot run, the default is rejection rather than approval. That single design choice changes the failure mode from "silently merged bad code" to "blocked until a human or a passing review unblocks it." The project is written in Shell, which tells you something about its intended shape: it is glue, not a framework.

How does the cross-model review gate actually work?
The core idea is model separation. The agent that wrote the code should not be the only reader of it, and ideally not the same model family. turbo-flow's rig-lite is described as a cross-model gate: a different model reviews the diff against the constitution, and the result is a pass or a fail. Because it is fail-closed, a missing reviewer, a timeout, or an unparseable response does not quietly become a pass. That is the right default for anything you would not want auto-merged at 2 a.m.
This is a different bet from the one most agent tooling is making. If you have read about hodor's cross-file agentic code reviewer, you have seen the "review as a service" approach — a dedicated reviewer that reads across files. turbo-flow is closer to "review as a gate" — it does not try to be the smartest reviewer, it tries to be an unskippable checkpoint. The two are complementary: you could run a smart reviewer inside a fail-closed gate, and that is probably the strongest configuration.
The constitution is the part that makes the gate more than a vibe check. It is a written document — rules the code must satisfy — that the reviewer checks against. Without it, a cross-model review is just a second opinion. With it, you have a spec the reviewer can cite, which is what makes a fail verdict actionable instead of argumentative.
How do you install it and wire it into your repo?
The repo is Shell-based and described as harness-agnostic, so the install is a clone plus whatever hook mechanism your harness supports. The exact commands are in the repository's README, and you should treat that as the source of truth rather than anything I write here — this is a young project and the wiring will move. The shape of the setup, though, is consistent:
- Clone the repo next to or inside your project, depending on the layout the README specifies.
- Write or adopt a constitution — a plain document of the rules your code must follow. Start small: naming, error handling, no new dependencies without justification. The constitution is only as useful as it is specific.
- Point your harness at the gate — configure your agent's pre-commit or pre-merge step to call the review script, and make sure the script's non-zero exit actually blocks the merge in your CI.
- Commit the memory directory — the git-versioned memory is meant to live in the repo so it travels with the code.
A minimal example of what the gate is protecting against: your agent adds a retry loop, the tests pass, but the constitution says retries must be bounded and logged. The reviewer catches the unbounded loop, fails the gate, and the agent has to fix it before the change lands. Without the gate, that diff merges and you find out in production.
The gate is only fail-closed if your CI treats a non-zero exit as a block. Wire that first, or you have built a suggestion box.
What is the git-versioned memory for?
Agents forget. Every session starts cold, and the context you carefully built last week is gone. The common fix is a memory file or a memory service — you can see that pattern in claude-mem's approach to agent memory and in jevmem's automatic project memory for Claude Code. turbo-flow's twist is that the memory is git-versioned: it lives in the repository, so it is reviewable, diffable, and revertible like code. That matters more than it sounds. Memory that lives in a hidden service is memory you cannot audit. Memory that lives in git is memory you can blame.
Combined with the constitution, this gives you a coherent story: the rules are written down, the memory of what was decided is written down, and both are in the same history as the code they govern. That is a more disciplined setup than most agent workflows have today.
Who is this for, and where does it fall short?
It is for teams already running coding agents on real repositories who have felt the "plausible but wrong" problem and want a checkpoint that does not depend on the agent's own judgment. It is also for solo developers who want a second model to review their agent's work without building the plumbing themselves. If you are still deciding which harness to run, this is not the tool for that decision — it is the layer above it.
The honest limitations: this is a young repository, the star count is modest, and the Shell implementation means you should expect rough edges and read the scripts before trusting them in CI. "Any harness" is a claim to verify, not a guarantee — hook mechanisms differ, and the fail-closed behavior depends on your CI configuration, not on turbo-flow alone. The constitution is also only as good as what you write; an empty or vague constitution gives you a gate that passes everything. And a cross-model gate adds latency and cost to every change, which is a real trade-off on high-velocity repos.
If you want the broader landscape, the isolation problem is covered in coi's per-agent isolated machines, and the orchestration problem in Ordewell's ordered multi-agent plans. turbo-flow sits in a third slot: not isolation, not orchestration, but the rules layer. That is a useful place to be, and the fail-closed default is the most interesting thing about it.
Discussion
Add a comment