gedankenexperiment / philipp warmer

Gedankenexperiment / Experiments

loopsie

Draw an agent loop on a hand-drawn canvas. Get a Claude Skill out the other end.

Open the editor → runs in the browser · nothing to install

Prototype · July 2026

There is no good way to design an agent loop. You either write the prose by hand and hope the structure holds, or you reach for an orchestration UI that couples you to a runtime you never asked for.

Meanwhile the things that actually make a loop work — bounded iteration, critics that don't overlap, rubrics anchored to something concrete, a score that gates a decision rather than decorating one — are folklore. They get rediscovered per project, badly. loopsie is a drawing surface for those patterns, and a compiler that turns what you drew into a skill an agent can follow.

What it looks like

A loop that drafts, attacks its own draft from three angles, and revises until a majority approve — at most three times.

Repeat until a majority approve · at most 3× Input Draft Output Accuracy Structure Clarity Vote Revise
The three critics run at the same time; the vote decides; the revise step acts on what they raised. Nothing in the box runs unless the box does.

Two ideas worth knowing

Loops are containers, not back-edges

Most graph editors express iteration as an arrow pointing backwards. That makes "repeat until" something you have to infer by hunting for cycles, and it leaves the iteration cap with nowhere to live — so it usually doesn't exist, and the loop can run forever.

Here a repeat step owns the steps inside it. "Repeat steps 1.1–1.5 until a majority approve, at most 3 times" is then a direct render rather than an inference, and the cap has an honest home. Drawing a bare cycle by hand is a validation error with a fix attached.

The model edits the graph, never the output

When you ask the AI to improve a loop, it cannot hand back a document. It returns change operations against real node ids, checked against a JSON Schema generated for that one request with your node ids as literal enums. A hallucinated id fails at the API boundary instead of quietly becoming a no-op.

The server applies each change, re-runs the validator, and withholds anything that would introduce a new error. Then the graph compiles to the output — not the model. Same graph in, byte-identical skill out.

What comes out

A folder laid out the way a skill should be, so an agent opens the bulk only for the step it is on rather than reading four hundred lines up front.

your-loop/
  SKILL.md               the procedure, short enough to hold in your head
  references/prompts.md  every step's full instruction, keyed by step number
  references/rubrics.md  scoring criteria and their anchors
  scripts/run_loop.py    when the loop is precise enough to run unattended
  graph.json             your drawing — reopen it to keep editing

The script is emitted only when the loop is actually deterministic enough to honour: no human gates, no prose stopping conditions, every exit machine-checkable. When it can't be, the export says which step is the reason.

The repeat step is a search

A cap and a stopping condition describe when a loop ends. They say nothing about the passes in between, which is where an unattended loop earns or loses its keep. Following the shape of Karpathy's autoresearch, a repeat step can keep the best pass rather than the last one and roll back when a change made things worse; stop early when the score stops moving; enforce requirements that a flattering score can never buy its way past; and look up only the one gap the last check flagged.

It always writes a line per pass — what changed, what it scored, what is still wrong. That log is what makes an unattended run reviewable, and what lets a fresh session pick up instead of repeating dead ends.

Try it

Open the editor →

Drawing, the checks, tidy layout and the whole skill export run in your browser with no account and no key. The two AI passes — Ask AI and Enhance — run on my key here, so they are rate-limited; if you hit that, everything else keeps working, and running it yourself lifts the limit entirely.

A prototype, and honestly a way of thinking the problem through. The artifact it produces is markdown you can read and edit.

Source on GitHub

Gedankenexperiment · Zurich