Loop Engineering for AI Coding Agents

Post by Sumanth P — “Stop prompting AI agents. Design the loops that prompt them instead!

Core Idea

“I don’t prompt Claude anymore. I have loops running that prompt Claude and figure out what to do. My job is to write loops.” — Boris Cherny, Head of Claude Code @ Anthropic

A loop is an automated pipeline that runs on a schedule. It:

  1. Checks what needs to be done
  2. Prompts your AI coding agent with the right context
  3. Verifies the result
  4. Commits the fix or escalates to you

Then it runs again.

7 Production Loop Patterns

PatternPurpose
Daily TriageReview open issues/PRs daily
PR BabysitterWatch PRs through CI — retry, fix, approve
CI SweeperFix broken CI builds automatically
Dependency SweeperKeep dependencies updated
Changelog DrafterAuto-generate changelogs
Post-Merge CleanupClean up after merges
Issue TriageClassify and route incoming issues

Each ships with a starter kit, cadence recommendation, and token cost estimate.

CLI Tools

  • loop-init — scaffolds skills, state, and budget files; prints a “Loop Ready” score
  • loop-audit — checks readiness and suggests improvements
  • loop-cost — estimates token spend before running

Compatible Platforms

Claude Code, Codex, Grok, OpenCode, Cursor, GitHub Actions

Key Takeaways

  • 100% open source
  • Includes failure modes, anti-patterns, safety docs, and multi-loop coordination
  • Your job shifts from prompting to writing loops that prompt