Loop Engineer · Harness

How the harness works

A goal-prompt writer plus a four-agent planner / maker / prover / checker loop. It turns a task into an autonomous run that grades its own work honestly - because the model that wrote the code never scores it.

2
Origin prompts
4
Loop agents
4
Execution modes
4000
char goal gate

The core principle

One model writing and grading its own output grades generously. The harness splits the work across agents with separate context and separate tools, so verification is never done by the author.

problem

Self-grading is a lie

An agent that just wrote 300 lines will call them correct. Its "PASS" carries no information - it saw its own reasoning and is anchored to it.

fix

Fresh eyes, hard gates

A mechanical gate (grep / parse / exit-code - no LLM) runs first. Then a fresh-context Checker that never saw the maker's work scores against a rubric. It opens with "I did not write this."

Two routing decisions - before any work

Every task is routed on two independent axes. Picking wrong wastes turns or under-delivers.

axis 1 · infrastructure

Execution Router

Where it runs. In-session harness (<1hr, needs decisions) · gnhf autonomous (>1hr, unattended) · parallel gnhf + treehouse (many streams). Always registered in tasks-axi first.

axis 2 · task shape

Execution Mode Routing

What shape the work is. First-match-wins over four modes - stop at the first yes.

single-run

Bounded, one pass, correctness obvious on read.

goal-loop

Measurable bar one pass won't reliably hit. Iterate to it.

time-loop

Recurring, or watching state you don't control.

dynamic-workflow

50+ items, or output needs adversarial verification.

Modes nest. A goal-loop can spawn a dynamic-workflow inside one phase - e.g. the red-team runs in the verify phase without leaving the loop.

The four-agent loop

Each agent has its own context and a deliberately narrow toolset. The Planner never makes; the Checker never runs code.

Planner
Read · Glob · Write
Decomposes the goal into phases, picks skill routing, writes BRIEF.md + PLAN.md. No artifacts until the plan exists.
Maker
Read · Write · Edit · Bash · Agent
Executes phase by phase, commits at each boundary, pastes proof to PROGRESS.md.
Prover
Read · Bash
Drives the running app, returns a binary PROOF verdict. Running-app goals only - skipped for static artifacts.
Checker
Read · Glob · Write
Fresh context, scores artifacts against the rubric with file:line evidence. Cannot run Bash, cannot spawn agents.

The verify layer - proof, not vibes

Two complementary checks before the Checker scores. Prover proves it works; red-team proves it doesn't break.

running-app goals

Prover

Actually exercises the feature - CLI command, curl, or browser - and returns works / broken with pasted output. No screenshot, no verdict.

adversarial goals · red-team.js

Red-team workflow

Four attack roles in parallel - hostile user, careless user, performance, security - each hunts only its own angle from entry to failure. A barrier merges them worst-first, deduped across roles. Critical/high holes get fixed before scoring.

The eval loop

Up to 3 cycles. The spec is fixed - only the output changes. Done = gate green and Checker mean ≥ 3.5 / 5.0.

1Produce output 2Mechanical gate 2bRed-team (if adversarial) 3Checker scores 4Pass? ship 5Else fix lowest dim, repeat
Plateau guard: three identical rewards in a row → commit the best, note the plateau, stop. No infinite grinding.

Two hard edges

overnight · inline

gnhf launch, no terminal

For >1hr unattended work, a single detached call launches an overnight run that survives the session closing - model pinned to Opus by config.

# from inside the session
pwsh launch-gnhf.ps1 \
  -Objective "drain backlog" \
  -StopWhen "tests green"
length · enforced

The 4000-char gate

/goal rejects any condition ≥ 4000 chars. A script counts exactly what /goal counts (UTF-16 length after stripping one newline) and exits non-zero at ≥ 3990 - a failed gate is a failed command, not a judgment call.

bun check-goal-length.ts
# OK: 3951 chars [Measured]
# exit 0 · pass

One canonical source

The repo copy is the source of truth. Every changed skill, agent, and workflow syncs repo → global (~/.claude) so a run behaves identically everywhere - reconciled as a superset, never blind-overwritten.