agents-that-run-for-days
Skill2 starsChanged 4 months agoMITView on GitHub
Karpathy field notes — agents that run for days: program.md control layer, constrained edit surface, fixed eval harness, keep/discard loops, overnight autonomy. Use when designing LoopForge overnight runs, autoresearch-style harnesses, or LOOPS.md field notes in any vpeetla-ai repo.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- aegis-gatewaySkill
- agentic-engineeringSkill
- agent-protocol-stack-2026Skill
- deploy-vercel-renderSkill
- enterprise-ai-architectSkill
- git-commit-authorSkill
- governed-ai-stackSkill
- grill-with-contextSkill
- hitl-side-effectsSkill
- honest-status-tableSkill
- langgraph-orchestrationSkill
- loop-engineeringSkill
- mcp-tool-exposureSkill
- portfolio-adrSkill
- production-observabilitySkill
- rag-governanceSkill
- repo-fix-prSkill
- setup-vpeetla-skillsSkill
- tdd-agent-loopsSkill
- vllm-inferenceSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Create docs/LOOPS.md or LOOPS.md at repo root when an agent should run overnight:
- Very specific: line 98
Skills: when same reminder twice → SKILL.md or LOOPS.md, not chat
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agents That Run for Days (LOOPS.md field notes)
Inspired by Andrej Karpathy's autoresearch and the shift from prompt engineering → loop engineering — agents that hypothesize, execute, measure, and iterate while you sleep.
North star
Remove yourself as the bottleneck on the inner loop. Stay the engineer on the outer loop (strategy, metrics, constraints, review).
The three-file contract (Karpathy pattern)
| File | Who owns | Role |
program.md / LOOPS.md | Human | Strategy — goals, constraints, loop protocol, what to never touch |
train.py / one mutable surface | Agent | Tactics — the only file (or tool scope) the agent may edit per round |
prepare.py / locked eval | Human | Measurement — scoring harness the agent cannot modify (prevents metric cheating) |
In vpeetla-ai repos, map this to:
| Karpathy | LoopForge | Content Factory | Enterprise RAG |
program.md | loops/*.yaml + harness config | AGENTS.md + pipeline spec | golden queries + eval gates |
| mutable file | train.py → repo patches / RAG config | draft nodes | retrieval strategy params |
| locked eval | pytest + review score | HITL + gateway | eval/metrics.py |
LOOPS.md template (field notes)
Create docs/LOOPS.md or LOOPS.md at repo root when an agent should run overnight:
# LOOPS — [Project name]
## Who this loop serves
- **User:** [role — e.g. platform engineer, content editor]
- **Job:** [one sentence outcome]
## Metric (one number)
- **Optimize:** [e.g. pytest pass rate, recall@5, review score]
- **Direction:** lower / higher is better
- **Floor:** never ship below [X]
## Mutable surface (agent MAY edit)
- [single file or bounded tool list]
## Locked (agent MUST NOT edit)
- eval harness, prepare.py, gateway rules, CI workflows
## Time budget per iteration
- [e.g. 5 min train, 3 min pytest, max 12 iter/hour]
## Loop protocol
1. Read state + memory hints
2. Hypothesize change
3. Apply to mutable surface only
4. Run locked eval
5. If improved → commit + lesson; else → revert
6. Repeat until budget exhausted or metric plateaus
## Stop conditions
- max iterations, cost cap, no improvement for N rounds, gateway block
## Learnings log
Append after each round: what worked, what failed, next hypothesis.Design rules (from field notes)
- One metric — one comparable number per iteration; fixed time budget makes runs comparable
- Constraint is the feature — narrow action space beats unlimited agent scope
- Markdown as programming —
program.md/LOOPS.mdis the control plane, not comments in code - Keep or discard — git commit on win,
git reseton loss (LoopForge: branch + PR, nevermain) - Babysit vs overnight — interactive tmux sessions for learning; unattended only with recovery + logs
- Gateway on side effects — publish, push, deploy still require AegisAI even in long loops
Map to vpeetla-ai stack
LOOPS.md (strategy) → Harness (scheduler, budget) → Agent (inner loop)
↓
Evaluate (pytest, golden, eval gates)
↓
Memory (lessons, RAG version tree)
↓
Observability (trace, Langfuse, OTLP)- LoopForge: ODAEU harness + repo-fix graph — closest to autoresearch in org
- Content Factory: HITL breaks unattended publish — by design
- Enterprise RAG: golden query regression = locked eval
- Skills: when same reminder twice → SKILL.md or LOOPS.md, not chat
Anti-patterns
- Agent edits eval metric or
prepare.pyequivalent - Unbounded scope ("improve the whole repo")
- Overnight run without trace export or iteration log
- Side effects without gateway in unattended mode
References
- karpathy/autoresearch — overnight ML experiments
- Org skill:
loop-engineering— ODAEU implementation - Org skill:
agentic-engineering— surgical diffs, verify before done - ADR-007 — protocol stack
- Karpathy: From Vibe Coding to Agentic Engineering
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

