loop.js
Loop-engineering framework: state a Goal, run judged Rounds until a read-only Verify agent settles it.
loop.js is an open-source TypeScript framework for goal-driven agent loops. You declare a goal and verification bar; the engine runs Execute → Handoff → Verify rounds with fresh context each round, disk-backed memory, typed usd/rounds/timeout guards, crash-safe resume, and optional cron (local OS schedulers or Modal). The shipped executor uses Anthropic's Claude Agent SDK. Status is v0.2 beta (npm `@loop.js/core` 0.2.0-beta as of the July 2026 launch window).
Official resources
Selection advice
Quick comparison
loop.js specializes in converging a declared goal under an independent Verify judge. LangGraph models general stateful graphs; OpenAI Agents SDK and Mastra are broader agent application SDKs.
| loop.js | LangGraph | OpenAI Agents SDK | |
|---|---|---|---|
| Best for | Autonomous loops that must stop only when a separate judge says done | Checkpointed graph workflows with rich branching and human-in-the-loop | OpenAI-first agents with tools, handoffs, and traces |
| Loop model | Goal + Execute + Verify rounds; worker never self-grades | Explicit graph nodes, edges, and durable state | Agent loop with tools and handoffs inside the SDK runtime |
| Runtime today | TypeScript/`@loop.js/core` on Claude Agent SDK; local or Modal cron | Python-first LangGraph with LangChain ecosystem options | Python and JS SDKs centered on OpenAI models and APIs |
| Tradeoff | Strong settle/budget semantics; beta API and Anthropic-first executor | Maximum workflow flexibility with more graph modeling cost | Fast OpenAI product path; less specialized goal–verify machinery |
Best for
- goal-driven loops with an independent Verify agent
- crash-safe, disk-backed rounds and typed spend/round guards
- scheduled maintenance loops via OS cron or Modal
- TypeScript teams already using Anthropic / Claude Agent SDK
Not ideal for
- teams that need a multi-provider executor today (Claude Agent SDK only at v0.2)
- complex branching workflows better modeled as general graphs
- projects that cannot accept a pre-1.0 beta API surface
Core concepts
Minimal implementation shape
Run `npm create @loop.js@latest my-loop`, set `ANTHROPIC_API_KEY`, edit `goal`/`verify` in the scaffold, then `npx loop run` until the Verify agent settles or a guard fires.