Re:Show HN: LoopGain – Stop agent loops with control theory,...
by lochnessduck on Wednesday July 15, 2026 @04:09PM
(#48926426)
To the author (Dave): have some faith in your voice. If you can’t describe the project as well as the AI (because you vibe coded it), then take a dang hour to ask the AI how it works and do a proper write up without copy pasting. Nobody is going to bother otherwise; it’s too obviously AI generated.
Re:Show HN: LoopGain – Stop agent loops with control theory,...
by fitz2882 on Saturday July 18, 2026 @02:06PM
(#48960553)
Hey, thanks for your comment. This is an idea that I thought up, researched, developed, and in the end built a useful, working, open source tool. Yes I used AI to assist me in the process, it's a complicated subject. But I take your point that it would be better to write in my own words. You're right, lesson learned.
Anyhow, whether I used a tool like AI to assist me or not, I am here to share something I built that I hope others will find useful. I am building what I am passionate about.
Re:Show HN: LoopGain – Stop agent loops with control theory,...
by stephantul on Sunday July 19, 2026 @09:06AM
(#48967903)
I don’t think this is the right take-away though.
Your fully generated project description makes people lose faith in the actual project. If you went through the trouble of writing the whole code yourself, why generate the comment presenting it to the public wholesale.
Re:Show HN: LoopGain – Stop agent loops with control theory,...
by Terretta on Friday July 17, 2026 @12:38PM
(#48949342)
Fitz, Dave, whoever is "here" ...
What prompt are you using to generate this exact form of thing?
Problem history story...
Everyone's doing it wrong...
Proof of claims ...
Abstract ...
"Honest" bustedness ...
Keyword stuffing ...
Call for feedback ...
"What I'd really love from Dave:" is what's causing this particular structure. What model/harness/agent are you using, whether automated or pasting it yourself?
Re:Show HN: LoopGain – Stop agent loops with control theory,...
by gavmor on Sunday July 19, 2026 @12:29PM
(#48969514)
I've got an application for this. Will try and get some benchmarks in the next few weeks. We're definitely attempting to converge on a quality inference without wasting tokens/time.
For now, we're passing the first pass to the humans, and that's roughly 80 for 20, but to get the last 20 without blowing up our token spend? This might be the approach.
Re:Show HN: LoopGain – Stop agent loops with control theory,...
by idiotsecant on Sunday July 19, 2026 @08:51AM
(#48967778)
I'm not sure you can so easily calculate 'error' for most real world cases.
In your example you are calculating error as a function of missed tests, for example. That's a pretty good example, you can't just leave that value at 2.5% of starting. It needs to be zero. All existing loops have logic to not proceed until those tests all pass.
If you can propose a means of generating an error signal in actual code you've just invented a way of automatically grading the goodness of code, which should make you quite a lot of money!
Re:Show HN: LoopGain – Stop agent loops with control theory,...
by brody_hamer on Sunday July 19, 2026 @08:57AM
(#48967827)
> All existing loops have logic to not proceed until those tests all pass.
My understanding is that this tool is mostly about “giving up” sooner, when it’s obvious that additional loops are not getting any closer to passing those tests.
It’s a cost saving measure when the problem is intractable, and needs more human context, etc.
Re:Show HN: LoopGain – Stop agent loops with control theory,...
by fitz2882 on Sunday July 19, 2026 @03:39PM
(#48971086)
Hey everyone, I just want to clear some things up here based on the comments:
I (Dave) am a real person, and yes I used AI to help me with every part of this project, including my initial comment introducing it here. That was a mistake, I should have just written it myself. I am a self-taught developer who is passionate about AI development and curious about seeing what I can do with it. I come up with my ideas and test them with the help of AI. Then I have AI help me understand it. This all started because I was building multi-agent systems, just experimenting, and I noticed that they looked to me like electrical circuit diagrams. So it made me curious if there was any cross over between the laws of electrical engineering and how it might apply to agentic systems. With AI today you can pursue any idea you have, so I have fun by seeing what happens when you take concepts from one established field and apply them to something else. I had AI do deep research on electrical engineering concepts, and asked it to research how those might be applied to agentic systems. It came up with interesting ideas, so I had it plan scientific experiments on ones that looked promising, and the one that looked like the most obvious application is what turned into LoopGain. With the help of AI I developed it into a working system, created a website and company around it, made the project open source, wrote blog articles about the experiments, then asked AI how to best share it with the world. I love developing useful tools and researching the edge of AI capabilities, so that is what I am doing here. Thanks for reading.
Re:Show HN: LoopGain – Stop agent loops with control theory,...
by fitz2882 on Wednesday July 22, 2026 @06:27PM
(#49014321)
Hey, sorry I didn't see your comment until now. Yes I just added a Claude Code plugin that allows LoopGain to work with /goal.
/goal's checker knows when it's done but not when it has stopped improving. The plugin sets a Stop hook that, after each turn, runs your own verifier (such as failing-test count) and stops the loop when LoopGain sees it's converged or stalled instead of a guessed cap.
Any skill that iterates can just call the LoopGain library from a small script to decide when to stop instead of a hardcoded cap. I do this in my own skills. It recurses until the number of unresolved pieces stops dropping, no fixed depth limit.
You can also point any AI agent to the repo so it learns how LoopGain works and it will be able to help you set it up how you like. It's open-source.
Anyhow, whether I used a tool like AI to assist me or not, I am here to share something I built that I hope others will find useful. I am building what I am passionate about.
Your fully generated project description makes people lose faith in the actual project. If you went through the trouble of writing the whole code yourself, why generate the comment presenting it to the public wholesale.
What prompt are you using to generate this exact form of thing?
Problem history story...
Everyone's doing it wrong...
Proof of claims ...
Abstract ...
"Honest" bustedness ...
Keyword stuffing ...
Call for feedback ...
"What I'd really love from Dave:" is what's causing this particular structure. What model/harness/agent are you using, whether automated or pasting it yourself?
For now, we're passing the first pass to the humans, and that's roughly 80 for 20, but to get the last 20 without blowing up our token spend? This might be the approach.
Thanks for the write up comment, btw.
In your example you are calculating error as a function of missed tests, for example. That's a pretty good example, you can't just leave that value at 2.5% of starting. It needs to be zero. All existing loops have logic to not proceed until those tests all pass.
If you can propose a means of generating an error signal in actual code you've just invented a way of automatically grading the goodness of code, which should make you quite a lot of money!
My understanding is that this tool is mostly about “giving up” sooner, when it’s obvious that additional loops are not getting any closer to passing those tests.
It’s a cost saving measure when the problem is intractable, and needs more human context, etc.
I (Dave) am a real person, and yes I used AI to help me with every part of this project, including my initial comment introducing it here. That was a mistake, I should have just written it myself. I am a self-taught developer who is passionate about AI development and curious about seeing what I can do with it. I come up with my ideas and test them with the help of AI. Then I have AI help me understand it. This all started because I was building multi-agent systems, just experimenting, and I noticed that they looked to me like electrical circuit diagrams. So it made me curious if there was any cross over between the laws of electrical engineering and how it might apply to agentic systems. With AI today you can pursue any idea you have, so I have fun by seeing what happens when you take concepts from one established field and apply them to something else. I had AI do deep research on electrical engineering concepts, and asked it to research how those might be applied to agentic systems. It came up with interesting ideas, so I had it plan scientific experiments on ones that looked promising, and the one that looked like the most obvious application is what turned into LoopGain. With the help of AI I developed it into a working system, created a website and company around it, made the project open source, wrote blog articles about the experiments, then asked AI how to best share it with the world. I love developing useful tools and researching the edge of AI capabilities, so that is what I am doing here. Thanks for reading.
/goal's checker knows when it's done but not when it has stopped improving. The plugin sets a Stop hook that, after each turn, runs your own verifier (such as failing-test count) and stops the loop when LoopGain sees it's converged or stalled instead of a guessed cap.
- two install commands:
Any skill that iterates can just call the LoopGain library from a small script to decide when to stop instead of a hardcoded cap. I do this in my own skills. It recurses until the number of unresolved pieces stops dropping, no fixed depth limit.You can also point any AI agent to the repo so it learns how LoopGain works and it will be able to help you set it up how you like. It's open-source.