{"id":47808535,"url":"https://github.com/bobbyg603/mog","last_synced_at":"2026-04-03T17:58:48.101Z","repository":{"id":342426702,"uuid":"1173878582","full_name":"bobbyg603/mog","owner":"bobbyg603","description":"💥 moggin gh issues with Claude Code, Docker Sandboxes, and Ralph loops","archived":false,"fork":false,"pushed_at":"2026-03-22T02:30:58.000Z","size":95,"stargazers_count":4,"open_issues_count":3,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-22T17:56:23.976Z","etag":null,"topics":["claude","claude-code","gh","mog"],"latest_commit_sha":null,"homepage":"https://workingdevshero.com/blog/mog/","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/bobbyg603.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"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}},"created_at":"2026-03-05T21:04:37.000Z","updated_at":"2026-03-22T02:31:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bobbyg603/mog","commit_stats":null,"previous_names":["bobbyg603/mog"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/bobbyg603/mog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbyg603%2Fmog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbyg603%2Fmog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbyg603%2Fmog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbyg603%2Fmog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bobbyg603","download_url":"https://codeload.github.com/bobbyg603/mog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbyg603%2Fmog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31368093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["claude","claude-code","gh","mog"],"created_at":"2026-04-03T17:58:47.527Z","updated_at":"2026-04-03T17:58:48.090Z","avatar_url":"https://github.com/bobbyg603.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg height=\"320\" alt=\"claude moggin issues\" src=\"https://github.com/user-attachments/assets/72b347d2-b128-47b5-8dcd-e15248350fe0\" /\u003e\n\n\n# mog — Sandboxed Claude Issue Mogging\n\nOne command to go from GitHub issue to pull request, powered by Claude Code running in a Docker sandbox.\n\n```\nmog workingdevshero/automate-it 123\n```\n\nThat's it. `mog` will:\n\n1. Fetch the issue title, description, labels, and comments via `gh` CLI\n2. Create a git worktree on a clean branch (`123-fix-broken-login`)\n3. Run Claude Code inside a persistent Docker sandbox (microVM) with `--dangerously-skip-permissions`\n4. **Plan** — analyze the codebase and create an implementation plan\n5. **Build** — execute each task in the plan, one at a time\n6. **Review** — self-review all changes for missed patterns, duplication, and quality\n7. Squash commits, push the branch, and open a PR that `Closes #123`\n\n## Prerequisites\n\n- **macOS or Windows** (Docker sandbox microVMs require Docker Desktop)\n- **Docker Desktop 4.40+** — running and up to date. Docker sandbox support (required by mog) was introduced in Docker Desktop 4.40. Verify with `docker sandbox ls`.\n- **Bun** — install from [bun.sh](https://bun.sh)\n- **GitHub CLI** (`gh`) — authenticated via `gh auth login`\n- **Git** with push access to your target repos\n\n## Install\n\n```bash\nbun install -g @bobbyg603/mog\n```\n\n## Quick start\n\n```bash\n# 0. Verify Docker sandbox support is available\ndocker sandbox ls\n\n# 1. One-time setup: create sandbox \u0026 authenticate\nmog init\n# This launches Claude Code — use /login to authenticate with your Max subscription\n# Once logged in, type /exit to return\n\n# 2. Start mogging issues\nmog workingdevshero/automate-it 123\n```\n\n## How authentication works\n\n`mog init` creates a **persistent** Docker sandbox named `mog`. When it launches, you authenticate once using `/login` inside the Claude Code session. Your auth persists in the sandbox across all future `mog` runs — you never need to login again.\n\nIf your session ever expires, just run `mog init` again to re-authenticate.\n\n## Usage\n\n```bash\n# One-time setup\nmog init\n\n# Auto-detect repo from git remote (run from inside a git repo)\nmog 123\n\n# Explicit repo\nmog owner/repo 123\n\n# Include files the project needs at runtime (e.g. .env, credentials)\n# Files are copied into the worktree and removed before pushing\nmog 123 --include .env --include serviceAccountKey.json\n\n# List open issues\nmog list\nmog list --verbose\nmog owner/repo list --verbose\n\n# Check version\nmog --version\nmog -v\n```\n\n### Git identity\n\n`mog` automatically configures the git identity inside the sandbox so commits are attributed correctly. Identity is resolved via a 3-tier priority chain:\n\n1. **Per-repo mog config** (`~/.mog/repos/\u003cowner\u003e/\u003crepo\u003e/config.json`)\n2. **Host git config** (auto-detected at runtime from your local `git config`)\n3. **Global mog config** (`~/.mog/config.json`)\n\nMost users need zero configuration — `mog` reads your host git identity automatically. Use `mog config` to override when needed:\n\n```bash\n# View current per-repo config (auto-detected from git remote)\nmog config\n\n# Set per-repo git identity\nmog config user.name \"Your Name\"\nmog config user.email \"you@example.com\"\n\n# Set global fallback identity\nmog config --global user.name \"Your Name\"\nmog config --global user.email \"you@example.com\"\n```\n\n### Re-mogging\n\nRunning `mog` again on an issue that already has an open PR will:\n\n1. Fetch review comments and feedback from the existing PR\n2. Include that feedback in the prompt so Claude addresses it\n3. Start fresh from the default branch\n4. Force-push to update the existing PR\n\n```bash\n# Re-mog after getting PR feedback — Claude sees reviewer comments\nmog 123\n\n# Start completely over, ignoring the existing PR\nmog 123 --fresh\n```\n\n## How it works\n\n```\n┌──────────────────────────────────────────────────────────┐\n│  Host machine                                            │\n│                                                          │\n│  1. gh issue view #123 → fetch title, body, labels,      │\n│     comments, and PR review feedback (if re-mogging)     │\n│  2. git worktree add → clean branch from default branch  │\n│                                                          │\n│  ┌────────────────────────────────────────────────────┐  │\n│  │  Docker sandbox \"mog\" (persistent microVM)         │  │\n│  │                                                    │  │\n│  │  • ~/mog-repos mounted as workspace                │  │\n│  │  • Auth persists across runs (login once)          │  │\n│  │  • Isolated from host (own Docker daemon)          │  │\n│  │  • Phase 1: Plan — analyze codebase, create plan   │  │\n│  │  • Phase 2: Build — execute tasks one at a time    │  │\n│  │  • Phase 3: Review — self-review for quality       │  │\n│  └────────────────────────────────────────────────────┘  │\n│                                                          │\n│  3. Squash commits into one                              │\n│  4. git push origin branch (force-push if updating PR)   │\n│  5. gh pr create --body \"Closes #123\" (or update PR)     │\n└──────────────────────────────────────────────────────────┘\n```\n\n## Configuration\n\n### Environment variables\n\n| Environment Variable | Default | Description |\n|---|---|---|\n| `MOG_REPOS_DIR` | `~/mog-repos` | Where repos are cloned and worktrees created (also the sandbox workspace) |\n| `MOG_MAX_ITERATIONS` | `30` | Max build loop iterations per issue |\n| `MOG_MAX_CONTINUATIONS` | — | Legacy alias for `MOG_MAX_ITERATIONS` |\n\n### Config files\n\n`mog config` manages git identity settings stored in `~/.mog/`:\n\n```\n~/.mog/\n  config.json                          ← global config\n  repos/\n    owner/repo/config.json             ← per-repo config\n```\n\n| Config Key | Description |\n|---|---|\n| `user.name` | Git author name for commits inside the sandbox |\n| `user.email` | Git author email for commits inside the sandbox |\n\nSee [Git identity](#git-identity) for details on how these are resolved.\n\n## Worktree management\n\n`mog` uses bare clones and git worktrees so you can run multiple issues concurrently without conflicts:\n\n```\n~/mog-repos/\n  owner/\n    repo/                    ← bare clone (or full clone)\n    repo-worktrees/\n      123-fix-broken-login/  ← worktree for issue #123\n      456-add-dark-mode/     ← worktree for issue #456\n```\n\nClean up when done:\n\n```bash\ncd ~/mog-repos/owner/repo\ngit worktree remove ../repo-worktrees/123-fix-broken-login\n```\n\n## Security notes\n\n- Claude Code runs inside a **microVM** via Docker sandbox — it has its own Docker daemon and cannot access your host system, terminal, or files outside `~/mog-repos`.\n- `--dangerously-skip-permissions` is safe here because the sandbox provides the isolation boundary.\n- `gh` credentials stay on your host — the sandbox has **no access** to your GitHub token. Pushing and PR creation happen on the host after Claude finishes.\n- The sandbox has network access (required for the Anthropic API).\n\n## Troubleshooting\n\n**\"Docker sandbox not available\"** — Make sure Docker Desktop is running and up to date.\n\n**\"Sandbox 'mog' not found\"** — Run `mog init` first to create the sandbox and authenticate.\n\n**\"Failed to fetch issue\"** — Check `gh auth status` and verify the repo/issue exist.\n\n**\"No changes detected\"** — Claude may have struggled with the issue. Check the worktree manually, or re-run with a more detailed issue description.\n\n**\"Docker sandbox state is stale\"** — Restart Docker Desktop, or remove and recreate the sandbox: `docker sandbox rm mog \u0026\u0026 mog init`.\n\n**\"docker: 'sandbox' is not a docker command\"** — Your Docker Desktop version doesn't support sandboxes. Update Docker Desktop to **4.40 or later**, then verify with `docker sandbox ls`.\n\n**\"Failed to push\"** — Ensure `gh` is authenticated with push access. Try `gh auth login` and select HTTPS.\n\n## Managing the sandbox\n\n```bash\n# List sandboxes\ndocker sandbox ls\n\n# Stop the sandbox (preserves auth)\ndocker sandbox stop mog\n\n# Remove and recreate (you'll need to /login again)\ndocker sandbox rm mog\nmog init\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobbyg603%2Fmog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbobbyg603%2Fmog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobbyg603%2Fmog/lists"}