Claude Loop Engineering: Structured Agent Loops for Autonomous Overnight Runs

X postMr. BuzzoniResource

Mr. Buzzoni (@polydao) outlines a file-based harness and directory architecture for Claude Code that enables AI agents to execute overnight tasks autonomously. Using clear contracts, verification rubrics, state tracking, and documented receipts, the setup is designed to run predictably without manual night-time interventions.

Key points

  1. Contract-driven rules: CONTRACT.md defines shift guidelines committed to the repository, while contract.local.md holds personal git-ignored overrides.
  2. Loop harness in .claude/loops/: settings.json sets spend limits and timeouts, schedule.yml defines execution triggers, act.sh performs actions, and rubrics/ (code.md, writing.md, safety.md) gate reviews.
  3. Disk-based state persistence: checkpoint.json tracks progress across runs, trace.log details actions step by step, and receipts/ archives dated run outputs for human review.
  4. Safety boundaries: .mcp.json enforces an allowlist of accessible tools, complemented by a fallback abort script (kill.sh).
  5. Principles of loop engineering: Shifts developer effort from manual conversational prompting to engineering trigger-work-gate-state-stop controller systems.

Why it matters

Unattended agent workflows often stall or run up unexpected costs without strict guardrails. Treating agent loops as stateful, gated controllers with hard financial caps and strict tool allowlists provides a reproducible blueprint for automated development tasks.

Analysis

Buzzoni's methodology aligns with 'loop engineering' concepts described by Andrej Karpathy, Boris Cherny, and Peter Steinberger. The core insight is separating prompt instructions from control mechanisms. Rather than trusting the model to grade its own output, independent verification rubrics and objective checks (such as linters and test suites) govern merges, transforming the developer's role from reactive troubleshooting to scheduled morning reviews.

Original post

Mr. Buzzoni

@polydao · 10 September 2026

I HAVEN'T OPENED CLAUDE AT MIDNIGHT SINCE I BUILT THIS FOLDER I used to wake up, check what broke overnight, fix it by hand -> now I wake up and the receipts are already sitting there, dated, graded, waiting on my review here's what's actually inside the folder that replaced t.co/Y3UiBwqBxG t.co/yrQwx1govh

238 likes18 replies373 bookmarks29.7k views

View on X
Selected replies (5)
  • @rewind02 @polydao 5,382 receipts and i can't find yesterday's notes
  • @Av1dlive @polydao thanks for sharing this buzzoni
  • @EgorJioo @polydao keeping receipts and checkpoints makes each overnight shift recoverable review can improve the rules from evidence instead of memory
  • @BlockBiker @polydao What sells me is the receipts folder. 8 months, 5,382 receipts, 0 incidents, t.co/Mb2JGYHLAk never used. I'd back that over any agent demo. Has a loop ever come close to needing it?
  • @MoneyCrptBunny @polydao Automating the review step is where most people overlook serious time savings

Links and tools from this entry

Summary generated by AI (Gemini 3.8 Flash, 27 September 2026). It may contain errors – the original source is authoritative.

Similar in content, found by the AI search.

  • X post:Vox

    Claude Code: Using a Dedicated Subagent for Visual Project Maps During Overnight Runs

    Vox (@Voxyz_ai) outlines a prompt workflow for Opus 5.5 in Claude Code that configures a dedicated subagent called 'project-map'. The agent runs in the background and maintains an interactive HTML dashboard showing progress and blockers during long autonomous coding sessions.

    3.6kbookmarks115.6kviews

    AI & LLMs· Tutorial

  • X post:vartekx

    Context Engineering: Moving Beyond Prompts to Continuous Agent Loops

    In an X post and guide, vartekx examines the shift from prompt engineering to context and loop engineering. Drawing on frameworks by Andrej Karpathy and Boris Cherny as well as an Anthropic engineer demo, the author details how disciplined context management powers persistent, self-healing AI agents.

    59bookmarks6.5kviews

    AI & LLMs· Resource

  • X post:rari

    Harness Engineering: Building Resilient Environments for Multi-Agent Systems

    A guide and workshop by rari explores the discipline of harness engineering for AI agents. When agents fail, the issue is rarely model weights or prompts, but an underspecified operating environment. Drawing on the Claude Agent SDK and references from Anthropic and OpenAI, the author explains how to design external state, tooling, sensors, and execution loops.

    2kbookmarks142.2kviews

    AI & LLMs· Resource

  • X post:Mr. Buzzoni

    Append-Only Knowledge Graph Architecture for Multi-Agent Systems

    Mr. Buzzoni (@polydao) outlines an append-only graph engineering architecture where dedicated agents extract and connect claims without updating existing rows. Using daily sealed log files, DuckDB, and human approval for merges, the system preserves complete auditability.

    1.1kbookmarks75.8kviews

    AI & LLMs· Opinion

  • X post:seeco

    Agent Architecture: Claude as an Org Chart and Dynamic Workflows

    Developer seeco outlines an architecture dividing Claude skills into real-world departments such as development, design, finance, and legal. A linked guide details Dynamic Workflows in Claude Code, where the model generates its own JavaScript execution harnesses on the fly.

    1.1kbookmarks117.8kviews

    AI & LLMs· Resource

Let's talk about your project

Locations

  • Mattersburg
    Johann Nepomuk Bergerstraße 7/2/14
    7210 Mattersburg, Austria
  • Vienna
    Ungargasse 64-66/3/404
    1030 Wien, Austria

Parts of this content were created with the assistance of AI.