My code was AI Slop until I learned this system
Stop being overwhelmed by tickets. Scale your output and fix messy AI workflows with the three loops: inner execution, middle state, and outer architecture.
A developer sat at their desk staring at a mountain of unresolved tickets.
This developer knew how to write clean functions and build solid features. They were the top code contributors of the team.
But despite their technical skills, they felt completely overwhelmed by the sheer volume of work. Raw coding speed was not enough to keep up.
Get the guide to build your first AI agent directly in your inbox on newsletter signup:
The role of a software engineer has been changing lately. Having basic programming knowledge is necessary, but not sufficient.
Now we have to learn productivity and workflows with AI to scale our output. Developers who lack organizational skills quickly fall behind in this new environment.
Real productivity means understanding your feedback loops. You must keep them tight. You must also close them
Let us look at how to apply these concepts in daily practice.
In this post, you’ll learn
How to speed up coding tasks using the inner loop.
How to manage project states and handoffs with the middle loop.
How to plan software architecture using the outer loop.
How to position yourself as an internal AI leader.
The three loops of AI productivity
AI isn’t just a fast code generator. It’s the brain behind our new productivity system. To leverage it effectively, we need to understand the three loops of AI productivity.
We’ll call them the inner loop, the middle loop, and the outer loop. These are the names that Steve Yegge and Gene Kim used in their book Vibe Coding
The inner loop is where a developer and AI rapidly exchange ideas and code in minutes. Treat it like a chef managing orders by focusing on tiny tasks.
The middle loop manages projects and task handoffs. This phase spans hours to days and involves the systems needed to pick up where work was left off. It’s like how chefs prepare ingredients before service and clean up after.
The outer loop thinks in the long term. The chef moves focus from cooking individual dishes to weeks or months of menu planning and kitchen improvement.
While reading, you may have imagined systems for all of these 3 loops
Inner loop: A developer using their IDE and executing unit tests
Middle loop: A kanban board with all the tasks and dependencies for a project
Outer loop: Documentation of architectural patterns and API contracts between services.
We’ll see how to adapt the three loops to AI
The inner loop for fast execution
Keeping AI interactions tight and focused maintains momentum.
LLMs have a decay curve where the quality of output degrades as the conversation goes on. Writing micro prompts that target one specific function or bug fix at a time keeps the inner loop tight.
A few months ago, I’d have told you to build a personal library of prompts for common tasks like unit tests.
Now we don’t need to micromanage AI anymore.
We can put a series of steps in an Agent Skill. We’ll avoid the context rot by creating a simple multi-agent architecture where the main agent can spawn child agents.
Parent agents manage the work. Child agents do specific tasks. One child might write tests. Another might refactor code. A third could write documentation. This keeps the inner loop focused.
In this loop, the tools that matter the most are version control and unit tests.
You need to save the progress through commits, to have a separate branch for the agent to work on a particular task
You need to have unit tests to validate that the agent doesn’t break other functionality.
One of the problems with the inner loop is that the agent has a very narrow goal.
Tell an AI to make an API return a value. It might remove other data by mistake. It might also return fake data instead of using the database.
That’s why we need the middle loop
The middle loop for orchestration
Some time ago, every new session with the AI was a brand new start.
We needed a system to manage the state of the project and the handoffs between sessions. This is where the middle loop comes in.






