Improving Coding Agents: An Early Look at CodeLoops for Building More Reliable Software

As a software developer, I’ve been fascinated by the potential of coding agents to transform how we build software. These tools have made impressive strides, empowering non-developers to create greenfield projects and simplifying tasks for seasoned coders. However, for serious software development, they fall short nearly 100% of the time. The problem? Coding agents tend to produce "code slop": unstructured, error-prone output that ignores context, forgets APIs, and breaks software. This makes them impractical for complex workflows where you need confidence that you are shipping quality software.
About a week ago, inspired by Max Bennett’s A Brief History of Intelligence, I decided to address this challenge. Bennett’s discussion of temporal difference learning and the actor-critic model planted a seed in my mind: could a feedback-driven approach improve coding agents? The result is CodeLoops, a simple system showing promise in it's early tests. Though still in its infancy, it’s already become a valuable part of my development workflow.
The Problem with Coding Agents
Platforms like Cursor offer configuration options, such as rules files or agent instructions, but these often fail to keep agents aligned. Agents ignore prior setups, forget APIs they’ve just created, or misuse library components, resulting in broken builds and frustrating workflows. Step-by-step nudging is possible but too slow for real-world development.
The core issues I’ve identified are memory gaps, context lapses, and a lack of iterative feedback. Without guidance, agents generate large amounts of messy, disconnected code. Once that happens, it’s nearly impossible to recover. You’re better off starting over. This unreliability limits their use in serious projects.
The CodeLoops Solution: Actor-Critic Feedback
CodeLoops leverages the actor-critic model and integrates with your existing coding agent. Here’s how it functions:
- The Actor: Your agent generates code or plans a step, sending it as a "thought" to the critic.
- The Critic: Powered by an LLM (like Anthropic’s Haiku 3.5, which I’ve tested successfully), it evaluates the thought for accuracy and adherence to best practices.
- The Knowledge Graph: Stores feedback and context for future steps.
The actor refines its work based on the critic’s feedback, which is logged in the knowledge graph. This iterative loop aims to bring us closer to an autonomous coding agent that stays aligned with project goals.... which in my opinion is the holy grail.
Why CodeLoops Shows Promise
I’m tired of workflow overhauls for every new competing AI tool, so I designed CodeLoops to enhance your existing agent and workflows.
It helps your agent:
- Recall APIs accurately.
- Reduce redundant code.
- Follow best practices.
- Stay aligned with project objectives.
Results may vary by use case, but the knowledge graph aims to solve memory issues with a shared context. It’s a potential game-changer that respects your existing setup.
Expanding the System
CodeLoops evolves with your needs. Beyond the actor-critic duo, I’ve added a summarization agent and plan on adding more specialized, chain-able agents, like:
- Duplicate Code Agent: Flags redundancy using the knowledge graph.
- Component Interface Agent: Ensures the actor understands component, module, or library APIs before implementation.
- Best Practices Agent: Enforces project standards, like avoiding barrel files.
- And much more to come.
The critic delegates tasks to these agents, forming a chain of checks that polishes the actor’s output. It aims to be modular and works seamlessly with your AI tools.
Early Results
In an initial test drive, CodeLoops guided a camera-recording feature for QuickRecorder, an open-source app. Paired with Augment’s agent in VS Code, it handled complex Swift and macOS API integration.
Here’s a brief breakdown:
Phase | Outcome |
---|---|
Problem analysis | Identifies missing camera capture; plan approved. |
Iterative implementation plans | Three critic cycles sharpen the plan; holes in error handling, permissions, and artifacts are fixed. |
Code delivery + artifacts | Full Swift code attached and approved. |
Bug‑fix pass (type mismatch) | Camera‑size control converted from Double→Int. |
UX cleanup (scrolling) | SForm wrapped in ScrollView; nav height tweaked. |
Build automation | Makefile adds reproducible build + DMG target. |
This test highlights its potential, but it’s still early days. I’ve used CodeLoops across several projects for about a week with encouraging results. More testing is needed to ensure consistent quality. The cost using Haiku 3.5? Less than $0.40 for the week. Check out the QuickRecorder pull request here.
Open Source: Building Smarter-er, Together-er
I’m passionate about helping developers, and anyone with a big idea, build software more effectively as a community. That’s why CodeLoops is open source. You can explore the code, adapt it to your needs, and contribute improvements. Whether it’s fixing bugs, adding features, or sharing feedback, your involvement will make CodeLoops better for everyone.
Setup requires adding an API key for models like Anthropic or OpenAI, which may feel like a hurdle. But this small effort pays off by addressing memory gaps, context lapses, and messy code. CodeLoops enhances your agent’s reliability without disrupting your workflow.
Non-developers can benefit too. If you’re using tools like Cursor or Windsurf to bring ideas to life, CodeLoops could guide your agent, catch errors early, and keep your project on track. With community support, it could become an essential tool for all.
Try CodeLoops
Curious about how CodeLoops could improve your workflow? Whether you’re a developer or a non-developer with a vision, get it from GitHub today. It’s open source, and your feedback will shape its future. Clone it, test it, tweak it. Or even break it. Then, let me know your thoughts.
- GitHub: Star the repo
- Contact: mat@silvabyte.com
- X: Follow me
- YouTube: Subscribe