MartinLoop

MartinLoop is an open-source governance and orchestration harness designed to manage autonomous AI coding workflows. Rather than acting as a standalone AI coding agent or IDE, it wraps existing agents and models with runtime guardrails, strict budget limits, automated verification gates, and auditable run receipts. In daily operations, developers execute runs through a terminal CLI command (such as `martin run`) or integrate it into IDEs and CI/CD pipelines. Users define tasks, timeboxes, strict spend caps, and verification commands (for example, pointing to a test runner like `pnpm test`). MartinLoop then orchestrates the underlying model or agent—including Claude, Codex, Gemini, OpenHands, or open-source LLMs—evaluating policies, monitoring step-by-step actions, and recording failure taxonomies and telemetry in structured JSONL output. What distinguishes MartinLoop from typical agent frameworks is its explicit focus on cost governance and verifiable completion. Unbounded retry loops are halted when budget ceilings are reached or when repetitive failures occur. An agent cannot declare a task finished without satisfying an independent verifier gate and generating an immutable run receipt detailing commits, diffs, reversibility data, and exact spend. MartinLoop's core CLI and orchestration layer is licensed under the Apache License 2.0 and available at no cost via npm. Enterprise extensions such as MartinLoop360 and HeadlessOS offer additional features including OPA-backed policy-as-code evaluation, business context compilation, and team dashboards.

Tags: agent harness, cli, coding agent, developer tools, OpenSource

Visit MartinLoop

Key features

  • Strict budget caps — Enforces hard dollar and token limits on agent runs to prevent runaway spending from unbounded retry loops. - Independent verifier gates — Requires execution against explicit test suites or verification commands before an agent can claim a task is complete. - Immutable closure receipts — Generates comprehensive run dossiers and JSONL logs tracking inputs, diffs, commits, costs, and rollback data. - Vendor-neutral model support — Operates across major foundation models and agents including Claude, Codex, Gemini, OpenHands, and open-source LLMs. - Failure classification & stop rules — Categorizes loop failure modes and applies deterministic exit policies rather than blindly retrying failed prompts. - Enterprise orchestration options — Supports extended modules (MartinLoop360 and HeadlessOS) for OPA policy enforcement, parallel job queues, and context compilation.

Use cases

Use Case: Capping Autonomous Bug Fix Costs A developer sets an agent to resolve a flaky CI test while enforcing a strict financial cap (e.g., --budget 3). MartinLoop prevents the agent from entering infinite retry loops, halting execution immediately if the spend limit is reached and producing a detailed log of all attempted changes.

Use Case: Verifiable CI/CD Pipeline Automation Platform teams integrate MartinLoop into continuous integration workflows to ensure automated PR generation satisfies real test suites (--verify pnpm test). The agent is blocked from submitting pull requests or claiming closure unless the verification gate passes with clear exit codes and diff artifacts.

Use Case: Auditable Multi-Model Team Orchestration Engineering organizations running multiple coding agents enforce shared spend and policy guardrails across different teams and models. Engineering and finance review identical run receipts and cost-per-verified-outcome metrics directly from CLI logs or the centralized dashboard.

Who it is for

MartinLoop is built for platform engineers, engineering leads, and developers running autonomous agent loops in terminal and CI environments who need to control API costs and verify agent output. It is less suited for individual developers looking for a simple autocomplete chat extension without autonomous execution or governance requirements.

Install guide

Installation Install MartinLoop globally using npm: bash npm install -g martin-loop

First Run Ensure your target model API keys (e.g., ANTHROPIC_API_KEY, OPENAI_API_KEY, or GEMINI_API_KEY) are exported in your terminal environment, then check the installation: bash martin --version

Example Session Execute a governed run specifying a task description, a maximum budget in dollars, and a verification test command: bash martin run "fix flaky CI" --budget 3 --verify "pnpm test" MartinLoop will initialize the run contract, execute the task against your configured model, validate the changes with your test runner, and output a JSONL run receipt detailing the final cost and exit status.

Part of CLI Coding Agents

Categories: AI Coding Agents, Code Assistants, Developer Tools

Related CLI agents

  • SWE-agent — SWE-agent is an open-source autonomous software engineering agent harness built and maintained by researchers from Princeton University and Stanford University.…
  • Weaver — Weaver is an open-source agent harness and orchestration framework maintained by sean35mm on GitHub. Built on top of the Bun…
  • Hivelore — Hivelore is an open-source agent harness and contextual memory orchestrator created by Doucs91. It provides persistent project memory, decision tracking,…
  • Context Bridge — Context Bridge is an open-source CLI agent harness and context orchestration utility developed by serdardb. It is built to facilitate…
  • Vibe Kanban — Vibe Kanban, originally developed by Bloop AI, is an open-source orchestration harness and visual task board designed to manage and…
  • Parallel Harness Pets — Parallel Harness Pets (parallel-harness-pets) is an open-source companion tool and harness plugin created by TevvvB. It is designed for developers…
  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories