loop.js logo

loop.js

Loop-engineering framework: state a Goal, run judged Rounds until a read-only Verify agent settles it.

Open source

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).

Selection advice

Choose loop.js when “done” must be judged by a separate agent and the loop may outlive a single terminal session. Choose LangGraph for general graph orchestration, or OpenAI Agents SDK / Mastra when you need a broader multi-agent application SDK rather than settle-focused loop engineering.

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.jsLangGraphOpenAI Agents SDK
Best forAutonomous loops that must stop only when a separate judge says doneCheckpointed graph workflows with rich branching and human-in-the-loopOpenAI-first agents with tools, handoffs, and traces
Loop modelGoal + Execute + Verify rounds; worker never self-gradesExplicit graph nodes, edges, and durable stateAgent loop with tools and handoffs inside the SDK runtime
Runtime todayTypeScript/`@loop.js/core` on Claude Agent SDK; local or Modal cronPython-first LangGraph with LangChain ecosystem optionsPython and JS SDKs centered on OpenAI models and APIs
TradeoffStrong settle/budget semantics; beta API and Anthropic-first executorMaximum workflow flexibility with more graph modeling costFast 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

loop engineeringGoal / Execute / VerifyRoundindependent Verify agentdisk-backed handoff memoryusd / rounds / timeout guardsLock and crash-safe resumeloop cron (local or Modal)

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.

Sources