Claude Code Works Better With Loops, Not Prompts
Eric Tech · 2026-06-24 · 11м 29с · 13 767 просмотров · YouTube ↗
Топики: ai-loop-engineering
🎧 Аудио
📝 Summary
model=deepseek-v4-flash · prompt=summary-v7 · 5 022→2 286 tokens · 2026-07-20 11:47:58
🎯 Главная суть
Loop engineering — это метод проектирования самокорректирующихся AI-агентных систем, которые рекурсивно итерируют выполнение задачи до достижения заданной цели. Вместо однократного промпта (ввода запроса и ручной корректировки результата) loop engineering использует цепочку специализированных агентов: оркестратор запускает исполнителя, затем проверяет результат и при несоответствии отправляет его на доработку. Такой подход позволяет автоматизировать процесс исправления ошибок без вмешательства человека.
Концепция loop engineering: от простого запроса к циклу с проверкой
Традиционный способ работы с AI-агентом: пользователь даёт промпт (например, «создай приложение»), агент выполняет задачу, но результат часто не устраивает. Тогда пользователь вручную перепроверяет и уточняет промпт. Loop engineering заменяет этот ручной цикл автоматическим: пользователь передаёт задачу оркестратору, который запускает исполнителя (execution agent). Исполнитель использует MCP (Model Context Protocol), навыки и под-агенты. После завершения оркестратор сравнивает результат с критериями успеха. Если результат не соответствует – он формирует обратную связь и отправляет исполнителю на доработку вместе с исходной целью. Цикл повторяется, пока оркестратор не одобрит итог, после чего результат отправляется пользователю. Создатель Cloud Code Borys Journey и создатель OpenCloud Peter Steinberger независимо заявили, что правильнее не промптить AI, а проектировать такие циклы.
Почему один агент не справляется: разделение ролей
Нельзя поручать одному агенту и выполнение, и проверку своей же работы – это аналогично тому, как студент сам себе проверяет экзамен: точность будет низкой. Поэтому в loop engineering вводят несколько специализированных агентов. Пример расширенной цепочки:
- Builder (исполнитель) – строит приложение.
- QA agent – проверяет (тестирует) результат. Если тесты не пройдены – отправляет обратно Builder’у.
- Reviewer (рецензент) – дополнительно проверяет код или логику. Может отправить на доработку как в QA, так и напрямую Builder’у.
Каждый агент имеет свой набор навыков (harness) и MCP-инструментов, что позволяет обрабатывать разные аспекты задачи системно и без конфликтов.
Семь компонентов для построения идеального агентного цикла
Автор (Eric Tech) выделяет шесть обязательных элементов, которые в сумме образуют работоспособный loop:
- Триггер – как запускается цикл: по команде (slash-скилл), по расписанию или по внешнему API-запросу.
- Worktree (рабочее окружение) – каждый агент должен выполняться в собственном изолированном окружении (например, отдельной ветке Git), чтобы не было конфликтов между изменениями нескольких агентов.
- Навыки (harness) – точные инструкции-скиллы, направляющие AI при выполнении и проверке. Каждая итерация цикла перезагружает эти скиллы.
- Коннекторы (MCP) – подключение к внешним сервисам: Slack, Jira, Supabase, Stripe, Sentry (логи), GitHub и т.д.
- Память (state/log) – запись истории итераций: что было предпринято, какие ошибки, что сработало. Обычно в виде лога в GitHub Issues, где одна задача = один issue, а каждая итерация добавляет комментарий с результатом.
- Под-агенты – несколько специализированных агентов, работающих параллельно каждый со своим worktree и навыками. Они могут запускаться одновременно для ускорения процесса.
Кроме того, в практической реализации используется «человеческий шлюз» (human gate): если агент-исполнитель застревает, задача маркируется как «stuck» и передаётся на ручное рассмотрение.
Роль памяти и логирования на примере GitHub Issues
Для отслеживания всех итераций автор использует GitHub Issues как центральное хранилище. Каждая задача (ticket) получает свой issue. При первом запуске создаётся описание задачи и критерии приёмки. В процессе цикла каждый агент добавляет в issue логи: что сделано на этапе build, какие проверки прошёл QA, одобрение reviewer. Если цикл откатывался (QA не прошёл – builder переделывал), это видно в истории. В итоге весь процесс компактен и легко управляем: достаточно скопировать ссылку на issue, передать её новому циклу, и он продолжит работу. Такой подход полностью удовлетворяет требованию «память»: каждый новый под-агент (с чистым контекстом) может прочитать лог прошлых попыток и понять, что уже пробовали, а что нужно сделать иначе.
Практическая реализация: навык Loop Maker
На основе вышеописанных принципов создан готовый переносимый скилл «Loop Maker», который работает в любом AI-агенте. Скилл проходит по семи вопросам (триггер, worktree, навыки, коннекторы, память, под-агенты, человеческий шлюз) и генерирует самодостаточный agentic loop с верификатором, состоянием и человеческим вмешательством. Пользователь получает интерфейс, где видит текущую стадию цикла. Скилл проверяет, нет ли пропусков в конфигурации, подтверждает форму цикла и создаёт весь код/конфигурацию для запуска.
📜 Transcript
en · 2 741 слов · 28 сегментов · clean
Показать текст транскрипта
Boris Journey, the creator of Cloud Code, said that he doesn't use Prom anymore. He used loops to prompting Cloud and figure out what to do. And even Peter Steinberger, the creator of OpenCloud, has said the same thing, that we shouldn't be prompting our coding agents anymore. We should be designing loops and prompting our AI agents. And that was said on June 7th. And later on June 8th, people on X claimed that this is something called loop engineering. and the truth is way before they were talking about this i was the one on youtube already created a video on how you can be able to apply loop engineering in a practical day-to-day workflow for example the video is called how i make clock over here building apps completely autonomously and furthermore i also have a version 2 of that video and if you're interested you can check out this video as well but with all being said in this video i'm sure exactly what is loop engineering how does it work behind the scene and why we should use it And most important part is I'm going to show you exactly how I use it in my personal experience on building loops. And if you stick to the end of this video, I'm going to show you the skills that I built on how you can be designing loops with the best practice. So with that being said, if that sounds interesting, let's get into the video. Now, before we continue, I recently launched our school community where I help you to master AI agents, automations, and so much more. And that's all coming from someone who used to work as a senior AI software engineer at companies like Amazon and Microsoft. And in this community, you're going to get over 100 plus video materials like templates and workflows that I personally built and sold over 100 plus times. On top of that, you're also going to get access to our weekly live calls. And just to give you an idea, this week, we're actually running a Cloud Code Masterclass where we're going to dive into how to improve Cloud Code's accuracy when we're going to use it to build applications. Plus, we're also going to get full community support where we're going to get a chance to ask questions and get direct answers back. So if you're ready to level up, make sure you jump right in and I'll see you in the community. Okay, so first of all, what is loop engineering? Well, here you can see that it is a practice for designing a self-correcting AI agent system that can recursively iterate until a certain goal is met. So what does it really mean? Well, before, what we have here is where we have our user here, just give it a prompt to our AI agents, and our AI agent here is going to perform the task. But sometimes, AI agent here might not give you what you want. So what do we do? We have to manually check it and reprompt it again. And that entire reprompting process is exactly what Loop Engineer here is trying to solve. So originally, we have our user here, give it a prompt like building an app to our AI agent. And instead of just have our AI agent here to dispatch that and try to do the work, it's going to spin up another agent here, right? So this is the orchestrator, and it's going to spin up another agent here to do the execution. And this execution here is going to trigger MCP, skills that we have, and also different sub-agents, and try to process that work. Once the executioner is done, then it's going to send the results back to the orchestrator. And the org trader here is going to check the work based on the conditions or the prompts that we provided initially. And as a result, once we have our org trader here process the request and found that, okay, well, this is not exactly what we want. Here's the feedback. Then it's going to spin up a new sub-agent here for execution, pass that feedback and the initial goal, and try to have the agent here to process that. So you can see that this is going to be the loop that we're going to run until our org trader here has reviewed this and said yes, the results. Then it's going to go ahead and send it back to the user. And the most important part for loop engineering here is that it's not really just limited to just two agents, right? You have your orchestrator and you have your executioner. You can also have other agents here in the chain to actually make this process here a lot more better. For example, you can have an orchestrator here that will dispatch a execution agent here to work on a task. And then you can also have another agent here. Once the agent here has done the work, for example, the builder, right, has built the application and now is going to the QA process. Then we have our QA agent here that's specialized in QA that will basically review, or in this case, test the work that the previous agent has done. And if this work here is not approved, then it's going to send it back to the agent here and try to reprocess that again. But if it does pass, then it's going to send it to the reviewer. And if the reviewer reviews this, if there's any feedback, it can still send it back to the QA or to the executioner and try to reprocess that again. You can see that this is basically the power of loop engineering here is that you can be able to adding a lot more things into your loop chain and try to have the workflow here to be executed in a systematic way. Now, at this point, you might be wondering, okay, why do we need so many agents here in the loop, right? Why can't we just have one agent here does a review and also does the bill? Well, here's the thing. It's like if you were to do it this way, it's kind of like the same as like having a student here finish the exam, but also marking his own exam as well, right? You're not going to get the highest accuracy here. And that's why we need to have multiple agents here. One agent does a review and one agent does the executions. And most important part is, let's say down the line, you want to have QA, reviewer, or a UX agent, then you need to have a separate agent for that, right? A specialized agent with a set of skills that it has in its own tool belt to basically trigger this process. okay so now you know exactly how this works behind the scene let me show you exactly what are the six steps to create a perfect agentic loops so the first thing we need to hear is we need to know exactly what the trigger is right how do we trigger the loop is it a slash skill is it on a schedule how does it actually be triggered and then what we need here is we also need to have the workflow here to be triggered in a separate environment and that usually be using a work tree because for our agentic os that i built you can have the workflow here to be dispatched with multiple agents running at the same time. And each agent here is going to be running using its own work tree, its own environment, so that there's no code conflicts or change conflicts between different agents. And then the third thing we need to do here is we need to know exactly what skills the execution and the review here is going to be triggered. And literally, that's going to be your agent hardness, which will guide the AI on exactly how to do things. and number four is going to be your connectors right connectors you can think of that as your like mcps what are some tools that it's actually going to connect to right is it actually going to communicate to is it like slack jira or is it like subbase stripe what are some other mcps that it's going to interact with for me myself with the agentic os that i built i usually have it to connect it to century to look at the logs and i also have it to connect to github so they can be able to commit the changes push the issues and everything are viewable instead of a github issue for example take a look at one of the issues that i have in my github issue you can see that everything's are all logged in here and that's the actual another thing i'm going to talk about which is the memory so you can see that everything from the task descriptions all the way to what each agent here has done so the first is the building process and then it moved into the loop and then here the bill is done then you can see there's like 30 items in there But if we were to keep it short, you can see the build process here is done. Maybe this process here, you can see it actually sent it back in between. Like maybe the reviewer take a look at it or the QA runs the test and it didn't pass. It's going to send it back to the builder here to rebuild it. But eventually you can see that the build here is fully complete. QA now is passing. And then the reviewer here is fully approved based on the description of the task and also the changes that the builder has complete and the QA has passed. Then it's going to review and the review now is approved. So then it's going to merge that pull request. And eventually here you can see the ticket here is finally closed and we can do it now. Mark that ticket is done. okay so you can see that each every issue here is basically using a mcp here github to keep track of all the issue status and that's literally the next thing we have here is memory which is basically having the nest agent here having context about what has happened so far right maybe this has went over for like 10 iterations already where we have a reviewer agent here has done the executions back and forth each iteration here we spin up a new sub-agent right so it has a fresh context window and it needs to know exactly what has happened in the past what have we tried so far right so we need to record that in a memory to log that so that the agent here when i start work on it and look through the past log to see what has been tried and what's not working and here is what we need what we need to try right so this is exactly what we need here is a memory and the last thing we need to do here is we need to have a sub-agent Now, sub-agent part, like I said, you need to have multiple agents here to do different things. And by having sub-agent, you can have multiple agents here running in parallel, along with each agent here has its own work tree to process this simultaneously. So now you know exactly what are the things we need to building our perfect agentic loops, let me show you the skills that are created for you so that you can use it to building your perfect agentic loop following the best practice that we just mentioned. Now, before I show you the skill, here you can see this is the entire loop layout on exactly what the skill helped you to generate. you can see that it focuses on these seven things right these six or seven things like what i just mentioned to you and just to quickly recap we need to know exactly what triggers the workflow right is it like a on-demand trigger or a schedule or listening for like a third-party api request and in this case do we need a work tree in this case created a separate branch for this and also what is the agent harness skill right what skill does the agent here is going to follow and try to process the execution and each iteration here is going to reload that skill and try to process that and then furthermore we also have our validator here which will basically validate the work that the generator has done and furthermore you can see we'll have our connector here which will basically connect it to our third-party mcps or coi tools And lastly, we'll have our state, which will basically connect. And lastly, we'll have our state, which will keep track of each iteration summary. And most important part is that if there's any parts that are stuck, right, if the generator here is unable to process, then it's going to delegate that into the human review where we're going to mark that issue here to be stuck. for the memory here you can see like i said i connected to using github issues because it's so much easier you can be able to link your pull request repositories into the github issues and you can be able to have your ticket descriptions and also you can be able to have all the logs right keeping track inside of the same issue so what i usually do here for the state is i'll just connect it to github issues each task is going to be one issue every iteration here is just going to be adding the log right these events here you can see it's going to be inside of this same issue so everything's all organized and compact it into a single issue that you can see here which is easier for me to manage and let's say down the road let's say if i want to create a new loop i'm just going to creating a github issue first creating the github description on what the task does and what is the acceptance criteria and simply just going to copy the link pass that to the loop and start iterating and finally i have packaged everything that i talked about in this video into the skill called loop maker which is a portable agent skill that works in your all your ai agents and interview you to scuffle a self-running agentic loop that have a complete verifier state file and also a human gate and it's doing that by validating the loop it creates making sure that your loop here following the seven best practice that we talked about in this video and furthermore this skill here also has a very nice user interface so you know exactly which stage you are whenever you're triggered a skill and here you can see this the entire flow it first asks you seven questions that we mentioned survey to see if there's any gaps confirm the loop shape and try to scuffle the entire loop to make it ready to invoke so pretty much that's the skill and if you want to give it a try make sure to check out in the link description below or you can join our school community where you can be able to check it out inside of our video material section and of course on this friday we actually have a live call so if you have any questions about agentic loops or anything that you're currently building make sure to prepare your questions join a call and i will make sure to see you then Okay, so pretty much that's it for this video. If you do found out in this video, please make sure to like this video, consider subscribing, check out our school community if you want more content like this. But with that being said, I'll see you in the next video.
⚙️ Pipeline jobs
| Stage | Status | Att. | Updated | Error |
|---|---|---|---|---|
| download | done | 1/3 | 2026-07-20 11:47:18 | |
| transcribe | done | 1/3 | 2026-07-20 11:47:27 | |
| summarize | done | 1/3 | 2026-07-20 11:47:58 | |
| embed | done | 1/3 | 2026-07-20 11:48:00 |
📄 Описание YouTube
Показать
Loop engineering is the shift the creators of Claude Code and OpenClaw made when they stopped prompting their agents — and I was running it in real workflows before it had a name. Here's what loop engineering is, how it works, and how I build self-correcting agentic loops in Claude Code. Key takeaways: - What loop engineering is: a self-correcting orchestrator → executioner → reviewer loop that iterates until your goal is met - The 6 building blocks of a reliable agentic loop: trigger, worktree, skills, connectors, memory, sub-agents - Using GitHub Issues as the memory/state layer so every iteration is logged and resumable - Loopmaker: the portable Claude skill I built to scaffold a verified self-running loop with a human gate 🔗 Join our Skool community: https://www.skool.com/erictech/about 🔗 Get Loopmaker (free): https://free.erictech.ca/loopmaker?src=yt-loop-engineering 🔗 Check out bookzero.ai — AI-powered bookkeeping built entirely with Claude Code 📌 Mentioned videos: - How I Make Claude Code Build Apps Autonomously: https://youtu.be/nX_bGyIOFM4 Timestamps: 0:00 Intro 1:42 How Loops Work 4:06 Why Multiple Agents 4:50 Trigger 5:03 Worktree 5:21 Skills 5:34 Connectors 7:08 Memory 7:47 Sub-Agents 8:07 Recap 10:06 Loopmaker Skill 11:04 Outro #claudecode #aitools #loopengineering