Agentic Feedback Loops
Avoid the 'Bitter Lesson' by investing your time in the right places
In the time since December 2025, coding agents have revolutionized software development. As an industry, a ton of energy has been expended trying to get the most out of these tools. One day, there will probably be a consensus on what the ideal workflow is for an AI native project, but in the meantime we all have to place a bet on what will be the convention of the future. Some, or more likely, all of us, will have to rework our projects to conform with tomorrow’s best practices.
So what do we do in this transitional period, the here and now? Do we sit, wait for the future to come? Do we experiment, knowing that it might all be for nothing, and that we might have to migrate again in another six months? These are questions I’ve been thinking about a lot in recent months. And while I still do not have the answers, I have come to believe that automated quality gates are the highest leverage place to invest currently.
If you’ve worked with agents very much, you know that they can be confidently wrong. You can prompt defensively to combat this, but the solution space is too large to express every anti-pattern in the bounded context window of modern day LLMs. The naive approach is to do human-in-the-loop review of the model’s output after each section in a task, but this is time consuming and error prone. Human review is valuable, but if you try to review everything an agent does manually, you will quickly find yourself overwhelmed by slop. The solution to this is not complicated. You need automated quality gates. In the simplest form, you just need a good linter and a good test suite.
How can we ensure that an agent runs these at the right time? A few solutions exist.
- Tell your agent to run them in
AGENTS.md. This is the simplest way, and actually works decently well unless your context window is getting too full. - Agent hooks: Claude Code and Codex both allow you to create plugins which can run these checks on certain lifecycle events. The downside of these is that they are unique to each coding agent.
- Git hooks: Run all of your verification in a pre-commit hook.
My recommendation is to implement a hybrid of 1 and 3. Set up all of your quality gates under a script like pnpm verify and add the following to your AGENTS.md:
After each logical chunk of work, run pnpm verify to ensure you are complying with project conventions.
For pre-commit hooks, I prefer these tools.
- Left Hook for git hooks management
- lint-staged to run checks on only staged changes
- Biome for very fast linting/formatting and excellent custom rules using GritQL
- Fallow.rs for additional code quality heuristics and quality gating
- Vitest for speedy test runs
- Gitleaks for secret scanning
Usually, I prompt something like this for the initial setup.
Set up a pre-commit hook in this repository using Left Hook and lint-staged. Ensure that it runs our tests, lints and formats files, performs code quality analysis with Fallow, and scans for potential secrets in staged files using Gitleaks. Please install Fallow.rs with default options for code quality if not already set up.
After setting this up in a project, I find that my agents can run significantly longer without my intervention. So many times, the review feedback I’m providing to an agent is something lintable. When you give an agent the right tools to check its own work, it can run for 30-60 minutes on a large enough task, and you don’t have to worry about slop anywhere near as much.