<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/inner-loops-in-practice-fresh-contexts-output-discipline-and-day-1-loops-jlerqynys" -->

---
title: Inner Loops in Practice: Fresh Contexts, Output...
description: An agent loop can run faster and cheaper than one vibe prompt if each pass is built right. In the author's Cosmic Conquest benchmark, the harnessed loop ran 3...
canonical: https://daily.dev/posts/inner-loops-in-practice-fresh-contexts-output-discipline-and-day-1-loops-jlerqynys
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Inner Loops in Practice: Fresh Contexts, Output Discipline, and Day-1 Loops | daily.dev
og:description: An agent loop can run faster and cheaper than one vibe prompt if each pass is built right. In the author's Cosmic Conquest benchmark, the harnessed loop ran 3...
og:url: https://daily.dev/posts/inner-loops-in-practice-fresh-contexts-output-discipline-and-day-1-loops-jlerqynys
og:image: https://api.daily.dev/og/posts/jleRqyNyS.png
og:image:alt: Inner Loops in Practice: Fresh Contexts, Output Discipline, and Day-1 Loops
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Inner Loops in Practice: Fresh Contexts, Output Discipline, and Day-1 Loops

**[DEV](https://daily.dev/sources/devto)** · 18 min read · 0 upvotes · 0 comments

## Summary

An agent loop can run faster and cheaper than one vibe prompt if each pass is built right. In the author's Cosmic Conquest benchmark, the harnessed loop ran 3 to 4 times faster, used about 80% fewer tokens and cost about 85% less. Three mechanics do it. Each iteration gets a fresh subagent context. A LIVING_MEMORY.md ledger adds about 200 tokens per failed turn. Output discipline keeps code in files and turn summaries to 150 to 250 words, cutting output tokens nearly 20x. Day-one setups range from Antigravity slash commands to the loopy skill to a Markdown loop protocol in GEMINI.md.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://dev.to/gde/inner-loops-in-practice-fresh-contexts-output-discipline-and-day-1-loops-416d>

## Questions this post answers

### How can a multi-turn AI agent loop use fewer tokens than a single prompt?

Give each iteration a fresh, short-lived subagent with only the spec slice, current files and latest failure receipt. Keep a compact ledger, about 200 tokens per failed turn, instead of raw tracebacks. Forbid pasting code into chat and cap summaries at 150 to 250 words. This cut output tokens nearly 20x in the author's benchmark.

_Developers tuning agent loops follow harness engineering on daily.dev._

### What should a LIVING_MEMORY.md file contain for an AI coding agent loop?

Each failed turn appends what changed, the verifier output, the root cause, an explicit 'Do NOT Repeat' guardrail and the next hypothesis. That is roughly 200 tokens of distilled signal. The next fresh subagent reads these lines instead of thousands of tokens of logs, so token usage stays flat across five or more iterations.

_If you're building agent workflows, daily.dev surfaces patterns like this as they emerge._

## Similar posts on daily.dev

- [Stop Prompting. Design the Loop.](https://daily.dev/posts/stop-prompting-design-the-loop--zomwvtp2n) · Pulumi · 3 upvotes · 0 comments
- [Improving Deep Agents with harness engineering](https://daily.dev/posts/improving-deep-agents-with-harness-engineering-kklyrkjxl) · LangChain · 10 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#spec-driven-development](https://daily.dev/tags/spec-driven-development), [#google-antigravity](https://daily.dev/tags/google-antigravity)

[View this post on daily.dev](https://daily.dev/posts/inner-loops-in-practice-fresh-contexts-output-discipline-and-day-1-loops-jlerqynys)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Inner Loops in Practice: Fresh Contexts, Output Discipline, and Day-1 Loops","url":"https://daily.dev/posts/inner-loops-in-practice-fresh-contexts-output-discipline-and-day-1-loops-jlerqynys","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/inner-loops-in-practice-fresh-contexts-output-discipline-and-day-1-loops-jlerqynys"},"datePublished":"2026-11-30T23:30:51.933Z","dateModified":"2026-11-30T23:31:16.944Z","description":"An agent loop can run faster and cheaper than one vibe prompt if each pass is built right. In the author's Cosmic Conquest benchmark, the harnessed loop ran 3...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/34051f1adce74946095944a5c3606742?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/34051f1adce74946095944a5c3606742?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"DEV","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DEV","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/devto","url":"https://daily.dev/sources/devto"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/inner-loops-in-practice-fresh-contexts-output-discipline-and-day-1-loops-jlerqynys","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,spec-driven-development,google-antigravity","timeRequired":"PT18M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DEV","item":"https://daily.dev/sources/devto"},{"@type":"ListItem","position":3,"name":"Inner Loops in Practice: Fresh Contexts, Output Discipline, and Day-1 Loops"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/inner-loops-in-practice-fresh-contexts-output-discipline-and-day-1-loops-jlerqynys#faq","mainEntity":[{"@type":"Question","name":"How can a multi-turn AI agent loop use fewer tokens than a single prompt?","acceptedAnswer":{"@type":"Answer","text":"Give each iteration a fresh, short-lived subagent with only the spec slice, current files and latest failure receipt. Keep a compact ledger, about 200 tokens per failed turn, instead of raw tracebacks. Forbid pasting code into chat and cap summaries at 150 to 250 words. This cut output tokens nearly 20x in the author's benchmark. Developers tuning agent loops follow harness engineering on daily.dev."}},{"@type":"Question","name":"What should a LIVING_MEMORY.md file contain for an AI coding agent loop?","acceptedAnswer":{"@type":"Answer","text":"Each failed turn appends what changed, the verifier output, the root cause, an explicit 'Do NOT Repeat' guardrail and the next hypothesis. That is roughly 200 tokens of distilled signal. The next fresh subagent reads these lines instead of thousands of tokens of logs, so token usage stays flat across five or more iterations. If you're building agent workflows, daily.dev surfaces patterns like this as they emerge."}}]}
```

