Reddit user experiments with failure-learning coding agents to break retry loops

A developer on r/LocalLLaMA has been experimenting with coding agents that learn from failures to break out of repetitive retry loops. The approach focuses on treating failure as reusable information rather than just logging raw errors.
The Problem: Stuck in Failure Loops
The developer observed that coding agents often get stuck in failure patterns: fail → retry → fail again. Initially thought to be a model limitation, the issue appears to be a failure-handling problem where systems don't track why something failed. When retrying, agents typically generate variations of the same attempt, repeating the same mistakes in slightly different ways.
The Experimental Approach
Instead of keeping raw logs, the developer started storing simplified "root causes" and pairing them with fixes that worked previously. Future attempts then match against this stored knowledge rather than guessing again. The developer notes this approach is still rough but shows different behavior: the system doesn't get stuck in the same loops as often and sometimes actually converges on solutions.
Current Challenges
- Matching failures reliably is tricky
- If the system generalizes the wrong thing, it can reinforce bad fixes
- Uncertain how to balance reusing known fixes versus exploring new ones
The developer is seeking community input on this approach and whether others have tried similar methods for improving coding agent failure recovery.
📖 Read the full source: r/LocalLLaMA
👀 See Also

MCP Context Bloat: Real Costs and a Practical Fix for Claude Code Users
Running 9 MCP servers in Claude Code leads to 38k token cold starts, ~$700/month in tool definition overhead, and degraded model performance. A gateway pattern with BM25 ranking cuts context to 4k.

HuggingFace Agent Skills: Standardized AI Task Definitions for Coding Agents
HuggingFace Skills are self-contained folders with YAML frontmatter and guidance for AI agents to perform specific ML tasks like dataset creation, model training, and evaluation. They're interoperable with OpenAI Codex, Anthropic's Claude Code, Google Gemini CLI, and Cursor.

OpenClaw Budget Guard Plugin Prevents Concurrent Budget Overspend
A new OpenClaw plugin called @runcycles/openclaw-budget-guard solves concurrent budget overspend by implementing atomic balance checks, reservation before execution, and idempotent retries. It requires a Cycles server with Redis and can be installed via bash command.

Kanwas: Open-source shared context board for teams and AI agents
Kanwas is an open-source multiplayer workspace where teams and AI agents share documents, evidence, and decisions on a canvas with live streaming tool calls. Self-hosted via Docker, it's git-backed with Yjs and BlockNote.