Loop Engineering
Level 1 · Short & meaningful prompts. Say what “done” means in as few words as possible.
jus
Think it through before you prompt.
Learn: the agentic loop
An agent works in a loop: instruct → act → observe → correct, repeating until the goal is met. A good loop converges; a poorly-specified one spins — burning runs without getting closer.
The Ralph Wiggum loop
The simplest loop: re-run the same prompt until it works. Named for the meme of brute persistence. It’s cheap and genuinely effective for small, well-specified tasks — and wasteful (or divergent) on vague ones. Reach for it when “done” is unambiguous; avoid it when the agent has to guess what you meant.
/loop commands
Some harnesses expose an explicit loop (e.g. a /loop command) that repeats an instruction for N iterations or until a condition holds. Whatever the tool, one iteration = one instruct→act→observe→correct pass.
Goals, conditions, guardrails
- Goal: the single outcome the loop is for.
- Entry criteria: when an iteration should start.
- Exit / stop criteria: how the agent knows it’s done — or must bail.
- Guardrails: what it must never do.
Detailing & human review
Give acceptance criteria the agent can self-check against — enough to remove ambiguity, without over-constraining. Decide where a human inspects or approves, and make that checkpoint cheap.
Level 1 drills the first habit: make “done” unambiguous in a short prompt. Levels 2–3 add entry/exit criteria, guardrails, human review, and running the loop itself.
Each run sends your prompt to a real model and uses tokens (metered in your jusCode Usage). The only way to learn AI is to practice it.
Loading challenges…