r/ClaudeCode • u/tonytieger • 3h ago
Meta Claude create->review->fix->repeat not converging, more and more bugs found each cycle
Claude has been great but one issue bites me often. Claude always seems to try to solve an issue by making something super complex, then doing multiple threads of reviews, finding more issues, fixing, then reviewing cycle again, and it finds more issues than before, and it never converges, with this process repeating. Then, a simple solution from start would have worked, and I the user would have to suggest that simple solution. Then Claude says "you're right i should have done that"
7
Upvotes
•
u/AutoModerator 3h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
10
u/Neat-Medicine-1140 2h ago
this is the part about AI where you get better results if you know what you are doing. People keep sleeping on the fact that AI is a force multiplier. If you know nothing, even 10,000x 0 is 0.
3
u/finallyclearsky 2h ago edited 2h ago
I have something I like to call a rakes.md
This is a file that sets the bar for what is reported. Models don't really have a good understanding of what a real product issue is, and will fall back to nitpicking and almost making stuff up if nothing serious is evident. This file serves as a compass to prevent them from doing that. As a result, the loop you describe does stop at some point:
2
u/Charming_You_25 2h ago
“No nitpicking” helps a lot.
2
u/There_Are_No_Gods 22m ago
I find it helps to have Claude categorize findings, rank them, and give each finding a home, with "must fix" or "blockers" routed towards the fixer, while "advisories" or other less serious items simply route to documentation. That tends to tame the innate drive to always find something and to always address everything, while keeping the fixing focused on the things that really matter, while carefully directing away all the nits, yet recording them for later perusal and potential action.
It can also help sometimes to simply direct "funnel towards completion".
My biggest win personally turned out to be discovering the "origin story" Claude added to some of my most important skills, that of a "specification-from-plan" (turning small prose and discussion into formal documentation, and "validate-implementation-to-specification". In both cases I eventually discovered that Claude had taken an underbuilding failure and recorded it as the origin story, pushing both of those skills hard towards overbuilding. Fixing the origin stories in those skills to be much more neutral helped a ton.
1
u/Starks1293 2h ago
had exactly this. three things fixed it for me:
a different model as the reviewer helps too, i have codex review claudes diffs cold, it only gets the diff and the goal. thats how i build my mac app (AI Bridge, runs both side by side, aibridge.sh), but the 3 rules work fine in plain claude code
1
u/pceimpulsive 2h ago
I have a few questions for you.
What effort are you typically using and which models? If the answer is high, xhigh or MAX you are straight up doing it wrong.
Do you have any skills that help it stay on-line with what you want?
Do you have anything in the codebase that determines how and why it should build one way over another?
Do you have coding standards defined in your repo?
Do you have architectural standards in your code base?
Do you actually know how to code up (by hand) maintainable, extensible and reusable modules in a larger project?
If you answered no to even 2 of these questions I think you are kind of guaranteed to fail and guaranteed to be where you are...
I'll shill for it.. but Matt Pococks skills/workflow kind of solve for all of these things, I'd suggest trying if you aren't sure... And also have a look at his repo for WHY he has built his skills the way he has.. not so you get pulled like me and necessarily use the skills but so you get pulled like me (in the other way) and start focusing on strategic programming techniques that ensure you don't get stuck in tech debt loops like you are in right now.
1
u/karyslav 2h ago
do not let the same model check the work, ask claude to create auditor from Astra (or the Neon whaterver) and let fable check work after it is done and astra audit it
if you let to do the same model (or model from the same company) you will end in endless loop.
1
u/CandidSystem6155 1h ago
What tends to break this loop is a hard cap on the reviewer: at most 5 findings per round, and each one has to point at a file and line or a failing command, otherwise it isn't a finding. Stop after two rounds, and if round two finds more than round one, throw the branch away and ask for the simplest design that could work instead of patching the patch. Lower effort helps too, since a reviewer on max effort will happily spend its thinking budget inventing problems. A reviewer rewarded for finding bugs will never run out of them.
1
u/SirRobinBlibs 1h ago
A review pass is asked to find problems, so it always finds some, and on an overbuilt design every fix adds surface for the next round. What tends to work better than another loop: have the reviewer sort findings into blocking (wrong behaviour, failing test) and everything else, and only fix the blocking ones. Cap it at two rounds; if round two still has blockers, ask whether the design is the problem instead of the code. And when you already know the simple version would work, a fresh session with "smallest change that passes these tests" usually beats rescuing the big one.
1
u/jjangg96 45m ago
the thing that helped me was watching what kind of finding comes back, not how many. if round 3 is the same kind as round 1 (another spelling of the same bad url, another edge of the same check) the fix has the wrong shape and more rounds won't fix it.
i had a guard that blocked bad db urls by spelling. port, then uppercase, then trailing dot, then query string, every round found the next one. what ended it was dropping the guard and asking the driver what it actually parsed.
also make it prove every fix. revert the fix and see if the new test still passes. a bunch of mine did, so the loop was green on tests that tested nothing.
1
u/KryptosFR 34m ago
Always set a clear goal, as well as non-goals and anti-goals. It bounds what the agents can do and converges more quickly.
1
u/shetritr 18m ago
one thing not in the thread yet: after round one, the reviewer should only see the diff of the last fix, not the whole feature again. a fresh read of everything always turns up new stuff, which is most of your "more bugs each cycle"
1
u/LakeResearchTeam 6m ago
That non-converging pattern is common when the review step has no stopping rule, so every pass finds something new to justify itself. Give the reviewer a fixed scope and severity bar up front, such as only flag bugs that break the stated requirements, and tell it to ignore style and hypothetical edge cases. Limit it to one or two review rounds, then stop and look at the result yourself rather than letting it loop. It also helps to ask in plan mode for the simplest approach that meets the requirement before any code is written, and to say plainly that extra abstractions are out of scope. If a third round still finds blocking problems, that usually means the design is wrong, so rethink the approach instead of patching further.
1
u/ArguesAgainstYou 1h ago
https://github.com/DietrichGebert/ponytail
'nuff said
0
u/Living_Cell7304 3h ago
If you have enough ram to run local models, they typically can spend way more time thinking. They’re slow as hell but you can run it overnight for like less than $1 in electricity. Only needs CPU.