MartinLoop
Give coding agents real jobs with hard budgets, verifier gates and signed run receipts — without babysitting every step.
- Source repo
- Keesan12/martin-loop
- Stars
- ★ 262
- Last updated
- 6d ago
- FARS reviewed
- Sep 28, 2026
- License
- Apache-2.0
- Primary language
- TypeScript
- FA score
- 64/100 · Some gaps
At a glance
- Works with
- Universal · cross-platformCodex · Claude Code · OpenAI API
- You'll need
- Typical use
- A solo developer queuing a dozen coding jobs overnight: put a $2 budget and 3-attempt cap on each run, then read dossiers and receipts in the morning instead of scrolling logs.
- Main limitation
- No bundled model or agent: you must already have an authenticated Codex, Claude Code or Gemini CLI install, or supply your own OpenAI-compatible endpoint.
- Website
- martinloop.com ↗ set on GitHub
- Maintenance
- Commits in the last 30 dayslast commit 2026-11-19
- Source review
- 64/100 · Some gaps
What does this agent do, and when should you use it?
MartinLoop is an Apache-2.0 TypeScript CLI and SDK that wraps an existing coding agent in a governed run: you declare an objective, a verifier command, a USD budget, an iteration cap and path allow/deny globs, and MartinLoop drives the agent through a fixed DEFINE → PREFLIGHT → CONTROL → VERIFY → RECOVER → PROVE → ANALYZE lifecycle. It ships adapters for Claude Code, Codex and Gemini CLI plus an OpenAI-compatible path (--engine openai) covering Kimi K2, DeepSeek, Qwen, Mistral, Ollama, LM Studio and similar endpoints, so the job contract survives a change of worker. Every attempt lands in a JSONL run record that is HMAC-signed with a per-runs-root key, and martin dossier, martin runs verify, martin challenge and martin badge report an integrity verdict of verified, tamper_detected or unsigned. Completion is bound to fresh verifier evidence and collapses to exactly one of VERIFIED, STOPPED or NEEDS REVIEW, with runtime failures sorted into 13 canonical classes. The run store, receipts and rollback evidence stay local, with optional hosted dashboard sync through MARTIN_API_TOKEN and MARTIN_TELEMETRY_ENDPOINT. The same engine is exposed as an MCP server (@martinloop/mcp) and as a library via the exported MartinLoop class and adapter factory functions.
martin run <objective> --verify "npm test" --budget-usd 2 --max-iterations 3 auto-checks doctor, session-start and preflight, then executes only when the environment is ready. Budget preflight blocks an attempt before it would exceed policy, --max-tokens caps token spend, --allow-path / --deny-path bound writes, and policy checks reject unsafe verifier commands, risky path changes and secret-like task inputs before execution. Adapters (createClaudeCliAdapter, createCodexCliAdapter, createGeminiCliAdapter, createDirectProviderAdapter, createOpenAiCompatibleAdapter) normalize each attempt into JSONL run records and evidence summaries that are locally signed. After the run, martin dossier, martin runs get|verify, martin challenge and martin badge surface the outcome and integrity; martin share --latest writes a redacted run-receipt.json, run-receipt.md and proof-card.svg. Around that core sit martin audit (reads Claude Code session history locally and reports API-equivalent spend inside fix-and-retry loops, verifier failure counts and the longest retry chain), martin bench --suite under-3-challenge|ralphy-engineering-50 for deterministic benchmarks, martin demo --swarm for a 15-agent local simulation, and the @martinloop/mcp package that gives MCP hosts one write-capable execution entrypoint plus planning, inspection and review helpers.
- A solo developer queuing a dozen coding jobs overnight: put a $2 budget and 3-attempt cap on each run, then read dossiers and receipts in the morning instead of scrolling logs.
- A platform team adding a spend gate to CI: the
examples/github-actions-budget-gate/example pins budget and verifier commands into the pipeline so a run stops at the boundary. - An engineering manager who wants the loop tax measured before rewriting the workflow: run
martin auditonce and see how much equivalent API spend went into fix-and-retry cycles. - Compliance-sensitive work that needs an auditable trail: every governed run leaves a signed record whose integrity can be re-verified and exported as a redacted bundle.
- Teams already switching between Claude Code, Codex and Gemini CLI who want one job contract — budget, scope, verification, outcome — regardless of the worker.
- Developers embedding governed runs in their own product with the
MartinLoopclass and adapter factories from the npm package.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
npx -y martin-loop@latest --versionnpx -y martin-loop@latest enable --engine codexnpm install -g martin-loop@latestpnpm install --frozen-lockfile
- Runtime
- Node.js 20+
How do you install or deploy this agent?
Per the README you need Node.js 20+ and a coding-agent runtime you have already installed and authenticated (Codex, Claude Code or Gemini CLI), or an OpenAI-compatible endpoint. There is no server to deploy; the CLI runs straight from npm.
Confirm the package resolves:
npx -y martin-loop@latest --versionIf more than one supported runtime is detected, pick one before the first governed run:
npx -y martin-loop@latest enable --engine codexOptional global install:
npm install -g martin-loop@latest
martin-loop --versionBuilding from source needs pnpm 10.x:
git clone https://github.com/Keesan12/martin-loop.git
cd martin-loop
pnpm install --frozen-lockfile
pnpm lint
pnpm test
pnpm buildHow do you use this agent?
Measure first. audit reads Claude Code session history locally and reports the API-equivalent spend that went into fix-and-retry loops:
npx -y martin-loop@latest auditAdd --offline to cut all network access, or --share for a screenshot-ready SVG plus Markdown summary.
Then run a governed job — the verifier command, budget and attempt cap are the contract:
npx -y martin-loop@latest enable --engine codex
npx -y martin-loop@latest demo
cd martin-loop-demo
npm install
npx -y martin-loop@latest run "Summarize the demo workspace and prove tests still pass" --verify "npm test" --budget-usd 2 --max-iterations 1
npx -y martin-loop@latest dossier --latest
npx -y martin-loop@latest runs verify --latest
npx -y martin-loop@latest share --latestTo check readiness without spending, use the inspect-first flow:
npx -y martin-loop@latest doctor
npx -y martin-loop@latest preflight "Summarize the demo workspace and prove tests still pass" --verify "npm test"Embed it in your own TypeScript code with the SDK:
import { MartinLoop, createClaudeCliAdapter } from "martin-loop";
const loop = new MartinLoop({
adapter: createClaudeCliAdapter({ workingDirectory: process.cwd() }),
defaults: {
workspaceId: "my-workspace",
projectId: "my-project",
budget: { maxUsd: 3, softLimitUsd: 2.25, maxIterations: 3, maxTokens: 20_000 },
},
});
const result = await loop.run({
task: {
title: "Fix auth regression",
objective: "Fix the failing auth regression tests",
verificationPlan: ["pnpm test"],
repoRoot: process.cwd(),
},
});
console.log(result.decision.status);Wire it into an MCP host:
codex mcp add martin-loop -- npx -y @martinloop/mcp
claude mcp add --transport stdio --scope user martin-loop -- npx -y @martinloop/mcpSafety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
Inherits capabilities of connected MCP servers; audit third-party servers before enabling.
What are this agent's strengths and limitations?
- Worker-agnostic governance: Codex, Claude Code, Gemini CLI and OpenAI-compatible endpoints share one budget, scope, verifier, receipt and integrity contract, so swapping the model does not rewrite the job.
- Enforcement happens preflight:
--budget-usd,--max-iterationsand--max-tokensstop the next attempt before it exceeds policy rather than reporting the overspend afterwards. - Tamper-evident local evidence: JSONL records are HMAC-signed with a per-runs-root key and
runs verify/dossierreturn verified, tamper_detected or unsigned. - Completion is bound to verifier evidence and resolved to VERIFIED, STOPPED or NEEDS REVIEW, with runtime failures classified into 13 canonical classes so you know why a run stopped.
- Shareable handoff:
share --latestproduces a redacted JSON receipt, Markdown recap and proof-card SVG that can be passed on without leaking raw run-store files. - Multiple entry points: CLI, npm SDK with exported adapters, an
@martinloop/mcpserver, and a GitHub Actions budget-gate example.
- No bundled model or agent: you must already have an authenticated Codex, Claude Code or Gemini CLI install, or supply your own OpenAI-compatible endpoint.
- The public line is still 0.10.0 pre-1.0, and the README itself recommends pinning the version because plain
npx martin-loopcan resolve a stale local cache. - A fresh interactive install enables anonymous telemetry by default (sent only after a one-time disclosure); opting out needs
martin telemetry offor environment flags. - Cost fidelity depends on the host: Codex usage is labelled estimated unless the host exposes authoritative numbers.
- The shipped benchmarks (
under-3-challenge,ralphy-engineering-50) are deterministic repository fixtures, not an independent third-party evaluation. demo --swarmdefaults to local simulation that is not persisted and does not check signed receipt integrity; real governance requires--governedor--live.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| MartinLoop This agent | 64 · Some gaps | — | ★ 262 | 6d ago | TypeScript | Codex · Claude Code · OpenAI API |
| Asqav SDK (Python + TypeScript) | 71 · Some gaps | Library / SDKFreemium | ★ 511 | 4d ago | Python | — |
| Althar | 55 · Major gaps | Desktop appFree + model costs | ★ 23 | today | TypeScript | ChatGPT · Codex · Claude Code · OpenAI API · Claude API |
| Aura Code Audit Trail | 50 · Major gaps | CLIFree | ★ 56 | 1d ago | Rust | Codex · Claude Code |
How does FollowAgents rate this agent?
Why each dimension lost points
Evidence shows least-privilege design (allow/deny paths, budget caps, policy checks) and least-privilege CI (scoped permissions, persist-credentials:false), but no explicit human-confirmation gate is shown before an agent writes code; telemetry is optional and local-first with cost provenance labels; secret-like input detection and redacted share bundles are claimed without shown implementation; dependency security relies on pnpm overrides pinning known-vulnerable packages (qs, hono, fast-uri) with no audit/SBOM evidence; rollback and HMAC-signed integrity are documented with commands; attribution is complete (Apache-2.0, repo, contact) though NVIDIA Inception and similar claims are independently unverifiable.
README, package. (0.6.9), release notes, and MCP package versions are mutually consistent; dependencies come from standard npm, but the README itself warns that npx may resolve a stale cache, leaving availability risk on users; the 13-class failure taxonomy plus doctor/preflight/triage shows serious failure-message design.
Audience and scenarios (overnight unattended runs, budget-bounded jobs) are clearly described; capability boundaries are unusually explicit (VERIFIED is not bug-free; does not replace Git/CI/scanners), earning full marks; triggers and engine selection (claude/codex/gemini/openai) are documented; Node>=20 is stated but no full compatibility matrix is shown.
Documentation architecture (llms.txt, docs tree, CLI/MCP references) is thorough; install notes are detailed including pinning and cache warnings; martin/martin-loop aliasing is explained; examples and a demo exist but the README is truncated mid-SDK and no FAQ is visible; known limitations are explicit; LICENSE is present but the appendix copyright placeholder is unfilled; multi-version release notes are aligned; SECURITY.md names latest-release support but maintenance identity is anonymous 'contributors'.
Output is delivered via dossier/receipt/share in three formats, well designed for usability; the budget/verifier governance wrapper offers real incremental value over bare coding-agent runs; cost-benefit is the product's core pitch, but the self-authored benchmark fixture ($2.30 vs $5.20) is self-certifying.
Claims link to concrete docs/examples/benchmarks and are traceable; however all corroboration is self-published within the repository, so cross-source corroboration is weak; provenance labels (actual/calculated/estimated/unavailable) and the EVIDENCE_BOUNDARY mechanism explicitly separate fact from inference, a standout strength.
- npx -y martin-loop@latest pulls the newest package at run time; behavior can change on supply-chain changes — pin the version.
- Budget comparison figures ($2.30 vs $5.20) come from a self-authored fixture in the repo; treat them as self-certifying, not an independent benchmark.
- No explicit human-confirmation gate before agent writes is shown; add your own confirmation layer for high-risk repositories.
- Actual governance effectiveness (budget enforcement, verifier gates, rollback) requires hands-on validation in a controlled environment; this was a static review with no executed runs.
- The LICENSE appendix copyright placeholder is unfilled; attribution is incomplete.
FAQ
Is MartinLoop open source?
Is MartinLoop safe to use?
Is MartinLoop still maintained?
Who makes MartinLoop?
What is MartinLoop's official website?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.