{"id":49420585,"url":"https://github.com/keesan12/martin-loop","last_synced_at":"2026-06-06T00:01:44.736Z","repository":{"id":352948867,"uuid":"1201026117","full_name":"Keesan12/martin-loop","owner":"Keesan12","description":"Martin Loop — The control plane for AI coding agents.","archived":false,"fork":false,"pushed_at":"2026-04-21T21:07:39.000Z","size":546,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-21T21:37:23.900Z","etag":null,"topics":["agentic-engineering","ai-agent-runtime","ai-coding-agents","ai-governance","ai-governance-ai-orchestration","ai-governance-layer","ai-infrastructure","ai-observability","ai-safety","audit-trail","budget-enforcement","control-plane","devtools","governed-runtime","llmops","observability","opentelemetry","policy-as-code","ralph-loop","secure-by-default"],"latest_commit_sha":null,"homepage":"https://martinloop.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Keesan12.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["keesan12","GobiShanthan"]}},"created_at":"2026-04-04T05:34:39.000Z","updated_at":"2026-04-21T21:07:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5413832-d1ff-4453-9613-e780da1668f6","html_url":"https://github.com/Keesan12/martin-loop","commit_stats":null,"previous_names":["keesan12/martin-loop"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Keesan12/martin-loop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keesan12%2Fmartin-loop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keesan12%2Fmartin-loop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keesan12%2Fmartin-loop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keesan12%2Fmartin-loop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Keesan12","download_url":"https://codeload.github.com/Keesan12/martin-loop/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keesan12%2Fmartin-loop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32412890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T05:20:56.964Z","status":"ssl_error","status_checked_at":"2026-04-29T05:19:54.749Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-engineering","ai-agent-runtime","ai-coding-agents","ai-governance","ai-governance-ai-orchestration","ai-governance-layer","ai-infrastructure","ai-observability","ai-safety","audit-trail","budget-enforcement","control-plane","devtools","governed-runtime","llmops","observability","opentelemetry","policy-as-code","ralph-loop","secure-by-default"],"created_at":"2026-04-29T06:00:31.238Z","updated_at":"2026-06-06T00:01:44.730Z","avatar_url":"https://github.com/Keesan12.png","language":"TypeScript","funding_links":["https://github.com/sponsors/keesan12","https://github.com/sponsors/GobiShanthan"],"categories":[],"sub_categories":[],"readme":"# MartinLoop\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./docs/assets/martinloop-logo.png\" alt=\"MartinLoop\" width=\"260\"\u003e\n\n  **The open-source control plane for AI coding agents.**\n\n  MartinLoop wraps Claude Code, Codex, and MCP-aware agent workflows with budgets, verifier gates, policy checks, run receipts, and review-ready evidence.\n\u003c/div\u003e\n\n## Why MartinLoop\n\nAI coding agents are useful, but unbounded retry loops are expensive.\n\nA task that looked like a $2.40 fix can become dozens of attempts, a blown token budget, and a diff nobody trusts. MartinLoop gives every run an explicit contract: objective, verifier, budget, scope, receipts, and a clear stop condition.\n\nUse it when AI coding work needs to stay bounded, inspectable, and safe to review before it becomes expensive or destructive.\n\n## Quick Start\n\nTry MartinLoop in a disposable demo workspace:\n\n```sh\nnpx martin-loop start\nnpx martin-loop tour\nnpx martin-loop demo\ncd martin-loop-demo\nnpm install\nnpx martin-loop doctor\nnpx martin-loop session-start\nnpx martin-loop preflight \"Summarize the demo workspace and prove tests still pass\" --verify \"npm test\"\nnpx martin-loop run \"Summarize the demo workspace and prove tests still pass\" --proof --verify \"npm test\"\nnpx martin-loop dossier --latest\n```\n\n`start` and `tour` walk a new operator through the product flow. `doctor`, `session-start`, and `preflight` create the local receipts MartinLoop expects before a real governed run. If you intentionally need to bypass that local gate for a one-off run, use `--unsafe-allow-unguarded-run` explicitly.\n\nRelease notes for the current root package: [MartinLoop 0.2.9](./docs/release/OSS-0.2.9-RELEASE-NOTES.md).\n\n## What It Does\n\n- Budget caps stop the next attempt before a configured USD, token, or iteration limit is exceeded.\n- Verifier gates require a real check, such as `npm test`, before a run can count as complete.\n- Policy checks block unsafe verifier commands, risky path changes, and secret-like task inputs before execution.\n- Run receipts capture stop reason, verifier evidence, budget posture, and next safe action.\n- Local onboarding commands (`start`, `tour`, `guide`, `session-start`) help operators adopt the governed flow without memorizing it.\n- MCP integration gives hosts one primary coding execution entrypoint plus richer planning, inspection, and review helpers.\n\n## How It Works\n\n| Layer | Purpose |\n| --- | --- |\n| Task contract | Objective, verifier plan, repo root, allowed paths, denied paths, acceptance criteria, workspace, project, and budget. |\n| Policy and budget | Defaults come from `martin.config.yaml`; CLI flags can override them. Budget preflight blocks attempts that would exceed policy. |\n| Agent adapters | Claude CLI, Codex CLI, direct-provider, and verifier-only adapters normalize execution results. |\n| Safety and verification | Scope checks, verifier command checks, prompt integrity, and grounding decide whether work can continue. |\n| Persistence | JSONL run records, evidence summaries, and repo-backed artifacts make every run inspectable later. |\n\n## CLI\n\n```text\nmartin-loop start [--host \u003ccodex|claude|gemini|generic\u003e]\nmartin-loop tour [--host \u003ccodex|claude|gemini|generic\u003e]\nmartin-loop guide [topic]\nmartin-loop doctor\nmartin-loop demo\nmartin-loop session-start [--host \u003cclaude|codex|generic\u003e]\nmartin-loop phase status|contract|preflight|run [--execute]\nmartin-loop preflight \u003cobjective\u003e [options]\nmartin-loop run \u003cobjective\u003e [options]\nmartin-loop triage\nmartin-loop dossier (--latest | --loop-id \u003cid\u003e | --file \u003cpath\u003e)\nmartin-loop runs list|get|attempt|verify ...\nmartin-loop mcp print-config --host \u003ccodex|claude|gemini|generic\u003e\nmartin-loop mcp install --host \u003ccodex|claude|gemini|generic\u003e\n```\n\nThe local-first onboarding flow is:\n\n1. `martin-loop start`\n2. `martin-loop tour`\n3. `martin-loop doctor`\n4. `martin-loop session-start`\n5. `martin-loop preflight ...`\n6. `martin-loop run ...`\n7. `martin-loop dossier --latest`\n\nMore detail: [CLI reference](./docs/reference/cli.md) and [configuration reference](./docs/reference/config.md).\n\n## MCP\n\nRun the standalone MCP package directly:\n\n```sh\nnpx -y @martinloop/mcp\n```\n\nAdd it to common hosts:\n\n```sh\ncodex mcp add martin-loop -- npx -y @martinloop/mcp\nclaude mcp add --transport stdio --scope user martin-loop -- npx -y @martinloop/mcp\nclaude mcp add --transport stdio --scope user martin-loop -- cmd /c npx -y @martinloop/mcp\n```\n\nGenerate host config from the root CLI:\n\n```sh\nnpx martin-loop mcp print-config --host codex --transport stdio --profile minimal\nnpx martin-loop mcp print-config --host claude --transport stdio --profile diagnostic\nnpx martin-loop mcp print-config --host gemini --transport stdio --profile full-local\nnpx martin-loop mcp print-config --host generic --transport stdio --profile github-review\n```\n\nThe root `martin-loop` package and the standalone `@martinloop/mcp` package move on separate version lines. The root package is `0.2.9`; the current standalone MCP package is `0.2.7`.\n\nMore detail: [MCP setup](./docs/getting-started/mcp.md), [MCP tool reference](./docs/reference/mcp-tools.md), and [MCP compatibility](./docs/reference/mcp-compatibility.md).\n\n## SDK\n\n```sh\nnpm install martin-loop\n```\n\n```typescript\nimport { MartinLoop, createClaudeCliAdapter } from \"martin-loop\";\n\nconst loop = new MartinLoop({\n  adapter: createClaudeCliAdapter({ workingDirectory: process.cwd() }),\n  defaults: {\n    workspaceId: \"my-workspace\",\n    projectId: \"my-project\",\n    budget: {\n      maxUsd: 3.0,\n      softLimitUsd: 2.25,\n      maxIterations: 3,\n      maxTokens: 20_000,\n    },\n  },\n});\n\nconst result = await loop.run({\n  task: {\n    title: \"Fix auth regression\",\n    objective: \"Fix the failing auth regression tests\",\n    verificationPlan: [\"pnpm test\"],\n    repoRoot: process.cwd(),\n  },\n});\n\nconsole.log(result.decision.status);\n```\n\nMore detail: [SDK reference](./docs/reference/sdk.md) and [package map](./docs/reference/packages.md).\n\n## Examples\n\n- [Quickstart](./docs/getting-started/quickstart.md)\n- [Examples](./docs/getting-started/examples.md)\n- [Claude Code walkthrough](./docs/getting-started/claude-code.md)\n- [Codex setup](./docs/getting-started/codex.md)\n- [MCP setup](./docs/getting-started/mcp.md)\n- [GitHub Actions budget gate](./examples/github-actions-budget-gate/)\n- [OpenCode-style adapter](./examples/opencode-adapter/)\n\n## Development\n\nRequirements:\n\n- Node.js 20+\n- pnpm 10.x\n\n```sh\ngit clone https://github.com/Keesan12/martin-loop.git\ncd martin-loop\npnpm install --frozen-lockfile\npnpm lint\npnpm test\npnpm build\npnpm public:copy-scan\npnpm public:git-surface\npnpm oss:validate\npnpm public:smoke\npnpm release:validate-local\n```\n\n## Contributing\n\nIssues, bug reports, workflow feedback, and focused pull requests are welcome. Public-facing docs should stay concise, user-centered, and accurate.\n\n```sh\ngit checkout -b feat/your-feature\npnpm lint\npnpm test\ngit commit -m \"feat: describe what you built\"\ngit push -u origin feat/your-feature\n```\n\n## License\n\nApache-2.0. See [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeesan12%2Fmartin-loop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeesan12%2Fmartin-loop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeesan12%2Fmartin-loop/lists"}