loopkit
AGENTS.md756 starsChanged 5 months agoMITView on GitHub
This repo runs long-lived agent sessions. Every session shares one contract: Plan → Act → Verify, single-feature per session, clean state at the end. This file is the cross-agent voice (Claude Code, Cursor, Codex CLI, Gemini CLI, Amp). Claude-specific extras live in .claude/CLAUDE.md, which imports this file via @../AGENTS.md. Every session, in order: If IMPLEMENTATION_PLAN.md and the git log disagree, trust the git log. Git is append-only; the plan is rewritten each turn. One feature per session. Sessions that pack…
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository55 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- a11y-passSkill
- active-memory-reminderSkill
- adversarial-verifySkill
- authz-checkSkill
- bisect-regressionSkill
- broken-window-checkSkill
- changelog-from-diffSkill
- clean-commitsSkill
- context-budgetSkill
- contract-testSkill
- coverage-gapsSkill
- decision-recordSkill
- dependency-auditSkill
- design-systemSkill
- eval-harnessSkill
- evaluator-calibrationSkill
- feature-list-jsonSkill
- flaky-hunterSkill
- harness-strippingSkill
- hitl-escalateSkill
- init-script-contractSkill
- input-validationSkill
- kill-dead-codeSkill
- loading-empty-error-statesSkill
- migration-writerSkill
- model-routingSkill
- owasp-reviewSkill
- pdf-ingestionSkill
- planner-spec-expandSkill
- pr-from-diffSkill
- progress-reading-protocolSkill
- prompt-cachingSkill
- readme-auditSkill
- read-the-traceSkill
- rebase-safelySkill
- reduce-nestingSkill
- revert-surgicalSkill
- schema-diffSkill
- secret-scanSkill
- self-eval-biasSkill
- shift-notesSkill
- simplifySkill
- spec-firstSkill
- sprint-contractSkill
- sql-reviewSkill
- structured-outputSkill
- subagent-fanoutSkill
- suggest-next-featuresSkill
- systematic-debuggingSkill
- tool-restraintSkill
- using-loopkitSkill
- verification-before-completionSkill
- write-failing-test-firstSkill
- my-new-skillSkill
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Every session, in order:
- Very specific: line 13
Plan: Read PROMPT.md (goal), IMPLEMENTATION_PLAN.md (state), and git log --oneline -20 (history).
- Very specific: line 15
Verify: Run /verify (adversarial pass against the diff) BEFORE claiming done or committing.
- Very specific: line 17
If IMPLEMENTATION_PLAN.md and the git log disagree, trust the git log.
- Very specific: line 25
All code committed to git.
- Distinctive: line 26
No uncommitted changes in the working tree.
- Distinctive: line 49
Add a dependency without justifying it in the commit body.
- Very specific: line 50
Run npm update, pip install -U, or equivalents unless the feature is literally "upgrade dependencies".
- Very specific: line 63
When stuck, the agent runs hitl-escalate.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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.md — loopkit loop contract
This repo runs long-lived agent sessions. Every session shares one contract: Plan → Act → Verify, single-feature per session, clean state at the end.
This file is the cross-agent voice (Claude Code, Cursor, Codex CLI, Gemini CLI, Amp).
Claude-specific extras live in .claude/CLAUDE.md, which imports this file via @../AGENTS.md.
The three-step loop
Every session, in order:
- Plan. Read
PROMPT.md(goal),IMPLEMENTATION_PLAN.md(state), andgit log --oneline -20(history). If the last session claimed a feature done, smoke-test it before picking new work. - Act. Implement exactly one feature. Not two. Not "one and a small one".
- Verify. Run
/verify(adversarial pass against the diff) BEFORE claiming done or committing. Non-zero from/verifyblocks the commit.
If IMPLEMENTATION_PLAN.md and the git log disagree, trust the git log. Git is append-only; the plan is rewritten each turn.
Single-feature rule
One feature per session. Sessions that pack multiple features ship them all half-done — we have measured this. The next session takes the next feature. There is no reward for finishing more in one session; there is a real cost to leaving things half-done.
Clean-state contract (end of every session)
- All code committed to git. Prefer
scripts/committer "<msg>" <files>— it refuses.and empty messages. - No uncommitted changes in the working tree.
IMPLEMENTATION_PLAN.mdupdated: what was done, what is next, known open issues.- Dev server killed (
./stop.shif the project has one). - A feature is only "done" after end-to-end verification (
/verify), not after unit tests alone.
Skills vs rules
- Skills (
skills/*/SKILL.md) — invoked on demand by trigger phrases in theirdescription. Read the skill's SKILL.md before acting on a matching task. - Rules (
.claude/rules/*.md) — auto-loaded when a file path matches. Silent guardrails, not opt-in.
Full skill routing table: skills/using-loopkit/SKILL.md (repo layout) or .claude/skills/using-loopkit/SKILL.md (installed layout).
Slash-command entry points
/spec— writePROMPT.mdbefore implementing. Refuses to run ifPROMPT.mdexists without--force./verify— adversarial pass against the current diff. Non-zero exit blocks completion claims./loop— describe or run the Plan → Act → Verify cycle.
Never
- Weaken or delete a test to make red go green. If a test is wrong, fix the test in its own commit with justification.
- Mark work done without running
/verify. - Edit a merged migration. Migrations are additive-only.
- Add a dependency without justifying it in the commit body.
- Run
npm update,pip install -U, or equivalents unless the feature is literally "upgrade dependencies". - Push to
mainfrom an agent session. Humans push.
Verify before you commit
The maker's-head reviewer always agrees with itself. /verify is a separate, hostile pass. Every code change goes through it. See skills/adversarial-verify/SKILL.md for the 11 shortcuts that fake "done".
When user instructions and this file disagree
User instructions win. This file is the default when the user has not said otherwise.
Escalation
When stuck, the agent runs hitl-escalate. If no channel is configured, it writes BLOCKED.md and the loop exits with code 2. Human unblocks, deletes BLOCKED.md, restarts run.sh.
Model routing
run.sh reads CLAUDE_EXECUTOR_MODEL (per-turn workhorse call) and CLAUDE_JUDGE_MODEL (per-turn /verify call) as first-class knobs, plus CLAUDE_PLANNER_MODEL reserved for /spec. Unset = CLI default. See skills/model-routing/SKILL.md for the cheap-executor + frontier-judge shape.
Presets
The presets/ directory holds opinionated stacks — arrangements of the base skills for specific shipping cadences. Base loopkit stays a 49-skill floor that any preset can build on; the presets themselves are one arrangement of that floor, not replacements for it. presets/finn-loop/ is the first one to ship: async, human-gated (/spec → ACK → /build → /review → rocket-emoji merge signal), with Linear-MCP and Slack-webhook hooks that are OFF by default. Future presets on the roadmap: three-agent (planner + generator + evaluator, per Prithvi's harness-design work) and executor-judge (do → judge → do → judge).
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.

