Sitemap
Level Up Coding

Coding tutorials and news. The developer homepage gitconnected.com && skilled.dev && levelup.dev

Member-only story

Engineering Reliable Coding Agent Loops: Control Flow, Verification, Retries, and Stop Conditions

80 min readAug 3, 2026

--

Coding agents such as Claude Code and Codex already contain an internal execution loop that can inspect files, call tools, modify code, and respond to intermediate results. That native loop is useful for completing a single run, but it does not provide the full control needed for long-running or production-oriented coding workflows. A supervisory runtime must decide when another run should begin, what action the worker is allowed to perform, how repository changes are isolated, which evidence is required, when a failure should be retried or replanned, and what conditions justify stopping.

This article develops a practical architecture for building that outer control loop around coding agents. It introduces typed task contracts, durable plan ledgers, bounded worker handoffs, provider adapters, normalized event streams, independent Git diff collection, verification and completion gates, failure classification, no-progress detection, cross-run budgets, Git worktree isolation, trigger admission, cancellation handling, and terminal artifact retention.

The concepts are developed through one parser failure that persists across the full article. The controller reproduces the error, delegates a bounded patch attempt…

--

--