← Back to Discover

MartinLoop

Open-source command-line layer that puts budget caps, test checks and signed run receipts around AI coding agent runs, so each run has a clear stop condition.

Coding agentsCommand-line tools

What it does

MartinLoop wraps an AI coding run in an explicit contract: an objective, a verifier command, a budget, allowed and denied paths, and a stop condition. Every run is written to local records so it can be inspected afterwards. It is used from the command line with npx. You give it a task, a check such as npm test, and a cap in dollars, tokens or iterations. It works through adapters for Claude CLI, Codex CLI, Gemini CLI and direct providers, and it stops before an attempt would exceed the limit. Policy checks block unsafe verifier commands, risky path changes and secret-like task inputs before anything runs. After a run it can produce a receipt with the task, spend, budget, verifier result and an integrity verdict, and package it as a redacted JSON receipt, a Markdown recap and a proof-card image to hand to someone else. The project also ships an MCP package, a TypeScript SDK and public benchmark suites. It is released under Apache-2.0.

Capabilities

  • Budget caps on USD, tokens or iterations that stop the next attempt before it overspends
  • Verifier gates: a real check such as npm test must pass before a run counts as complete
  • Policy checks for unsafe verifier commands, risky paths and secret-like inputs
  • Run receipts with stop reason, verifier evidence, budget and an integrity verdict
  • Adapters for Claude CLI, Codex CLI, Gemini CLI and direct providers
  • MCP package and TypeScript SDK

When to use it

  • A coding agent retries on its own and you want a hard spending limit
  • You want evidence that tests passed before accepting an agent's changes
  • You need a reviewable record of what an agent run did and cost
  • You want to restrict which paths an agent run may write to