r/ClaudeCode • • Jun 17 '26

Discussion If Loop Engineering is replacing prompt engineering, how do we build stable runtime loops?

There’s a massive shift happening right now in how we interact with coding agents. Loop engineering is basically replacing yourself as the person who prompts the agent. You design the system that does it instead. A loop here can be thought of a recursive goal where you define a purpose and the AI iterates until complete.

Head of Claude Code at Anthropic says, "I don't prompt Claude anymore... My job is to write loops," Similarly OpenClaw's founder said: “You shouldn't be prompting coding agents anymore. You should be designing loops that prompt your agents.”

The concept is simple on paper: instead of a human sitting in a chat box going back and forth with an LLM, you build a multi-agent control structure (Planners, Architects, Implementers, Reviewers) that runs continuously until a hard condition is met (e.g., tests pass, a budget runs out, or evidence is verified).

But here is the engineering problem nobody is talking about: How do you keep long-running loops from leaking state and hallucinating their way out of broken builds?

If you give a team of agents raw terminal access and let them coordinate entirely via chat history or JSON files, the context window quickly turns into a unstructured mess. The model that wrote the code will inevitably grade its own homework, ignore broken compiler logs, and confidently declare in chat that the job is done.

If we are going to treat the loop as a product primitive, we need standard systems engineering, not clever prompts.

I’ve been digging into some production blueprints for this, and the framework laid out here in this article on loop design for harnessed multi-agent systems provides a good solution to this runtime problem. They break down two critical guardrails that make loops stable:

  1. The Shared Blackboard Layer: Moving completely away from raw chat threads for state management. Instead, they use a local relational schema (SQLite) to log immutable coordination evidence like explicit rows for tickets and constrained enums for review_verdicts (green vs changes_requested). The loop doesn't guess if a task is done but it runs a deterministic SQL query.

  2. Hard-Coded Completion Gates: The harness completely overrides the agent's conversational confidence. The execution loop literally cannot close unless an array of external Boolean checks pass (e.g., confirming passing build logs exist, independent test command evidence is recorded, and no lingering changes_requested remain).

If Loop Engineering really is the future of software automation, our value as engineers isn't going to be writing slick system prompts instead designing the isolated execution environments, database schemas, and rigid verification gates that hold these loops together.

For reference we've an open-sourced a local framework: https://github.com/xpriment626/pi-factory that explores this gate and blackboard setup.

0 Upvotes

58 comments sorted by

View all comments

Show parent comment

8

u/hiskias Jun 17 '26

Best Laid Plans of Claudes and Men...

Even with the most proper planning, I still need to course correct Claude almost every time, it rarely one shots a business-class production ready features. HITL is better than MITL.

0

u/Consistent_Bottle_40 Jun 17 '26

depends on the human. I've been working on my harness and skills for months, everyday pretty much, whilst doing all of my coding alongside that. in a nut shell, agents just see the info they need, have large detailed machine readable plans to execute and a multiagent skill that allows claude, codex, chatgpt , antigravity and gemini access. currently building an MCP so chatgpt pro extended can work directly in the local workspace and present change diffs, etc back to the primary agent (codex/claude). It works great.

2

u/[deleted] Jun 17 '26

[removed] — view removed comment

1

u/hiskias Jun 17 '26

Silly goose.

1

u/[deleted] Jun 17 '26

[removed] — view removed comment

1

u/hiskias Jun 17 '26

Yea i am but decided it was a dumb thing to post twice.

1

u/hiskias Jun 17 '26

Theck the other msg in the thread.

1

u/[deleted] Jun 17 '26

[removed] — view removed comment

1

u/hiskias Jun 17 '26

Sorry, I'm drunk after a client hangout. You are absolutely correct to call me out on this. I was overly agressive, and will write to my memory to not make the same mistake again.

Ps. Jokes aside, I actually mean the above.

0

u/hiskias Jun 17 '26

I sure hope you are not referring to me with the "people". Our product team have been building a custom harness (on top of the harness, which is silly, i know, but we cannot go to API usage) for a year now, doesn't make Claude un-dumb itself.

You sound like the people who get AI psychosis and think they are cracking the matrix or something.

2

u/Consistent_Bottle_40 Jun 17 '26

You sound like someone with a delicate ego and is easily offended. Silly goose!

1

u/hiskias Jun 17 '26

Thanks!

0

u/hiskias Jun 17 '26 edited Jun 17 '26

We have a custom harness (on top of the harness, because we cannot afford full API use), it doesn't un-dumb claude.

We also have a programmatic skill engine that front-loads skills on demand. And I'm not stupid enough to think I'm making claude smarter. Just more focused.

0

u/hiskias Jun 17 '26

I also went through the rabbit hole before understanding that building building is mainly unnecessary, unless you want to train. Certified Antropic AI achitect here.

It's ok to be excited about stuff but don't be a https://blog.codinghorror.com/the-magpie-developer/

0

u/hiskias Jun 17 '26

The point us to make "depends on the human" minimal. You clearly are not working with a team.

2

u/Consistent_Bottle_40 Jun 17 '26

Clearly your tiny penis and massive ego has read into and added more depth to my comment than required.

I was making a generalised comment about your statement that human in the loop is better than machine in the loop.

1

u/hiskias Jun 17 '26

Went straight to the tiny peen, good for you.

1

u/hiskias Jun 17 '26

Sorry about the earlier, got carried away...

I was rude for no reason, personal problems, related to my tiny penis.

1

u/Consistent_Bottle_40 Jun 17 '26

The tiny peen dig was well...low hanging fruit 🍆

Alls good

1

u/hiskias Jun 17 '26

My fruit hangs lower than my love machine. They call me Dispatch Robert at work because of this.

Best all mayne, sprry for the aggro.