my coding agent keeps making the same dumb mistake over and over

Reddit r/LocalLLaMA / 3/23/2026

💬 OpinionIdeas & Deep AnalysisTools & Practical Usage

Key Points

  • The post describes a coding agent that repeatedly makes the same mistakes due to not remembering fixes, causing looping behavior.
  • The author tests a simple cure: store successful fixes as reusable patterns to handle future similar failures.
  • While this pattern-based approach reduces repetition, it can overgeneralize and apply the wrong fix in the wrong context.
  • The author is balancing memory retention against avoiding overfitting to past failures and asks the community for experiences with agent-loop issues.

my coding agent kept making the same stupid mistake over and over

like it knew how to fix it
but just... didn’t remember

it would:

  • fail
  • try something
  • fix it
  • then hit a similar issue later and repeat everything again

so I tried something simple:

→ when a fix works, store it as a pattern
→ next time a similar failure shows up, just reuse it

this already cuts a lot of loops

but now there’s a weird problem:

sometimes it overgeneralizes and applies the wrong fix in the wrong place

feels very human tbh

now I’m stuck between:

  • not forgetting
  • vs not overfitting to past failures

anyone else run into this with agent loops?

submitted by /u/nh_t
[link] [comments]