Loading views...

Agent Loop Writing

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2026 Jun 8 11:16
Editor
Edited
Edited
2026 Jun 14 20:55

What humans do is keep moving from imperative to declarative in programming languages, and in how agents are prompted via goals and loop definitions.

  • The essence of an LLM loop isn’t “autonomy”; it’s “verifiable iteration.”
    • It’s not that the agent is smart and will eventually solve it if you let it run.
    • You need a mechanical way to judge success/failure at every iteration.
  • In a good loop, the exit condition matters more than the prompt.
    • You need a clear stop signal like “tests pass,” “compile succeeds,” “metric improves,” or “zero exit code.”
    • Without an exit condition, a loop is closer to gambling than engineering.
  • Separate what the agent decides from what the code must enforce.
    • LLM: ambiguous judgment, code generation, diagnosis.
    • Deterministic code: execution, verification, logging, retry caps, rollback, diff checks.
    • An agent loop is ultimately a software architecture problem.
  • Loops where an agent evaluates itself are risky.
    • It can keep rationalizing within the same flawed logic.
    • It’s safer to separate the task agent and the evaluator agent.
  • The biggest risk isn’t cost; it’s humans losing understanding.
    • The faster an agent produces code, the less people know “why it ended up this way.”
    • When a production failure happens later, debugging becomes very difficult.
 
 
 
Matt Van Horn on Twitter / X
https://t.co/DM0CAuyprS— Matt Van Horn (@mvanhorn) June 8, 2026

The loop is plumbing. The asset is the skill it calls.

Principles beat rules
If someone mentions a bug, say this. If someone compares us to another tool, say that. If someone asks about pricing, mention this plan. This was very brittle.
  • Be helpful, not defensive.
  • Do not talk down to the user.
  • Check factual claims against the docs.
  • Sound like someone who builds the product, not someone who processes feedback.
This made the skill file smaller and the agent a lot better.
Petra Donka on Twitter / X
https://t.co/kI2B1isN4N— Petra Donka (@petradonka) May 14, 2026
 
 

Recommendations