跪拜 Guibai
← All articles
Frontend · Backend · AI Programming

Loop Engineering: The New AI Programming Paradigm That Replaces Prompt-by-Prompt Coding

By 程序员鱼皮 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation
Why it matters

Loop Engineering represents a fundamental shift in how developers interact with AI coding tools—from manual operators to system designers. For Western developers, this means the competitive advantage is no longer about writing better prompts, but about designing better autonomous systems. The paradigm also introduces new cost and debugging challenges that every team adopting AI coding tools will need to navigate.

Summary

Boris Cherny (creator of Claude Code) and Peter Steinberger (creator of OpenClaw) have independently declared that the era of manually prompting AI is over. The new paradigm, Loop Engineering, shifts the developer's role from writing individual prompts to designing autonomous loop systems that handle prompting, verification, and iteration automatically.

Loop Engineering builds on three prior stages of AI programming evolution: Prompt Engineering (2022-2024), Context Engineering (2025), and Harness Engineering (early 2026). A proper loop requires three core elements: a clear, verifiable goal and stopping condition; a feedback loop that checks results after each iteration; and state memory—an external file that persists progress across sessions.

Practical implementations already exist. Claude Code offers `/goal` (run until completion) and `/loop` (run at intervals) commands. Codex has similar `/goal` functionality and an Automations panel for scheduled tasks. Even Cursor, which lacks native loop commands, can implement Loop Engineering through carefully designed prompts that include state tracking, development-verification loops, and dead loop prevention. A real-world example using Cursor to build a multi-module desktop app from scratch ran autonomously for 50 minutes, completing all three services without developer intervention.

Key takeaways
Loop Engineering replaces manual prompt writing with autonomous loop systems that prompt, verify, and iterate AI agents automatically.
A reliable loop requires three core elements: a verifiable goal/stopping condition, a feedback loop for result checking, and external state memory for progress persistence.
Claude Code provides `/goal` (run until completion) and `/loop` (run at intervals) commands; Codex offers similar functionality plus an Automations panel.
Cursor can implement Loop Engineering through prompt design alone, using state tracking files and development-verification loops.
A real-world Cursor project built a three-module desktop app (Electron, Python server, Web admin) autonomously in 50 minutes using Loop Engineering principles.
Loop Engineering is built on top of Prompt Engineering, Context Engineering, and Harness Engineering—not a replacement for them.
Token costs can escalate quickly: a 1-minute interval loop running for 24 hours generates 1440 AI calls.
Debugging a loop that has run 47 rounds is reportedly 10x harder than debugging a single prompt.
Overbaking occurs when loops run too long without tight constraints, causing AI to add unnecessary features or delete tests.
The recommended learning path starts with prompt techniques, then Context Engineering, then Harness Engineering, before attempting Loop Engineering.
Our take

The simultaneous endorsement from both Anthropic and OpenAI figures signals that Loop Engineering is not a fringe idea but a converging industry direction.

The shift from operator to system designer raises the bar for developer skill—Loop Engineering amplifies both competence and laziness.

The token cost debate reveals a tension between AI tool vendors (who benefit from higher usage) and developers (who bear the cost), with Peter Steinberger's 'isn't your time valuable?' framing sidestepping real budget constraints.

Loop Engineering's reliance on external state memory (PROGRESS.md) mirrors software engineering's long-standing best practices for idempotency and fault tolerance.

The Overbaking phenomenon shows that AI, like human developers, will gold-plate solutions when left unsupervised without tight scope constraints.

The separation of code-writing and code-reviewing agents (sub-agent cross-review) is a direct application of the classic software engineering principle of separation of concerns.

Loop Engineering may accelerate the trend toward AI-first development workflows where human review becomes the bottleneck rather than code generation.

Concepts & terms
Loop Engineering
A programming paradigm where developers design autonomous loop systems that handle prompting, verification, and iteration of AI agents, replacing manual prompt-by-prompt interaction.
Harness Engineering
The practice of building a complete working environment for AI agents, including tools, tests, architectural constraints, and context, to enable stable and reliable code generation.
Context Engineering
The practice of feeding the right information to AI at the right time, using techniques like AGENTS.md files, RAG retrieval, and cross-session memory to ground AI responses in project reality.
State Memory
An external file (e.g., PROGRESS.md) that persists the current progress, completed tasks, and conclusions of an AI loop, allowing the system to resume after interruption without starting over.
Overbaking
A phenomenon where an AI loop runs too long without tight constraints, causing the AI to add unnecessary features, over-engineer solutions, or delete tests to make them pass.
Sub-Agent Cross-Review
A pattern where one AI agent writes code and a separate, independently-contextualized agent reviews it for bugs and logic errors, preventing the same model from grading its own work.
Work Isolation
Using Git WorkTree to give each AI agent an independent working directory and branch, preventing code conflicts when multiple agents work on the same project simultaneously.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗