Glean 拾遗
Recent picks

15picks · chronological

07-23

From Loop to Graph: The Real Shift in AI Agent Improvement

This essay explores the shift from single-loop optimization to graph-structured improvement in AI agent engineering. It dissects four failure modes of single loops: Goodhart's law, blindness to target correctness, conflict among loops, and measurement decay. Mature systems employ graphs of loops—champion-challenger, drift monitoring, rollback, and audit loops—each watching and constraining others. But graphs alone fail without anchors: measures that touch reality, frozen rules, and human judgment on what 'better' means. The key is groundedness, not topology. For AI engineers, MLOps practitioners, and agent designers.

07-21

How to Build the Loops That Just Replaced Entire Prompt Engineering

The era of crafting better prompts to improve AI agents is quietly ending. Top engineers now build 'loops'—systems where agents plan, execute, verify, and iterate without human intervention. Using Karpathy's overnight 700-experiment run that found 20 optimizations as a case study, the article breaks down loop architecture: automation heartbeat, skill files (project context), sub-agents (writer vs reviewer), connectors, and a verifier gate. It warns against Ralph Wiggum loops (premature exit) and comprehension debt (accumulated unread code). Practical advice: start with one boring recurring task, verify manually before scheduling, measure cost per accepted change. Essential for engineers building production agent workflows.

x.com · 9 min · Agents · AI Engineering · LLM
07-15

How to Create Loops with Claude

This article advocates shifting from writing single prompts to designing loops—automated systems that keep AI agents working without human intervention. It breaks down a loop into six components: automation triggers, git worktrees for parallel isolation, skills (procedure manuals), connectors, sub-agents, and persistent memory files (e.g., STATE.md). The evaluator-optimizer pattern is highlighted: one agent generates, another verifies against objective gates like test suites or type checkers. Stop conditions must be checkable by external signals, not the agent's own claim. An autonomy ladder (suggest, draft, apply low-risk, full auto) helps gradually earn trust. The article also warns about token costs and the need for command allowlists in unattended loops.

x.com · 10 min · Agent Architecture · AI Engineering · Claude Code
07-10

Build self-improving agent system with Fable 5 in 14 steps : loops, dynamic workflows, routines

This article provides a detailed 14-step roadmap for building a self-improving agent system using Claude Fable 5. It moves Fable 5 from a prompt-and-close tool to a compounding system: using /goal and Outcomes for self-correcting loops, independent verifier sub-agents over self-critique, state files (STATE.md) and Skills for cross-session memory, and Dynamic Workflows and Routines for long-running autonomy. It includes a cost-capability matrix (Fable 5 for orchestration, Sonnet 4.6 for workers, Haiku 4.5 for graders) and guidance on handling the Mythos safety boundary. Suitable for AI engineers and system designers aiming to leverage Fable 5's days-long autonomous capability.

x.com · 28 min · Agent Engineering · Agents · AI Engineering
07-10

Getting started with loops in Claude Code

The Claude Code team defines four loop patterns (turn-based, goal-based, time-based, proactive) with trigger, stop criteria, use cases, and token management tips. Concrete commands like /goal, /loop, /schedule and a SKILL.md example show how to make agents iterate, self-verify, and compose primitives into automated workflows. A practical guide for developers exploring agent engineering.

07-08

Loop Patterns in Claude Code: A Practical Guide

The Claude Code team's official blog post introduces four loop modes: turn-based, goal-based, time-based, and proactive loops. It covers how each is triggered, stopped, and when to use them, along with token management and code quality tips. Practical CLI commands and SKILL.md examples are provided. The article emphasizes starting simple and gradually automating repetitive tasks. Essential reading for engineers using or evaluating Claude Code for autonomous development.

x.com · 9 min · Agents · AI Engineering · Ai Tooling
07-07

Agent harness engineering with Claude: 14-step roadmap from one agent to a self-improving system

This article presents a 14-step roadmap for building an Agent harness with Claude, from a single agent to a self-improving system. The author argues that the harness — comprising model, tools, permissions, and initial context — is the foundation for any loop, and a weak harness leads to slop. It covers concrete practices: file structure (.claude/), CLAUDE.md for standing facts, settings.json for permission pre-approvals, subagents for isolated contexts, skills for reusable procedures, hooks for deterministic enforcement, and memory for cross-session learning. The final steps add loops and dynamic workflows, closing the feedback loop where output → lessons → skills → better output. The article targets engineers who run or plan to run multi-agent code generation systems.

07-05

Loop Engineering: What Comes After the Loop

This article argues that naive agent loops relying on LLMs for autonomous decision-making have hit four fundamental walls: plans that rot in the context window, unbounded retries (no distinction between hard and impossible), self-written tests that pass wrong answers (maker-votes-checker), and actions that cannot be replayed. The author demonstrates with runnable code: the same model in a naive loop returns 747 (ground truth 615) with SUCCESS, while a graph harness with a verifier gate returns exactly 615, rejecting 12 corrupted outputs and absorbing 51 tool errors with fewer calls. Four properties fill these walls: explicit dependencies (plan as static graph, not remembered text), bounded recovery (fixed staircase: retry→patch→replan), immutable append-only log (hash-chained, replayable for audit), and a verifier gate (output must pass an independent check node, maker cannot talk past). The twist: frontier frameworks now have the model itself draw the graph of what to do (Anthropic dynamic workflows), while durable state, logging, and verification are infrastructure, not reasoning, and are used even by minimalists. The honest brake: most loops today don't need a graph yet—pick the one wall that cost you this week and close it with a single property.

07-01

Getting started with loops

This article is an official engineering guide from Claude Code that systematically lays out four agentic loop patterns and their use cases. Turn-based loops are for short exploratory tasks; users encode manual verification steps into SKILL.md — e.g., asking Claude to start a dev server, take screenshots, and check the browser console. Goal-based loops, triggered by /goal, define deterministic termination criteria such as 'get the Lighthouse score to 90 or above' and force iteration until the target is met. Time-based loops come in two flavors: /loop for local polling on an interval and /schedule for cloud-triggered routines, ideal for recurring work like PR review or CI fixups. Proactive loops combine /schedule, /goal, dynamic workflows, and auto mode into a pipeline for long-running, well-defined streams of work. The article also covers code quality maintenance and token usage management: encoding conventions, using scripts instead of re-reasoning, routing routine work to cheaper models, and monitoring cost with /usage. Suitable for engineers embedding Claude Code into daily dev workflows.

claude.com · 8 min · Agent Engineering · Claude Code · Context Engineering
06-28

Loop Engineering: When Prompting Takes a Back Seat to the System

This article, inspired by Claude Code creator Boris Cherny, argues that the center of gravity in agent development has shifted from prompt engineering to loop engineering. It unpacks the trivial core loop and identifies four hard problems: knowing when to stop (distinguishing tool-call cessation from task completion), maintaining context hygiene to avoid decay, designing tools that agents can actually use (idempotent writes, error messages for LLMs), and embedding a critic in the loop to prevent self-agreement. The piece underscores that the model is commoditized; the loop—the harness—is where real engineering value lies. A must-read for engineers building autonomous agent systems.

06-27

Stop Being the Loop: How to Make Claude Work While You Sleep

Boris Cherny, who built Claude Code at Anthropic, no longer writes prompts by hand—he writes loops. This guide explains what a real loop is: a small system that runs Claude repeatedly until a job is done, complete with self-checking, state persistence, and automatic stopping. Unlike cron jobs, loops contain a decision-maker (Claude) that can adapt mid-stream. The article covers Claude Code's /goal (loop until done) and /loop (repeat on a schedule) commands, and provides a paste-ready charter template with sections for goals, work sources, work instructions, self-verification, memory, and stop conditions. Ideal for engineers transitioning from prompting to building persistent, autonomous AI workflows.

06-26

Human in the /loop

The author shares a practical workflow for coding with AI agents: define a verifiable 'definition of done' (model eval score, QA pass, green tests, performance benchmark), wrap it in a loop for the agent to iterate autonomously, and get notified via Slack when a decision is needed or the task completes. Loops run in the cloud, not on the local machine. The author runs 3-5 long loops concurrently plus shorter tasks. For engineers looking to level up from one-shot agent interactions to long-running autonomous optimization tasks.

06-26

Loop Engineering for Beginners: From Concept to Minimal Loop

This article is a beginner-friendly tutorial that demystifies Loop Engineering: it's not a buzzword but a structured framework for human-AI collaboration, formalizing repetitive actions like goal-setting, stepwise execution, quality checks, feedback loops, and stop conditions. It clearly distinguishes between ordinary prompting (one-shot) and looping (sustained closure), then walks through a minimal viable example—building a personal knowledge base using the LLM Wiki approach. The author stresses that the 'check' step is the heart of any loop, and that without inspection criteria, automation just generates garbage. It also warns against common beginner mistakes such as mistaking long prompts for loops, overly ambitious goals, vague standards, lack of human sign-off, and granting excessive permissions. The article is instructional rather than deep, but it provides a ready-to-use template and the seven-element checklist (goal, input, execute, check, feedback, record, stop). It's best suited for engineers new to agentic workflows who want a structured starting point.

x.com · 7 min · Agent Workflow · Beginner Tutorial · LLM Wiki
06-26

Loop engineering: the 14-step roadmap from prompter to loop designer

This post from @0xCodez on X provides a comprehensive 14-step roadmap for transitioning from manual prompting to designing autonomous loop systems in AI-assisted coding. Based on Anthropic engineering docs, Addy Osmani's essay, and recent studies, it's structured in three tiers: first, a 4-condition test to decide if a loop is warranted; second, five building blocks (automations, worktrees, skills, connectors via MCP, sub-agents with maker-checker split); third, building the minimal viable loop and avoiding failure modes like the 'Ralph Wiggum loop', comprehension debt, and security tax. The author emphasizes that loops are not universal—they only earn their cost when tasks repeat, verification is automated, the token budget can absorb waste, and the agent has senior engineer tools. Ideal for engineers already using coding agents who want to orchestrate them into batched, automated workflows.

x.com · 23 min · Agents · AI Engineering · Ai Tooling
06-23

How To Use Loop Engineering To Build A Self-Improving Quant Trading System

Written by a backend developer working on quant trading systems, this article argues for moving beyond manual prompt-and-wait workflows to building self-running loops. It dissects six universal components of production loops: automation hooks, skill files (SKILL.md), state files (STATE.md), a separate verifier agent, Git worktrees for isolation, and MCP-based connectors. The author then wires these around the five-stage quant trading cycle (data ingestion, signal generation, verification, execution, risk monitoring), with a feedback mechanism that writes lessons back into the skill file for continuous improvement. Targeted at engineers building AI-driven or automated systems, especially in finance.

x.com · 13 min · Agents · Claude Code · Loop Engineering