{"id":50361630,"url":"https://github.com/mutgarth/automode","last_synced_at":"2026-05-30T02:03:17.251Z","repository":{"id":359031860,"uuid":"1234247414","full_name":"mutgarth/automode","owner":"mutgarth","description":"Auto-approve Claude Code, Codex, and Antigravity CLI permission prompts using a local LLM — zero UI interruptions, full reasoning, ~500ms decisions","archived":false,"fork":false,"pushed_at":"2026-05-27T14:11:30.000Z","size":103,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-27T16:09:44.733Z","etag":null,"topics":["ai","antigravity","automation","claude","claude-code","codex","developer-tools","llama-cpp","llm","openai-codex","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/mutgarth.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-05-09T23:50:48.000Z","updated_at":"2026-05-27T14:14:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mutgarth/automode","commit_stats":null,"previous_names":["mutgarth/automode"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mutgarth/automode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutgarth%2Fautomode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutgarth%2Fautomode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutgarth%2Fautomode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutgarth%2Fautomode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mutgarth","download_url":"https://codeload.github.com/mutgarth/automode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutgarth%2Fautomode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33677261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ai","antigravity","automation","claude","claude-code","codex","developer-tools","llama-cpp","llm","openai-codex","rust"],"created_at":"2026-05-30T02:03:10.230Z","updated_at":"2026-05-30T02:03:17.236Z","avatar_url":"https://github.com/mutgarth.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# automode\n\n\u003e **Auto-approve Claude Code, Codex, and Antigravity permission prompts using a local LLM — no UI interruptions, ~500 ms decisions, fully private.**\n\n[![Latest release](https://img.shields.io/github/v/release/mutgarth/automode?label=release\u0026color=brightgreen)](https://github.com/mutgarth/automode/releases/latest)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Rust](https://img.shields.io/badge/built%20with-Rust-orange?logo=rust)](https://www.rust-lang.org/)\n[![llama.cpp](https://img.shields.io/badge/inference-llama.cpp-green)](https://github.com/ggerganov/llama.cpp)\n[![Claude Code](https://img.shields.io/badge/works%20with-Claude%20Code-blueviolet?logo=anthropic)](https://claude.ai/code)\n[![Codex](https://img.shields.io/badge/works%20with-Codex-black?logo=openai)](https://github.com/openai/codex)\n[![Antigravity](https://img.shields.io/badge/works%20with-Antigravity-4285F4?logo=google)](https://antigravity.google/)\n\n---\n\nClaude Code asks for permission before running shell commands, reading files, calling APIs, etc. With `automode`, those prompts are intercepted by a local LLM that reasons about each tool call and decides in ~500 ms — without any UI prompt, without sending data to the cloud, and without ever making things less safe than vanilla Claude Code.\n\n```\n❯ automode start\n  ✓ llama-server running  (localhost:8080, Bonsai-8B-Q1_0, Metal)\n  ✓ automode daemon running  (localhost:7878, mode: mild)\n  Hook registered in ~/.claude/settings.json\n```\n\n---\n\n## How it works\n\n```\nClaude Code\n    │  PreToolUse hook fires\n    ▼\n~/.automode/hook.sh\n    │  POST /decide  (2 s connect timeout, 30 s total — silent fallback on error)\n    ▼\nautomode  (Rust HTTP daemon · localhost:7878)\n    │  builds prompt: system = policy, user = tool call JSON\n    ▼\nllama.cpp server  (subprocess managed by automode · localhost:8080)\n    │  returns { \"decision\": \"approve\" | \"reject\", \"reason\": \"...\" }\n    ▼\nautomode → hook → Claude Code  (no prompt shown)\n```\n\nIf the LLM can't decide or the daemon is unreachable, the hook exits with code `0` and Claude Code falls through to its normal permission prompt. **automode never silently breaks anything.**\n\n---\n\n## Modes\n\n| Mode | What the LLM approves |\n|---|---|\n| `yolo` | Everything except catastrophic ops (`rm -rf ~`, `DROP DATABASE prod`, …) |\n| `mild` | Common dev workflow — reads, writes, git, cargo, npm; rejects destructive ops |\n| `strict` | Read-only operations only |\n| `custom` | Your own `~/.automode/policy.md` injected verbatim as the system prompt |\n\nEvery mode still runs the LLM — there is no static bypass list. The model always reasons about the call.\n\n---\n\n## Installation\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/mutgarth/automode/main/scripts/install.sh | sh\n```\n\nThe installer:\n1. Downloads the `automode` binary for your platform\n2. Downloads `llama-server` from the latest llama.cpp release\n3. Downloads `Bonsai-8B-Q1_0.gguf` (~1.16 GB) from Hugging Face\n4. Runs `automode setup` — interactive mode selection\n5. Patches `~/.claude/settings.json` to register the PreToolUse hook\n\n**After installation, restart any open Claude Code sessions** so they pick up the hook.\n\n### Build from source\n\n```sh\ngit clone https://github.com/mutgarth/automode\ncd automode\ncargo build --release\n./target/release/automode dev   # downloads llama-server + model, runs setup\n```\n\n---\n\n## Commands\n\n```\nautomode setup              Interactive onboarding — installs hook, picks mode\nautomode setup --target T   T = claude (default) | codex | antigravity | both | all\nautomode start              Start the daemon and llama-server in the background\nautomode stop               Stop everything cleanly\nautomode status             Show running state, mode, and last decisions\nautomode mode \u003cname\u003e        Switch to yolo | mild | strict | custom\nautomode logs               Tail decisions.log\nautomode dev                Local-build setup (skips GitHub release download)\nautomode update             Refresh binary/hooks; preserve mode, ports, paths\nautomode update --target T  Also set integration target: claude | codex | antigravity | both | all\n```\n\nAfter installation, **restart any open Claude Code, Codex, or Antigravity sessions** so they pick up the hook.\n\n---\n\n## Codex and Antigravity\n\nThe same daemon can serve Codex (`PermissionRequest` hooks in `~/.codex/hooks.json`) and Antigravity (`PreToolUse` hooks in `~/.gemini/config/hooks.json`) alongside Claude Code. Each integration returns the host's native decision format.\n\n```sh\nautomode setup --target codex         # Codex only\nautomode setup --target antigravity   # Antigravity only\nautomode setup --target both          # Claude Code + Codex\nautomode setup --target all           # Claude Code + Codex + Antigravity\n```\n\nClaude Code remains the default target, so existing installs keep working unchanged.\n\nRun `automode update` after upgrading automode or pulling a newer local build. It refreshes\nthe installed binary and hook scripts, patches missing host hook files, migrates older\nconfigs to include an integration target, and preserves existing mode, ports, model path,\nand log settings. If no target is configured yet, update defaults to `all`.\n\n---\n\n## Custom policies\n\nSwitch to `custom` mode and edit `~/.automode/policy.md`. The file is injected verbatim as the LLM system prompt, giving you full control:\n\n```markdown\n# My policy\n\n## Always approve\n- Anything inside ~/projects/\n- Read-only database queries against the staging DB\n\n## Always reject\n- Any command that rewrites git history\n- Anything touching the production cluster (prod-*)\n```\n\n---\n\n## Performance\n\nTested on Apple Silicon with Metal acceleration:\n\n| Decision type | Latency |\n|---|---|\n| Simple command (`echo`, `ls`, `cat`) | ~500 ms |\n| Complex command (`for` loop, `$(...)`, multi-line) | ~600–700 ms |\n\nThe 1-bit Bonsai model is **1.16 GB on disk**. automode starts llama.cpp with one server slot, a 2K context, and 128 max predicted tokens to keep memory bounded for short permission decisions. It runs entirely on-device — no data leaves your machine.\n\n---\n\n## File layout\n\n```\n~/.automode/\n  automode            ← the Rust daemon binary\n  llama-server        ← llama.cpp server binary\n  *.dylib             ← llama.cpp shared libs (macOS)\n  hook.sh             ← Claude Code PreToolUse hook\n  codex-hook.sh       ← Codex PermissionRequest hook (when --target includes codex)\n  antigravity-hook.sh ← Antigravity PreToolUse hook (when --target includes antigravity)\n  config.toml         ← port, mode, paths, log level\n  policy.md           ← active in custom mode\n  models/\n    bonsai.gguf       ← ~1.16 GB GGUF model\n  logs/\n    decisions.log     ← every approve/reject with LLM reasoning\n    failures.log      ← cases where the LLM couldn't decide\n    llama-server.log  ← llama-server stderr\n```\n\n---\n\n## Tech stack\n\n| Layer | Library |\n|---|---|\n| Language | Rust 2021 |\n| HTTP server | axum 0.7 |\n| LLM client | reqwest 0.12 |\n| Async runtime | tokio 1 |\n| CLI | clap 4 |\n| LLM inference | llama.cpp |\n| Model | Bonsai-8B-Q1\\_0.gguf |\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutgarth%2Fautomode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmutgarth%2Fautomode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutgarth%2Fautomode/lists"}