MartinLoop — Summary
Slug: martinloop
GitHub: https://github.com/Keesan12/Martin-Loop
Stars: 22
License: Apache-2.0
Language: TypeScript (Node.js 20+)
Status: Active (last commit 2026-05-26); NVIDIA Inception Program accepted
What It Is
MartinLoop is a governance control plane for AI coding agent loops. It wraps Claude Code, Codex, and custom agent runs with hard budget caps, policy checks, verifier gates, rollback evidence, and JSONL audit records.
It does not run code itself — it governs the "Ralph Loop" (the failure mode where an AI coding agent keeps retrying without a stop condition, burning budget with no audit trail).
Core Value Proposition
"AI coding accountability: completes good work, refuses unsafe work, stops uneconomical work."
Same task, same starting state: MartinLoop completes in one verified attempt at $2.30. Uncontrolled loop retries 4× at $5.20 with no audit trail (README benchmark).
Five-Layer Architecture
- Task Contract — Objective, verifier plan, repo root, allowed/denied paths, acceptance criteria, budget
- Policy & Budget —
martin.config.yaml+ CLI flags; budget preflight rejects attempts before execution - Agent Adapters — Claude CLI, Codex CLI, direct-provider, stub adapters normalize results
- Safety & Verification — Verifier commands, file scope, approval-boundary changes, secret scan, grounding
- Persistence — JSONL records at
~/.martin/runs/<workspaceId>.jsonl
Key Capabilities
- Budget hard caps (
maxUsd,softLimitUsd,maxIterations,maxTokens) - 11-class failure taxonomy (hallucination, test regression, scope creep, repo grounding failure, env mismatch, budget pressure, etc.)
- Red-Blue adversarial testing (6 probes, 3 risk tiers)
- Context injection detection (authority inversion, instruction override, identity redefinition)
- Rollback evidence capture
- Context distillation for subsequent attempts
- JSONL run records (inspectable, resumable)
Packages
martin-loop— root npm package (CLI + SDK)@martin/contracts— shared types@martin/core— runtime, policy engine, safety leash@martin/adapters— Claude CLI, Codex CLI, direct-provider, stub@martin/cli— CLI implementation@martinloop/mcp— MCP server (11 tools, 12 resources, 10 prompts)