Loop engineering is the practice of designing autonomous AI agent loops that prompt themselves, iterate until done, and report findings without human babysitting. Here is how to build production loops with Claude Code, Codex, and an LLM gateway that routes every iteration at minimum cost.