Anthropic's internal loop engineering playbook just got leaked.


And it's the most valuable AI guide I've read all year.
This guide is packed with info, and there are five things you need to know if you want to maximize your AI productivity with loops (save this):
1. You should structure every loop around these 5 principles:
• Discovery → Let the agent find its own work (CI fails, issues, commits)
• Handoff → Give every task its own isolated git worktree
• Verification → Never let the generator grade its own work
• Persistence → Always write state to disk (markdown or board)
• Scheduling → Run it on a timer so it works while you sleep
2. Separate Generator from Evaluator (most important rule)
Use two agents: one writes, the other is a skeptical judge who assumes the code is broken.
Make the evaluator act (run tests, click buttons, take screenshots) - this is what actually stops bad output.
3. Build with these 6 parts:
• Automations (the timer)
• Worktrees (safe parallelism)
• Skills (permanent project knowledge)
• Connectors (talk to GitHub, Linear, etc.)
• Sub-agents (generator + evaluator)
• Memory (state files that survive between runs)
4. Things you must watch out for with loop engineering:
• Verification debt (use verification agents)
• Losing understanding of your own codebase (start fresh if needed)
• Token costs exploding (solution below)
• Cognitive surrender (don't stop thinking because “the loop handles it”)
5. Solving token costs
Loop engineering can be crazy expensive.
I recommend you use an 80/20 "barbell" approach to loop engineering.
For your most complex tasks that require the best intelligence, use expensive models (Opus).
For the remaining 80% of your tasks (the gruntwork), use cheap, open-source models within the Claude Code harness (GLM-5.2 is great for code execution).
Save these 5 rules so you don't forget them.
post-image
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Repost
  • Share
Comment
Add a comment
Add a comment
No comments
  • Pinned