Agent pack · MCP + skill

The agent loop library Claude Code can actually run.

Stop thrashing agents. This MCP server hands your agent 63 bounded, verifiable work loops — trigger, one change per round, the same verification every round, durable state, stop condition, budget, human gates — then picks the right one for your goal and renders a runnable protocol.

searchpickrun protocolstop with evidence

Value prop

Why this is an MCP server and not a docs search

Retrieval is not the hard part of agent loops. The hard part is judgment (which loop fits this goal?) and packaging (what exactly do I run, when do I stop, what counts as proof?). The two tools that matter do that work:

StepToolWhat you get
1. Pickpick_loop_for_goal(goal)Best-fit loop with why-this, plus 1–2 alternatives with why-not. Transparent keyword + category heuristic — documented, not magic.
2. Runrender_run_protocol(id, goal)Executable markdown: done contract, allowed actions, one-change-per-round rule, the same verification every round, a state-file skeleton (progress.md + state.json), stop conditions, budget, risk-colored approval boundary, proof format, and a paste-ready prompt.

What it is not for: open-ended vibe coding forever. Every loop in the library has a stop condition and a budget. If your task has no verifiable end state, this library will tell you that instead of pretending.

30 seconds

Install for Claude Code

One Python file, standard library only, Python 3.9+. Read-only: no write tools, no auth, no shell execution.

mkdir -p ~/.ai-loop-library
curl -fsSL https://ailooplibrary.com/mcp/server.py -o ~/.ai-loop-library/server.py
claude mcp add ai-loop-library -- python3 ~/.ai-loop-library/server.py

Verify before trusting it: run the offline self-test.

python3 ~/.ai-loop-library/server.py --self-test   # 21 checks, no network

Install for Cursor and other MCP clients

Add to ~/.cursor/mcp.json (or your client's MCP config). Point AI_LOOP_LIBRARY_CATALOG_PATH at a downloaded catalog.json to run fully offline.

{
  "mcpServers": {
    "ai-loop-library": {
      "command": "python3",
      "args": ["/Users/you/.ai-loop-library/server.py"],
      "env": {
        "AI_LOOP_LIBRARY_CATALOG_URL": "https://ailooplibrary.com/catalog.json"
      }
    }
  }
}

Use it without MCP

The pack degrades gracefully. Option one: install the Claude Code skill — it prefers MCP tools when connected and falls back to fetching the catalog over HTTPS.

mkdir -p .claude/skills/ai-loop-library
curl -fsSL https://ailooplibrary.com/agent-pack/claude-code/SKILL.md \
  -o .claude/skills/ai-loop-library/SKILL.md

Option two: zero install. The catalog is public JSON; paste this into any tool-using agent.

Fetch https://ailooplibrary.com/catalog.json, pick the loop that fits this goal, and run it
bounded: one change per round, the same verification every round, state in
docs/loops/<id>/, stop on verifier pass / budget / blocker / approval boundary.

There is also a short drop-in for a project CLAUDE.md, and every loop page has a paste-ready run prompt under “Run in Claude Code.”

Full install guide CLAUDE.md drop-in

Tool reference

ToolArgumentsReturns
search_loopsquery, category?, limit?=8Ranked loops with id, title, category, url, one-line why-matched
get_loopid_or_slugFull loop spec + canonical URL + run fields
pick_loop_for_goalgoal, constraints?, limit?=3Top recommendation with why-this + alternatives with why-not
render_run_protocolid_or_slug, goal?, risk_posture?=default|strictExecutable markdown protocol + state-file skeleton + paste-ready prompt
list_categoriesCategory counts with library filter URLs
catalog_statsLoop count, featured loops, last_updated, catalog source

Resources: ailooplibrary://catalog and ailooplibrary://loop/{id}. Full server docs at /mcp/README.md.

Demo

What picking looks like

Ask for an outcome, get a loop with reasons — then render it and go.

> pick_loop_for_goal("speed up CI")

{
  "goal": "speed up CI",
  "recommendation": {
    "id": "ci-optimization",
    "title": "CI Optimization",
    "category": "Engineering",
    "url": "https://ailooplibrary.com/loops/ci-optimization/",
    "why_this": "title matches ci; tags matches ci; use when matches ci; summary matches ci"
  },
  "next_step": "Call render_run_protocol(id_or_slug='ci-optimization', goal='speed up CI') to get the executable protocol.",
  "method": "transparent heuristic: weighted keyword overlap + goal-term-to-category mapping + spec-completeness bonus. Not a model ranking."
}

The heuristic is documented in the server source (keyword overlap, goal-term-to-category map, spec-completeness bonus) and labels itself in every response. When it is unsure, it says so and points at the library instead of bluffing.

What's in the library

63bounded loop patterns
10categories
21engineering loops
7Paul originals

Every loop ships with a trigger, objective, allowed actions, verification, stop condition, budget, and approval boundary — the seven parts that keep an agent from spending your tokens looking busy.

Browse the library Loop template Loop engineering