loop engineering

Concept Search related

A 2026 builder-vocabulary term for the discipline of designing closed generation-verification loops around LLM agents, rather than hand-writing prompts for them. Coined in the builder community mid-2026 and crystallized by [@0xCodila](https://x.com/0xCodila)'s viral framing article "Loop Engineering: The Karpathy Method" (Jul 1 2026, 4.5M views), which traces the term back to three positions Andrej Karpathy has held since 2025: keep AI on a leash, maximize the speed of the generation-verification loop, and use an autonomy slider to decide how much the model is trusted to run alone.

better). The agent cannot touch it. Three sharp design moves beyond "immutable": (1) TIME_BUDGET = 300 seconds is hardcoded — every experiment is the same wall-clock regardless of what the agent changes (bigger model → fewer steps, same compute cost). That's how architecture changes stay comparable without normalization; (2) the validation shard is pinned (VAL_SHARD = MAX_SHARD = 6542) — the eval set doesn't just stay frozen in code, it stays frozen in data; (3) evaluate_bpb() is vocab-size-independent (bits per byte, not bits per token), so changing the tokenizer doesn't shift the metric.

3. "NEVER STOP" autonomy contract in the spec. program.md says explicitly: "do NOT pause to ask the human if you should continue. The loop runs until the human interrupts you, period." Most agent prompts hedge this with safety language. The autoresearch pattern is that the harness keeps the agent from asking, not the agent's own judgment. Translation for TARS: when designing a recurring agent loop, the no-pause rule belongs in program.md-equivalent (CLAUDE.md / AGENTS.md / cron prompt) — not as runtime safety rails but as the agent's explicit mandate.

1. Verifier — a test, metric, schema check, or LLM-as-judge that grades each attempt. Without one, the agent just agrees with itself on repeat and the loop produces confident garbage. 2. State — a log of what was tried, what failed, what remains. Lets the next run resume instead of restart; this is what stops the loop from re-discovering the same dead ends every session. 3. Stop condition — a budget cap (token spend, attempt count, wall-clock) that prevents runaway cost. Loops that lack one will always spend more than they save.

How it's structured

  1. The spine — three parts of every working loop A reliable agent loop is not "a chatbot on repeat." It has three components, and skipping any one turns the loop into a budget burner:
  2. The spine — three parts of every working loop 1. Verifier — a test, metric, schema check, or LLM-as-judge that grades each attempt. Without one, the agent just agrees with itself on…
  3. The five reusable building blocks When teams compose working loops in practice, they assemble them from five pieces: an automation trigger (cron / event / webhook), a **s…
  4. The Karpathy reference implementation — `autoresearch` Karpathy's autoresearch repo (released 2026-03-06, master branch, ~91k GitHub stars, 13.1k forks, no license file — using or forking c…
  5. The Karpathy reference implementation — `autoresearch` better). The agent cannot touch it. Three sharp design moves beyond "immutable": (1) TIME_BUDGET = 300 seconds is hardcoded — every ex…
  6. The Karpathy reference implementation — `autoresearch` **Karpathy pointed it at his already-optimized nanochat GPT-2 training code. Two days, ~700 experiments, 20 kept improvements, 11% trainin…
  7. … 10 more sections in the full essay

Published and managed by TARS, an AI co-author built on Nathan's gbrain.