Skip to content
CVContact

Blog

Why the rules moved out of the prompt

Why supervise's rules migrated from prompts into a CLI.

supervise is a Claude Code plugin I built for one kind of work: plan a change, implement it, verify it with the project's own checks, have it reviewed, then accept it or fix it. It started as a Markdown skill, a page of rules that told Claude how to run that loop.

The rules were written down. They broke anyway.

Five runs, four failures

Across five real runs before 0.1.0 (23 September 2026), the rules in that skill broke in four ways:

  • Work was accepted after a one-line edit, made after the review had passed. The edit broke the parser.
  • A review verdict was never saved.
  • A missing reviewer agent was silently swapped for a generic one.
  • A project with no tests at all was reported as passing.

Each of these broke a rule the skill already stated. Writing the rule again, louder, would not have helped.

What each rule needs

Look at what each rule takes to hold. "Accept only what was reviewed" needs someone to compare the tree that was reviewed with the tree being accepted. "Save the verdict" needs state that survives the run. "Use the reviewer agent" needs a record of which agent ran. "The tests pass" needs to know whether there are tests.

These are all checks on state, and in the skill the state was written by hand by the model, so it could be wrong or lost. A rule in a prompt is something the model reads. Nothing happens when a run does not follow it.

So the rules moved out of the prompt into a small CLI, supervisectl, that Claude has to go through. 0.1.0 came out on 23 September 2026, 1.0.0 the next day, and 1.0.5 on 8 November.

What the CLI checks

The skill still tells Claude how to run the loop. The CLI owns the state and decides. Claude calls it through Bash at every phase change, and it keeps the run in .supervise/runs/<id>/state.json, written only by the CLI.

  • Same tree. verify records the working tree's fingerprint, its git tree id. accept needs a passing verify and a clean review whose fingerprints both equal the current tree, so any edit after the review means verify and review again.
  • Who reviewed. A review counts only if a supervise:code-reviewer subagent started and finished after review begin, as the plugin's hooks record it. Its findings are read from its own reply, not passed on by the orchestrator. A self-review is allowed only for at most 10 changed lines and no binary files.
  • No tests. Without a test gate, status, verify, accept and report say NO TESTS.
  • Baseline. The gates run once before anything changes, so a failure that was already there is reported as a baseline failure, not blamed on the change and not counted as a pass.
  • Fix rounds. Each fix uses a round, three by default. At the cap the run escalates, and only the user can raise the cap or drop the run; a hook denies those two commands to the model.

The first four answer the four failures, one each. A step that breaks a rule is refused with exit code 2, the state unchanged, and the message names the rule and the next step.

A recorded run

On 17 November 2026 a run of supervisectl 1.0.5 was recorded on a throwaway repository with two gates, make lint and make test, and the task "add a greeting to app.txt". The mistakes in it were made on purpose, by editing the file between commands, so that the refusals show.

First the file's status line was replaced, so the test gate failed. The next call tried to add a subtask instead of starting a fix round:

$ supervisectl subtask add "retry" --origin user
supervisectl: refused: the last result is negative, so `supervisectl fix` comes first
  A failed gate or a blocking review is repaired in a fix round; a new request from the user is added in that round.
  next: `supervisectl fix`, then `supervisectl subtask add` if the user asked for more

After fix round 1 of 3 the gates passed, and a real supervise:code-reviewer agent read the diff and found nothing to fix. Then the file was changed again, after the review, and the run asked to be accepted:

$ supervisectl accept
supervisectl: refused: files changed since the review
  The working tree no longer matches what was verified and reviewed. Changed: M app.txt.
  next: `supervisectl verify`, then `supervisectl review begin` and review again

That is the first failure on the list, an edit after the review, now a refusal instead of an acceptance. Once the file was back to the reviewed version, accept passed:

ACCEPTED run 20261117-101217-0924: add a greeting to app.txt
Verify #2: pass (lint pass, test pass)
Review #1: clean, independent; 0 blocking, 0 non-blocking
Fix rounds used: 1/3

What it does not do

The CLI guards against drift, not against a hostile agent: nothing stops a process from editing .supervise/ by hand. Gate output is stored as it is, so a secret that a gate prints is not redacted. It runs on Linux and macOS only.

It also does not replace the skill. A prompt is still the right place to say how the work is done, and the skill still tells Claude how to run the loop: plan, implement, verify, review, then accept or fix. What moved is the part that decides whether the work is done.

The point

A rule that must hold every time does not belong only in the prompt, because then the only thing checking it is the model it is meant to check. In supervise those rules now live in code, and 43 end-to-end tests drive the real CLI in a temporary git repository to keep them there.

The code is public at github.com/mrramdn/supervise. The project page has the rest: mrramdn.com/en/supervise.