Loop Engineering Explained by Claude Code Creators | Self Improving Agentic Loop
Cloud Codes · 2026-06-26 · 8м 31с · 4 194 просмотров · YouTube ↗
Топики: ai-loop-engineering
🎧 Аудио
📝 Summary
model=deepseek-v4-flash · prompt=summary-v7 · 3 683→2 760 tokens · 2026-07-20 12:05:02
🎯 Главная суть
Loop Engineering — это переход от ручного написания промптов к проектированию циклов (loops), которые сами запускают ИИ-агентов, управляют их действиями и проверяют результаты. Вместо того чтобы быть оператором каждого шага, инженер становится дизайнером системы: определяет критерии «выполнено», а агенты работают в автоматическом режиме, пока не достигнут заданного условия.
Эволюция роли разработчика: от оператора к дизайнеру систем
До 2024 года работа с ИИ строилась по схеме «промпт → ответ → новый промпт» — человек управлял каждым шагом вручную. В 2025 году появилась возможность запускать несколько агентов параллельно, что сделало разработчика менеджером. К 2026 году произошёл качественный сдвиг: инженеры начали проектировать системы, которые сами управляют агентами. Глава Claude Code из Anthropic сформулировал это прямо: «Я больше не пишу промпты для Claude. У меня работают циклы, которые сами решают, что делать. Моя работа — писать эти циклы». Термин Loop Engineering закрепился в июне 2026 года, когда вышло 12-страничное руководство, разошедшееся по сообществу. Ключевая идея — выйти из внутреннего цикла (где ты сам читаешь вывод агента, ловишь ошибки и решаешь, что дальше) и подняться на уровень проектирования «рельсов», по которым агент движется.
Анатомия цикла: пять компонентов и память
Чтобы цикл работал надёжно, необходимы пять элементов и одно место для хранения состояния. Automations — это «сердцебиение»: задача запускается по расписанию, самостоятельно обнаруживает работу и кладёт результаты в инбокс. Worktrees решают проблему конфликтов файлов: git worktree даёт каждому агенту отдельную ветку и свою копию рабочей директории. Skills — записанное знание о проекте: соглашения, шаги сборки, особые решения, принятые после инцидентов; без них цикл каждый раз восстанавливает контекст с нуля. Connectors на базе MCP позволяют циклу обращаться к реальным инструментам (трекеру задач, базе данных, Slack, Stripe) — разница между агентом, который говорит «вот исправление», и циклом, который сам открывает пул-реквест. Sub-Agents — разделение ролей: один агент пишет код, другой проверяет; модель, написавшая код, слишком добра к своей работе. Шестой, критический компонент — memory: markdown-файл или линейная доска, которая хранит, что сделано и что делать дальше, вне рамок единого диалога. Агент забывает всё между запусками, репозиторий — нет, память становится хребтом циклов.
Верификатор — главный элемент цикла
Любой цикл состоит из двух половин: генератора (модель, которая производит работу) и верификатора (механизм, оценивающий качество). Долгое время внимание было сосредоточено на генераторе, но в цикле генератор запускается многократно за копейки. Проблема возникает, когда верификатор слаб: он говорит «сделай лендинг лучше» без определения «лучше» — и агент переписывает заголовок восемь раз, тратя деньги без прогресса. Такая ситуация называется «машина слёта» (slop machine). Написание верификатора — это написание функции награды: не обучение модели, а определение того, что значит «хорошо» для вашей задачи. Вкус, суждение, понимание правильного — это и есть мур. Модель — товар, поэтому нельзя позволять агенту оценивать свою работу: он всегда ставит себе пятёрку. Claude Code использует команду goal, которая передаёт решение об остановке отдельной, более быстрой модели. Тот, кто писал код, не решает, что готово.
Закрытые и открытые циклы: контроль vs исследование
Различают два типа циклов. Закрытый цикл (closed loop) заранее фиксирует критерии успеха, проверяет каждый шаг и останавливается по команде: предсказуемый, дешёвый, безопасный для автономной работы. Пример: «запускать тесты, читать ошибки, исправлять причину, повторять, пока всё не зелёное или после шести раундов». Открытый цикл (open loop) получает общую цель и пространство для исследования — там рождаются новые решения, но он жжёт токены и быстро скатывается в слёп. Секрет, спасающий открытый цикл: оставить жёсткие проверки в качестве минимума, а затем добавить одну открытую инструкцию («удиви меня заголовком»). В результате исследование не может опуститься ниже заданного стандарта.
Иерархия автономности и эффект компаундирования
Не нужно строить всё с нуля. Существует лестница — от жёсткого контролируемого цикла до полностью автономного: простой цикл-оболочка, где вы сами — кнопка остановки; команда goal, где маленькая модель решает, когда готово; goal-tracking системы; "всегда включённые" агенты, которые не спят. Правило: выбирать наименее автономный инструмент, который справляется с задачей. Эффект компаундирования наступает, когда несколько циклов работают вместе: один отвечает на тикеты поддержки каждые 30 минут и пишет свои находки в общую папку, другой пишет контент, третий приоритизирует дорожную карту. Все они читают и пишут одни и те же файлы — то, что узнал один цикл, подхватывает другой. Один разработчик использует такую систему и выпускает 20–40 страниц в день без контроля.
Требования к кодовой базе и риски
Для работы циклов кодовая база должна быть готова к агентам: читаемой (чтобы агент мог найти, что менять), исполняемой (dev-сервер уже запущен) и верифицируемой (нужен способ доказать работу — например, браузерный тест, который записывает видео). Однако цикл не устраняет инженера из процесса: проверка остаётся на человеке; «готово» — это утверждение, а не доказательство; понимание проекта гниёт, если не читать то, что создал цикл; а самое опасное — привычка принимать результат как есть, без критической оценки.
📜 Transcript
en · 1 412 слов · 19 сегментов · clean
Показать текст транскрипта
Here is a story that sounds made up. An engineer types one sentence into clawed code and goes to make coffee. He comes back and 40 agents have spun up, written code, checked each other, and left him three pull requests to review. He did not write 40 prompts, he wrote one loop. And that one sentence, I wrote one loop, is quietly rewriting how the best engineers work with AI. It started with a single line. You should not be prompting your coding agents anymore. You should be designing the loops that prompt them for you. Then the head of Claude Code at Anthropic said it out loud. I do not prompt Claude anymore. I have loops running that prompt Claude and figure out what to do. My job is to write loops. In a single week of June 2026, it got a name, Loop Engineering, and a 12-page field guide that spread everywhere. For two years, the deal was simple. You write a prompt, you read what comes back, you write the next one. You are the tool, and your hand is on it the whole time. You were the loop. The thing standing between every step, reading the output, catching the mistake, deciding what happens next, telling it to try again. Loop engineering is stepping out of that inner cycle and up a level to designing the track the agent runs on. You build it once and let it poke the agents instead of you. Because strip away the jargon and a loop is just four moves on repeat. Discover the work, plan it, execute it, verify it, then repeat until a condition you set is actually true. And here is the part nobody tells you. A loop is a generator wired to a verifier. The generator was never the bottleneck. The verifier is. Hold that thought. Step back and look at the line this sits on. 2024. You wrote prompts. You were an operator. 2025. You ran several agents at once, a manager. 2026. You design the system that runs them, a system designer. Think of it as a stack. First the prompt, then the context, then the harness. Everything a single agent run gets. Loop engineering sits one floor above the harness. It is the outer system that runs the harness on a timer. At its simplest, a loop is almost dumb. Goal. Get the test suite passing. Loop. Run the tests. Read the failures. Fix the likely cause. Run again. Stop when everything is green or after six rounds. That is a real loop and it works. A loop that actually holds together needs five pieces and one place to remember things. The five pieces are what the agent uses. The memory is what keeps the whole thing from forgetting itself. First, automations. The heartbeat. Something fires on a schedule, does discovery and triage by itself, and drops what it finds into an inbox. This is what makes it a loop, and not just one run you did once. Second, worktrees. The moment you run two agents, their files start colliding. A git worktree gives each one its own checkout on its own branch, so one agent literally cannot touch the other one's work. Third, skills. A skill is your project knowledge written down once. The conventions, the build steps, the thing you only do this way because of that one incident. Without it, the loop re-derives your whole project from zero, every single cycle. Fourth, connectors. Built on MCP, they let the loop reach your real tools, the issue tracker, the database, Slack, Stripe. This is the difference between an agent that says here is the fix and a loop that opens the pull request itself. 5th, Sub-Agents. The single most useful move in a loop is splitting the one who writes from the one who checks. The model that wrote the code is far too kind grading its own homework. A second agent with different instructions catches what the first one talked itself into. And then the sixth thing, the memory. A markdown file, a linear board, anything that lives outside the single conversation and holds what is done and what is next. The agent forgets everything between runs, the repo does not, the memory is the spine. Now back to that thought. Every loop has two halves, a generator that produces work, that is the model, and models are now extremely good, and a verifier that judges whether the work is any good. For two years we obsessed over the generator, but in a loop the generator runs over and over for almost nothing. So watch what a weak verifier does. Make this landing page better. Keep going. No definition of better. It rewrites the hero eight times, each one different, none clearly better, and reports success. You just paid real money for motion without progress. That is the slop machine. Here is the mental flip. Writing a verifier is writing a reward function. You are not training the model. You are defining what good means. Your taste, your judgment, your sense of what correct looks like in your problem. That is the moat. The model is a commodity, which is why you never let an agent grade its own work. It always gives itself an A. So Claude Code's goal command hands the stop decision to a separate, faster model. The one that wrote the code is not the one that says it is done. That makes the real engineering decision clear. A closed loop pins success up front, checks every step and stops on command. Predictable, cheap, safe to leave alone. An open loop gets a goal and room to explore. That is where novel solutions live, but it burns tokens and slides into slop fast. And the trick that rescues the open loop? Keep your hard checks as the floor, then add one open instruction. Surprise me with the headline. Now you get exploration that simply cannot drop below your standard. The verifier is what makes either kind ship. You do not build the machinery from scratch. There is a clear ladder, from rigid to autonomous, a bare shell loop where you are the stop button, the goal command where a small model judges done, goal tracking setups, and always on agents that never sleep. The rule... Pick the least autonomous tool that does the job. Then it compounds. One loop answers support tickets every 30 minutes and logs what it learns into a shared folder. Another writes content. Another prioritizes the roadmap. They all read and write the same files so what one loop learns every other loop picks up. One builder runs this and ships 20-40 pages a day without watching. For any of it to work, the codebase has to be ready for agents. Legible, so it can find what to change. Executable, so the dev server is already up. And verifiable, give it a way to prove the work, like a browser test that records a clip you can actually watch. But the loop does not delete you from the work, and three problems get sharper, not easier. Verification is still on you. Done is a claim, not a proof. Your understanding rots if you stop reading what the loop made. And the comfortable move, just taking whatever it hands back, is the dangerous one. Is it just a buzzword? Honestly, partly, the term was coined to ride attention, and some of it repackages what agent builders already knew, so ignore the word and check the shift. Are you designing systems that run agents now instead of prompting them? Yes. Is defining done the scarce skill? Yes. The label is optional. The shift is not. And this is the part that matters most. Two people build the exact same loop and get opposite results. One uses it to move faster on work they understand deeply. The other uses it to avoid understanding the work at all. The loop does not know the difference. You do, so that is loop engineering. Stop prompting the agent. Design the loop that prompts it. Five pieces and a memory. a generator wired to a verifier, where the verifier is the whole game. Build it once and stay the engineer. If that finally made loop engineering click, subscribe! Cloud Codes takes apart one system like this every single week. Build. Solve. Deploy. And I will see you in the next one.
⚙️ Pipeline jobs
| Stage | Status | Att. | Updated | Error |
|---|---|---|---|---|
| download | done | 1/3 | 2026-07-20 12:04:28 | |
| transcribe | done | 1/3 | 2026-07-20 12:04:35 | |
| summarize | done | 1/3 | 2026-07-20 12:05:02 | |
| embed | done | 1/3 | 2026-07-20 12:05:04 |
📄 Описание YouTube
Показать
Prompt engineering is dead. The best software developers are no longer prompting AI models they are using Loop Engineering to design systems that run autonomous AI agents like Claude Code entirely in the background. In this video, Cloud Codes breaks down the system design of Loop Engineering. We explore why the era of manual AI prompting is over, and how to build autonomous agent loops using 5 core pillars: Automations, Worktrees, Skills, Connectors (MCP), and Sub-Agents. You will learn the critical difference between an AI "Generator" and an AI "Verifier," how to stop AI agents from hallucinating or generating "slop," and why defining the reward function is the new most valuable skill in tech. If you want to master AI system design and build products faster, subscribe to Cloud Codes for a new infrastructure breakdown every single week! Build, solve, deploy. ⏱️ Video Chapters (Crucial for Google Search Rich Snippets): 0:00 - Stop Prompting AI (The Hook) 1:45 - What is Loop Engineering? (The AI Agent Stack) 2:32 - The 5 Pillars of an Autonomous Loop 4:17 - Generators vs Verifiers (The Secret to AI Agents) 5:29 - Open Loops vs Closed Loops Explained 6:26 - How AI Loops Compound Your Workflow 7:06 - The Dangerous Catch of AI Automation 8:04 - The Final Verdict on Loop Engineering 🔗 Concepts & Sources Covered: Anthropic Claude Code Loop Engineering (System Design) Model Context Protocol (MCP Connectors) AI Agent Verification & Reward Functions Loop Engineering — By an Anthropic Engineer (12-Page PDF): https://drive.google.com/file/d/1tPgLYxn5ewHCnnU-12qcwhvjOjCAexQv/view #loopengineering #selfimprovingagents #aiagents #claudecode #softwareengineering #cloudcodes 👇 SUBSCRIBE & WATCH NEXT Subscribe for a new systems deep-dive every week: https://www.youtube.com/channel/UC0DZj1PNa_Fp0MU6uPSKv5w?sub_confirmation=1 📱 CONNECT WITH US Twitter/X: x.com/cloud_codes Join our developer community: discord.gg/HVnH9SY48 User Queries: what is loop engineering ai prompt engineering vs loop engineering how to use claude code loops how to build autonomous ai agents ai agent system design tutorial claude code coding agent workflow how to stop ai hallucination verifiers mcp connectors for ai agents is prompt engineering dead 2026 cloud codes ai architecture