Loop Engineering explained in 8min..
Caleb Writes Code · 2026-07-03 · 8м 53с · 100 427 просмотров · YouTube ↗
Топики: ai-loop-engineering
🎧 Аудио
📝 Summary
model=deepseek-v4-flash · prompt=summary-v7 · 3 906→1 864 tokens · 2026-07-20 11:48:38
🎯 Главная суть
Loop engineering — новый слой архитектуры AI-агентов, который позволяет агенту самому ставить себе задачи и выполнять их без человеческого промпта. Это надстройка над harness engineering, где внешняя система управляет контекстом и разбивает сложные задания на стабильные шаги. Такой подход даёт агенту автономию: он может самостоятельно проверять обновления, исправлять баги и обрастать знаниями без ручных команд.
Эволюция: от prompt engineering до loop engineering
Каждый следующий уровень решает ограничения предыдущего. Prompt engineering — это просто инструкция в контексте: «Ты вежливый оператор поддержки». Context engineering использует оставшееся пространство контекста, чтобы агент самостоятельно вызывал инструменты — читал файлы, изменял их, подключался к базам данных через MCP. Ограничение: контекст плохо справляется с задачами дольше 5–10 минут — при суммировании контекста важные детали теряются. Harness engineering решает эту проблему внешним управлением: система за пределами контекстного окна разбивает требования пользователя на устойчивые к выполнению подзадачи.
Конкретные примеры трёх уровней
- Prompt engineering — вопрос «сколько чизбургеров поместится между Землёй и Луной?» ChatGPT отвечает из своих знаний, не привлекая внешние данные.
- Context engineering — вопрос «какое последнее открытие сделало NASA?» ChatGPT сам ищет информацию в вебе и загружает её в контекст.
- Harness engineering — команда «склонируй весь сайт NASA» в CloudCode. Сайт огромен, и просто context engineering «захлебнётся» на середине. Harness engineering предоставляет внешний механизм, который управляет контекстом и рантаймом, позволяя агенту выполнять длинный список задач последовательно.
Что такое loop engineering и зачем он нужен
Во всех предыдущих подходах человек каждый раз вводил промпт — задавал вопрос или давал команду. Loop engineering добавляет ещё один внешний слой (ещё один цикл поверх harness), который позволяет агенту самостоятельно решать, что делать дальше. Например, агент сам решает, что нужно обновить сайт, найти баги и исправить их — без участия пользователя. Это не замена нижних уровней, а их развитие: агенты растут в объёме работы, и каждый новый цикл помогает делать её без человеческого контроля.
Шесть компонентов loop engineering (по Адди Османи)
Адди Османи описал шесть составляющих loop engineering:
- Automation — автоматические триггеры и расписания для выполнения задач.
- WorkTree — структура, позволяющая параллельно работать над несколькими исправлениями, предотвращая загрязнение рантайма.
- Skills — набор умений агента (например, доступ к базе знаний).
- Plugins and connectors — интеграции с внешними сервисами (базы данных, API).
- Sub‑agents — дочерние агенты, которые могут перепроверять работу основного агента.
- State — сохранение состояния выполнения между сессиями, чтобы агент мог продолжать прерванные задачи.
Пример работы loop engineering на практике
Представлен сайт с результатами Чемпионата мира по футболу. Сначала Codex (Claude Code) с помощью prompt, context и harness engineering создаёт сам сайт. Но матчи идут каждый день, пользователи находят баги. Вместо того чтобы каждый раз просить агента обновлять сайт вручную, создаётся scheduled task: агент каждый час проверяет новые данные и обновляет страницы. Аналогично для багов: агент автономно мониторит репорты и вносит исправления. Это и есть loop engineering — внешний цикл, который управляет агентом без участия человека. При этом уже установлены скиллы и плагины, а дочерние агенты (sub‑agents) параллельно проверяют код и предотвращают конфликты через WorkTree.
Критика и перспективы
Многие считают loop engineering просто хайпом, призванным заставить тратить больше токенов и генерировать «AI slop». Пока нет реальных примеров, где этот подход дал бы очевидный прирост. Тем не менее, он может стать следующим этапом эволюции: по мере того как агенты берут на себя всё более сложные проекты, автономное самоуправление становится необходимым. Loop engineering — это не упразднение предшествующих методов, а их надстройка: каждый новый слой (цикл на цикле) позволяет делать работу, которую раньше мог выполнить только человек.
📜 Transcript
en · 1 685 слов · 24 сегментов · clean
Показать текст транскрипта
Well, here we are again with yet another term called loop engineering. And it wasn't even that long ago we had harness engineering. So is this just a marketing hype or is there actually something substantial behind loop engineering? Let's walk down from prompt engineering all the way to loop engineering to see why we needed each step of the way. We all know by now what prompt engineering is. Let's say I start with a prompt. You are a helpful customer service rep. Please be nice to my customers. This is prompt engineering because you are prompting the agent by implicitly telling telling the agent what to do. And we can then ask AI any question and the agent will impersonate a customer service rep based on the prompt that we just generated. That makes sense and super simple. So why do we need context engineering? Turns out this prompt that we just created lives inside of the agent's context window, and we still have a lot of room left in our context to do something more useful. So what if we gave the agent autonomy to invoke tools to start filling up its own context based on what the prompt actually needs? This was the beginning of context engineering where the agent could now access files to load and make changes, or even use MCP to start interacting with databases and external applications to load its own context. Cool. Context engineering makes sense. So then why do we need harness engineering? Well, there's actually no inherent flaw to context engineering, but rather it has limitations. Context engineering is not really good at tasks that. take longer than five to 10 minutes long. And here's why. Tasks that take long tend to require more context than what the agent can handle. And while it could keep summarizing its own context as it approached the limit, it was extremely leaky where important details started to get lost in each step of the summarization. So essentially we needed a system outside of context engineering to better manage internally. its own context from outside in. And this very external system is what we call harness engineering. Harness engineering manages the context. from the outside and helps the agent run time to work on tasks that help break down the user's requirement into a more stable execution. Let's look at a few examples to make sure that we understand this more concretely. And we'll use ChatGPT and CloudCode since it's something that we all have hands-on experience in. But before we dive in, today's video is sponsored by Virta. If you write code for a living, you probably hit a point where your own machine just can't handle what you're trying to build. And that's the gap that Virta fills in. Virta is a full-stack AI cloud. built for the whole model lifecycle from a single GPU instance and instant clusters to serverless inference and manage endpoints. It isn't a general purpose cloud with AI bolted on after the fact. It's built specifically for AI work by people who actually train and serve models. So the workflow is designed around how you'd actually use it. And the workflow is the part that I like. You sign up, spit up an instance and pick your GPU, anything from the new GB300 down to an older V100. You then drop in your SSH key and you're straight in from your own terminal. just SSH in from VS Code, drag my code across, and I've got all the VRAM that the card gives me to run without ever leaving my editor. There's also a CLI if you'd rather stay in the terminal start to finish. Spin instances up. manage them and connect all from the command line on the hardware side you get serious nvidia gpus like b300s with nvlink infiniband and fast nvme storage for workloads where interconnect and throughput actually matter and if you're working with data or model weights you can't afford to expose verda supports confidential computing so your workload stays encrypted while it's actually running on gpu not just sitting in storage link in the description use code caleb50 to get 50 off of compute for just five dollars that's 90 percent off of your first top up. Thanks again, Virta, for sponsoring. Asking Chachapiti the question, how many cheeseburgers can I fit between the Earth and the Moon? This is solely using prompt engineering because it doesn't need anything external to answer a very simple question. It can just reason through what it already knows to answer my question. Now, asking Chachapiti, what is the latest discovery that NASA made? This now has to use context engineering because it has to search the web and gather relevant information from NASA to help answer my question. So context engineering helps bringing information from the web autonomously. Now, when I ask Cloud Code, can you clone the entire NASA website? This is all done by harness engineering because the NASA website, as you can imagine, is really complex. And simply relying on context engineering on tasks like this will start to choke midway through. So harness engineering provides an external mechanism to help manage the context and the runtime for the agent to work through a long list of tasks. Now, you might have noticed a pattern that emerges from this. And that pattern is the concept. of loops. For context engineering, there's a loop where the agent recursively calls tool after tool autonomously until it thinks that it has enough context to answer your question. And for harness engineering, there's also a loop where the agent has a list of tasks outside of the context window to keep iterating task after task until the entire operation is finished. So what we find is that we are essentially stacking loop on top of another loop. Now we get to loop engineering, which is yet another loop in itself. I know. Is there even an end to this? So loop engineering stacks another loop outside of harness engineering layer to guide the harness externally. But why? Why do we even need yet another scaffolding again? At the heart of loop engineering, loop engineering targets the human interaction in actually prompting the agent to do something. Everything that we have seen so far involves a human asking the agent. questions like how many cheeseburgers can I fit between Earth and the moon? What is the latest news on NASA or even clone the NASA's website? These are prompts that require me to actually prompt the agent. But what if we built a scaffolding outside of this so that the agent can also prompt itself on what it thinks it needs to do? That is the heart and the spirit of what Loop Engineering tries to target. And if all of this sounds hokey pokey to you, you're probably not alone. There's a lot of people saying Loop Engineering is just a buzzword and that's trying to encourage people to just burn more tokens and create more AI slop. And so far, we have really yet to see loop engineering in action that really makes a huge difference. But it could be the next evolution in our engineering philosophy as agents expand its scopes in what it can help us with. And it does raise a really interesting debate and discussion around all of this. So what exactly is loop engineering and how does all of it work? Addy Osmani wrote a blog describing loop engineering with six components, but we don't want to read all of this. So instead of boring you with details, I'm going to give you a potential use case of loop engineering that help you wrap your head around. what loop engineering could look like. Let's say I built a website that keeps track of the World Cup scores. And when I ask Codex to build me a World Cup website, Codex will use prompt, context, and harness engineering to build this beautifully written website. Now, there's one problem here. And that problem is that the World Cup games... are happening every single day and that means in order to maintain the website that i just created through codex i have to keep prompting the agent to frequently update the site and also work on bug fixes that people might find on the website but what if i just created a scheduled task inside of codex to check every hour for updates as new information becomes available and what if i do the same for bug fixes where the agent just checks autonomously for bugs that are reported by users and fix them what you're seeing here is that we are beginning to create this loop outside of harness engineering where it's self-guided rather than human guided to maintain my website. And because I have skills and plugins already installed on my codex environment, the agent can access an existing knowledge base to keep building and improving its knowledge along the way. And the agent can also use sub-agents to verify its own work and also the ability to work on multiple fixes at the same time by using what's called WorkTree to prevent runtime contamination along the way. All of these that I just mentioned are essential ingredients to what makes loop engineering what it is. And that is the six components that Addy Osmani wrote in his blog, Automation, WorkTree, Skills, plugins and connectors, sub agents and state are components of loop engineering. And while this World Cup website that I just created is just an example of what loop engineering could look like, the true potential of what loop engineering could really be is still somewhat theoretical. And one thing to keep in mind is that loop engineering doesn't necessarily mean that all the engineering philosophy underneath is less important or even less needed than before. It's just agents growing in scope. and building on top of each other loop stacked on another loop to help us get more complex work done.
⚙️ Pipeline jobs
| Stage | Status | Att. | Updated | Error |
|---|---|---|---|---|
| download | done | 2/3 | 2026-07-20 11:48:04 | |
| transcribe | done | 1/3 | 2026-07-20 11:48:13 | |
| summarize | done | 1/3 | 2026-07-20 11:48:38 | |
| embed | done | 1/3 | 2026-07-20 11:48:40 |
📄 Описание YouTube
Показать
Apply code CALEB-50 to receive $50 of compute for only $5. That’s a 90% discount on your initial top up. https://verda.com/?utm_source=cwc&utm_medium=referral&utm_campaign=sponsorship&utm_content=loop Loop Engineering and Agent Loop explained as we progress from prompt engineering to context engineering to harness engineering and now loops. From tool calls to external environment and now to loop outside of the harness itself to help increase the scope of what AI agents can handle is the next evolution in how we are stacking loop on top of loops. #agents #ai #artificialintelligence Follow me: X: https://x.com/calebfoundry LinkedIn: https://www.linkedin.com/in/calebeom/ TikTok: https://www.tiktok.com/@calebwritescode Chapters 00:00 Intro 00:17 Prompt Engineering 01:00 Context Engineering 01:42 Harness Engineering 02:15 Sponsor: Verda 03:42 Practical Examples 04:39 Loops 05:50 Why Loops? 06:44 Loop Example 08:23 Conclusion