Reading Group July 2026 - Loop Engineering
This session provides an in-depth exploration of Loop Engineering, a paradigm shift from manual AI prompting to designing autonomous systems that orchestrate AI agents. Speakers share practical experiences, from building production-grade platforms with automated code generation and adversarial AI reviews to experimental loop structures and foundational infrastructure layers. Key discussions address challenges like managing token costs, preventing agent chaos, and implementing robust verification mechanisms for industrializing software development.
This session explored the paradigm shift towards Loop Engineering, moving beyond turn-by-turn prompting to designing autonomous systems that orchestrate AI agents. The discussion emphasized industrializing software development by building sophisticated control systems that discover work, delegate tasks, verify results, persist state, and make decisions autonomously.
Evolution of AI Engineering Paradigms
Sparsh Jain outlined the progression of AI interaction and development:
- Prompt Engineering: Initial focus on defining prompts for basic input-output. Problems arose with complex workflows.
- Context Engineering: Providing models with tools and instructions, aiming for automated software development, but still requiring human verification at each turn.
- Harness Engineering: Equipping models with external environments and scaffolding (like Claude Code) to perform cognitive planning and generate full features. Still, human verification after each turn was necessary.
- Loop Engineering: The current frontier, where the feedback loop itself becomes intelligent, capable of verifying and optimizing outcomes, leading to fully automated feature generation and software factories. The shift moves verification from humans to the system’s feedback loop.
Real-World Application: Arthur’s Automated Development Journey
Arthur Coleman shared his extensive experience building a production-grade platform using AI agents since January 1st, resulting in 109,895 lines of code primarily written by Claude. His journey evolved through several stages:
- Initial Approach: Simple vibe coding led to immediate issues with regression, as Claude would break existing code while fixing new requests.
- Harness Evolution: Incremental additions included regression testing, architectural plans, validation tests (e.g., ensuring variables weren’t hardcoded), and formal ticket management. A significant challenge was epics growing unexpectedly due to AI errors.
- QA Platform Development: Arthur built a comprehensive QA harness, integrating various open-source code packages for maintainability and quality control across development steps. Initial deployment of this harness, however, broke his push process, highlighting integration challenges.
- Adversarial AI Review: A key innovation was implementing a “dialectic” review process where Gemini adversarially reviews Claude’s code for architectural and implementation details, followed by Fable for big-picture assessment, leading to significantly better code quality.
- Challenges & Optimization Goals: Despite a 14-step automated process, it remained painful and error-prone, requiring extensive manual intervention. Arthur aims for a self-evolving platform. His primary optimization goal is “code right first time, every time,” alongside other quality metrics like instrumentation, adherence to hexagonal and miso-level architectures, clean code, documentation, and self-checking mechanisms.
- Lessons Learned: Clearly define optimization targets and “quality”; identify and track failure modes; leverage existing components; create detailed plans with clear success metrics and enforcement mechanisms; anticipate multiple loops and the surge of QA tickets during loop development.
Experimental Approaches: Valdimar’s Toy Loops
Valdimar Eggertsson presented his experiments automating human-in-the-loop tasks using open-code (an open-source Claude-like system) on the Deep Software Engineering benchmark (real GitHub issues):
- Coding Agents as Controllers: He views coding agents as controllers steering a system towards a goal, making observations, receiving test feedback, and taking actions.
- Inner Loops: Implemented a preparation/exploration phase where a permission-locked agent reads the repository and writes a machine-readable plan. This was followed by an implementation loop of repairing, verifying, and reviewing using an independent reviewer agent.
- Outer Loops: An “outer loop” was conceptualized to automate the entire process: a webhook listens for GitHub issues, triggering the coding agent loop. An audit agent discovers issues on a schedule and persists learnings for continuous improvement.
- Key Takeaways: Emphasized independent verification/review, machine-readable plans, and machine-readable tests/goals for effective loop engineering.
Building Blocks for Loop Infrastructure: Sparsh’s Insights
Sparsh Jain highlighted the foundational layers necessary for robust loop-based infrastructure:
- Observability Layer: Provides both zoomed-out and zoomed-in views of system operations, enabling agents to understand current states.
- Evaluation (Eval) Layer: Crucial for measuring system improvement over time, communicating metrics in an LLM-friendly way.
- Looping Infrastructure: Built on top of observability and eval layers, initially focusing on LLM-based inner loops and progressing to deterministic outer loops.
- Pitfall: More agents do not automatically lead to better output; the quality of the
evallayer is paramount. Strong “rebuttal variants” (agents verifying assumptions upfront) can significantly reduce downstream errors, even if it incurs higher initial token costs.
Open Discussion: Token Costs and Agent Stability
The session concluded with an open discussion on critical challenges:
- Token Cost Debate: A major concern given the potential for agents to run uncontrolled. Suggestions included using cheaper open-source models (e.g., DeepSeek Flush), carefully configuring loop breaking conditions, and monitoring token usage per workflow (SLAs/SLIs). It was noted that while costs can be high, the value derived often justifies it, especially when considering automated verification steps like preliminary assumption rebuttals that prevent costlier downstream failures.
- Preventing Agent Chaos: Strategies included limiting the number of agents per layer (e.g., max two for frontend, backend, database) to prevent generative technology from spiraling into confusion. Emphasizing clear scaffolding and domain-specific prompt engineering (e.g., for a real estate agent) helps constrain agent behavior. Human intervention remains crucial for highly complex tasks where LLMs might hallucinate or produce convincing but incorrect reports.
- Claude’s
goalCommand: Thegoalcommand in Claude Code potentially offers a built-in feature for defining and verifying specific objectives, often involving smaller sub-agents for verification. While useful for daily tasks, it might not fully encompass persistent state and continuous learning required for advanced loop engineering.