Keesan12/martin-loop
Run coding agents without babysitting them. Keep jobs focused, bounded, checked and accountable from start to finish. Finally run your agents swarms overnight and get your time back.
MartinLoop — A Governed Run Manager for Coding Agents
MartinLoop is a tool that lets you hand real software tasks to AI coding agents (like Codex, Claude Code, or Gemini CLI) without having to supervise every step. It wraps the agent's work with clear boundaries, limits, verification, and a final verdict — so you can trust the agent to work independently while still keeping the job under control.
What Problem Does It Solve?
Coding agents can write a lot of code, but they often drift off task, retry endlessly, break unrelated things, or declare success too early. MartinLoop adds a governance layer around the agent: it enforces budgets, stops runaway loops, requires real checks before calling something done, and produces a clear record of what happened.
The goal: give the agent more responsibility without giving it unlimited freedom.
How It Works
MartinLoop runs a governed run with these steps:
- Define – You set the objective, a verifier (e.g.,
npm test), a budget in USD, and a maximum number of attempts. - Preflight – It checks that the environment is ready before the agent spends any money.
- Control – While the agent works, MartinLoop enforces budgets, path boundaries, and stop conditions.
- Verify – It runs the configured checks and binds the evidence to the specific run and workspace.
- Recover – If something fails, it preserves rollback state for retry or human review.
- Prove – It produces an authoritative outcome:
VERIFIED,STOPPED, orNEEDS REVIEW. - Analyze – You can inspect run history, costs, failure classes, and shareable evidence.
This lifecycle is summarized as Definition of Done → Controlled Run → Verified Handoff.
Key Features
- Budget caps – Hard limits on USD spend, tokens, or iterations. The run stops before exceeding them.
- Verifier gates – A run is only marked
VERIFIEDif a real check (likenpm test) passes.VERIFIEDdoes not mean the code is bug‑free — it only proves the checks that were configured actually ran. - Policy checks – Blocks unsafe verifier commands, risky path changes, and secret‑like inputs before execution.
- Failure classification – Categorizes failures into 13 canonical runtime classes (e.g., budget exceeded, verifier failed, unsafe action) so you know why a run stopped.
- Run receipts – After a run, you get a local share bundle with a JSON receipt, a Markdown summary, and a proof‑card SVG. It shows spend, budget, verifier result, and integrity.
- Model‑agnostic – Works with native agent CLIs (Codex, Claude Code, Gemini) and OpenAI‑compatible endpoints (Kimi, NVIDIA Nemotron, DeepSeek, Qwen, Mistral, OpenRouter, Ollama, etc.). The governance contract stays the same regardless of the worker.
- Loop tax audit – The
auditcommand reads your local Claude Code session history and reports how much API spend went into fix‑and‑retry loops, how often verifier commands failed, and the longest retry chain. This helps you see the cost of ungoverned runs. - Swarm mode – A demo that simulates 15 agents launching tasks, with optional persisted governance.
- Arcade – A visual presentation layer for long runs (optional, presentation‑only, never affects the outcome).
Getting Started
You can try it immediately with npx (no install needed):
# See your loop tax (reads local Claude Code history)
npx -y martin-loop@latest audit
# Start the guided onboarding
npx -y martin-loop@latest start
# Run a demo in a disposable workspace
npx -y martin-loop@latest demo
A typical governed run looks like:
npx -y martin-loop@latest run "Summarize the demo workspace and prove tests still pass" \
--verify "npm test" --budget-usd 2 --max-iterations 1
After the run, you can inspect the result:
npx -y martin-loop@latest dossier --latest
npx -y martin-loop@latest share --latest
The share command writes three files into the run directory: run-receipt.json, run-receipt.md, and proof-card.svg.
Important Caveats
- MartinLoop does not replace Git, GitHub, CI, security scanners, or code review. It gives those workflows a single governed execution record to inspect.
- The verifier only proves the checks it runs —
VERIFIEDis not a claim of bug‑freeness or merge‑safety. - The tool is local‑first; optional hosted sync sends evidence to a dashboard if you configure an API token and endpoint.
- When you provide
--model, MartinLoop passes it through unchanged; without it, the host runtime picks its own default. There is no hidden fallback model.
Why Teams Use It
- Less babysitting – Give agents larger jobs without watching every step.
- Clear boundaries – Scope, attempts, and spend stay inside the limits you set.
- Checks before “done” – Verification decides whether the evidence passed.
- Understand failures – Know why the run stopped instead of digging through logs.
- Recover cleanly – Enough evidence to retry, repair, roll back, or hand off.
- One workflow across agents – The job stays consistent even if you change the underlying agent.
MartinLoop is part of the NVIDIA Inception program and is open‑source under Apache‑2.0.
For full details, see the README and the linked documentation.
Related
- Project
- Project
- Project
- Project