The Prompt Is Dead. Long Live the Loop.
Something shifted quietly in how the best developers use AI in 2026. It started showing up in Anthropic's internal numbers — 80% of merged production code authored by Claude, 8x more daily output per engineer — and it spread fast to X threads, developer blogs, and HackerNews debates with over 30,000 posts in two days.
The shift: developers are no longer prompting AI coding assistants. They're building loops.
This isn't a subtle workflow tweak. It's a fundamentally different mental model. Understanding it is now the difference between engineers who use AI as a fancy autocomplete and those who run entire projects overnight without touching the keyboard.
What Is Harness Engineering?
Harness engineering is the practice of building systems that orchestrate AI agents through repeated cycles — observe, plan, act, reflect — instead of firing off one-shot prompts and waiting for a response.
Boris Cherny, an engineer at Anthropic, described the core insight:
"You're not supposed to prompt Claude. You're supposed to build a system that prompts itself."
A harness is the scaffolding around your AI agent: the context files, the stop hooks, the test runners, the validation gates, and the retry logic that keeps an agent moving through a task without a human in the loop at every step.
Think of it this way: a single prompt is a tap on the shoulder. A harness is a manager who knows your entire codebase, your test suite, your deployment pipeline, and checks back only when a real decision is needed.
The Observe-Plan-Act-Reflect Loop
At the core of every harness is a four-step cycle:
- Observe — The agent reads your codebase, test results, error logs, and provided context.
- Plan — It determines the next action: which files to edit, which tests to run, which approach to try.
- Act — It makes the change, runs the tests, commits the result.
- Reflect — It evaluates what happened. Did tests pass? Did the build succeed? What remains?
- Repeat — If the task isn't done, the cycle restarts.
This is how Anthropic's internal teams now ship code. Claude isn't responding to prompts — it's operating inside a harness that feeds it context, evaluates output, and sends it back in when the job isn't finished.
The Ralph Wiggum Technique
One of the most practical loop implementations is what developers call the Ralph Wiggum technique — named after a cultural shorthand for persistent, undaunted retry behavior. Here's the mechanic:
- Write a detailed task specification including a completion signal the agent must output when done (e.g.,
<promise>COMPLETE</promise>). - Attach a stop hook to your coding agent. Every time the agent tries to exit, the hook intercepts and checks for the signal.
- If the signal is absent, the original prompt gets re-injected — and the agent sees its previous attempt through filesystem state and git history.
- The agent reads what it did, identifies what broke, and tries again.
- This continues until it succeeds, hits a timeout, or exhausts a configured iteration limit.
The key insight: the agent has no memory across iterations. Instead, it reads evidence from the filesystem and git log. Every commit becomes context. Every failed test is a signal.
Results from the community are striking. One developer completed a $50,000 contract for $297 in API costs. A YC hackathon team generated over 1,000 commits across six codebases in a single overnight run.
A minimal implementation:
# Simplest harness — loops until you kill it
while :; do cat PROMPT.md | claude --no-confirmation; doneFor a more controlled version with Claude Code's native loop support:
# /ralph-loop style — max iterations with completion check
/loop "Build a REST API for todos. Requirements: CRUD operations, input validation, tests. Output <promise>COMPLETE</promise> when done." --max-iterations 20Three Tiers of Harness Complexity
Practitioners have converged on three implementation levels based on task complexity:
Tier 1: Quick Loops (under 1 hour to set up)
Ideal for linting fixes, failing tests, dependency updates, and documentation generation. A simple shell loop around your agent handles most mechanical work.
The evaluation is binary: did the target file change? Did the test pass? If yes, exit. If no, retry.
Tier 2: Validated Loops (1 day to set up)
Ideal for multi-file refactors, API migrations, and feature additions with acceptance tests.
Add validation gates between iterations: the harness runs your test suite, parses output, and only advances to the next step when current tests pass. Failed steps trigger a retry with the error output as additional context injected into the prompt.
Tier 3: Autonomous Projects (1 week to set up)
Ideal for greenfield projects, large migrations, and 24/7 background work.
Full harnesses include checkpoint commits at each stage, human approval gates for architecture decisions, cost monitoring with automatic stop at budget thresholds, and error classification — retry, escalate, or abort.
The 14% Context Tax
One critical insight from Anthropic's internal work: poorly structured project context files cost teams roughly 14% of their agent's effective capacity.
A good harness starts with a well-crafted CLAUDE.md that captures:
- Architecture decisions and their rationale
- Code style and testing conventions
- Known constraints and off-limits files
- Business context the agent needs for good judgment
This isn't documentation for humans. It's calibration data for the agent. Every ambiguous token in your context file is a loop iteration the agent wastes resolving it through trial and error.
Tools Built for This Pattern
Several tools now embrace loop-first design natively:
Claude Code with /loop and custom stop hooks is the current reference implementation for harness engineering. Fine-grained hooks in settings.json control when agents pause, continue, or escalate to a human.
OpenCode (161K+ GitHub stars, MIT-licensed) offers the same loop pattern across 75+ model providers — Claude, GPT-4, Gemini, or local models via Ollama. Its LSP integration gives the agent real compiler diagnostics rather than text-only code analysis, which significantly reduces hallucinated fixes.
OpenAI Codex supports background subagents running in isolated environments, enabling multi-agent loops where specialized sub-processes handle testing, linting, and deployment while a coordinator agent tracks overall progress.
What This Means for MENA Development Teams
For teams in Tunisia, Saudi Arabia, and across the MENA region, harness engineering unlocks a specific advantage: high-output asynchronous development cycles that run overnight without scaling headcount.
Teams building Arabic-language products face a consistent challenge: agents often struggle with RTL text handling, Arabic code comments, and locale-specific validation. A well-constructed harness with explicit MENA context — UTF-8 encoding requirements, Arabic UI validation scripts, locale test cases — turns these edge cases from loop-breakers into solvable sub-tasks that the agent works through systematically.
The developers who build these harnesses today define the productivity ceiling of their teams for the next several years.
Getting Started
If you're new to this pattern, start with Tier 1:
- Write a clear, single-task prompt file with a specific completion signal.
- Run it through Claude Code or OpenCode with a simple retry loop.
- Watch what breaks. Fix your context file, not the prompt.
- Repeat until the loop completes reliably.
The instinct is to write a better prompt. The discipline is to build a better harness.
The loop doesn't need you in it — that's the point.