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:
- Checks what needs to be done
- Prompts your AI coding agent with the right context
- Verifies the result
- Commits the fix or escalates to you
Then it runs again.
7 Production Loop Patterns
| Pattern | Purpose |
|---|---|
| Daily Triage | Review open issues/PRs daily |
| PR Babysitter | Watch PRs through CI — retry, fix, approve |
| CI Sweeper | Fix broken CI builds automatically |
| Dependency Sweeper | Keep dependencies updated |
| Changelog Drafter | Auto-generate changelogs |
| Post-Merge Cleanup | Clean up after merges |
| Issue Triage | Classify 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” scoreloop-audit— checks readiness and suggests improvementsloop-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
Related
- AI Engineering newsletter — by Sumanth P, 25k+ readers