ai-teams
**English** | [简体中文](README_zh.md)
# ai-teams — Multi-Agent Coding & Cross-Vendor Blind Code Review for Antigravity & Claude Code

[](LICENSE)



[](CONTRIBUTING.md)
[](https://github.com/risingsunabc-byte/ai-teams/actions/workflows/ci.yml)
> **Stop letting an AI grade its own homework. Never stall mid-feature on Claude rate limits.**
**`ai-teams`** is a zero-dependency Model Context Protocol (MCP) server, `GEMINI.md` rule kit, and multi-agent coding workflow that unites **Google Antigravity IDE (`agy` CLI)** with **Anthropic Claude Code CLI (`claude`)** into an automated **Plan -> Execute -> Cross-Vendor Blind Code Review -> Quota-Failover** engineering team. One drop-in command routes planning, unattended coding, independent cross-model review, and interrupted-run recovery across accounts and vendors on **macOS, Linux, WSL2 (native shell), and Windows PowerShell** — macOS and Linux run natively with **no WSL2 required**. The same stdlib server is also a **universal MCP server**: drive it from Antigravity IDE, Claude Code CLI, Cursor, Windsurf, or a plain terminal ([setup guide](docs/universal-mcp.md)).
> **What's New in v2.5.2:** Fixed headless read-only shell checks in `agy_verify` / `agy_plan`, raised Claude turn budgets (`40` / `25`) with `error_max_turns` resume caching, enabled zero-`__pycache__` MCP startup (`python3 -B`), and tightened verifier anti-fabrication guardrails — see [CHANGELOG.md](CHANGELOG.md).
## Single-LLM Coding vs. ai-teams
| Dimension | Single-LLM coding | `ai-teams` |
| :--- | :--- | :--- |
| **Code review** | The same model grades its own output, so blind spots survive | Routine edits are audited read-only by Google Gemini (`agy_verify`); major/high-risk changes add a **parallel, mutually blind** `claude_verify` (`opus`) under shared read locks |
| **Rate limits** | The feature stalls when the subscription hits its 5-hour cap | Account B `agy_execute` (`gemini-4-hydrogen-xhigh`) resumes **incrementally from partial disk edits** via `last_error`, without spending primary IDE quota |
| **Token & context cost** | Every retry reloads the full conversation history | Warm `--resume` sessions, a `<= 2 KB` L1 workspace brief with L1/L2/L3 progressive cache, and zero-LLM `claude_handoff` packets |
| **Git safety & rollback** | Risky checkpoints and hidden commits | Temporary `GIT_INDEX_FILE` tree snapshots plus CLI-only `--rollback`; `.git/index` is never mutated |
| **Footprint & setup** | Multiple packages and orchestration services | 11 tools on the Python 3 standard library (zero `pip` / `npm` deps), installed by one non-intrusive command |
## Why ai-teams?
- **Cross-vendor double-blind review, no self-grading:** Routine edits are audited read-only by Google Gemini (`agy_verify`), while major/high-risk/PR changes run `agy_verify` + `claude_verify` (Claude Opus) **in parallel** under shared read locks.
- **Automatic quota failover with incremental resume:** When Claude hits rate limits, 5-hour caps, or outages mid-task, `last_error` plus partial disk edits (`Interrupted Run Recovery`) let Account B (`agy_execute`) finish incrementally without spending primary IDE quota.
- **Zero-dependency Python 3 MCP server (11 tools):** Built strictly on the standard library (`0` `pip` / `npm` packages) and run on the host over stdio to eliminate sandbox prompts, backed by per-workspace RWLock concurrency and full process-tree cancellation.
- **Token-frugal continuity:** Warm `--resume` sessions, automatic external-edit drift injection, a `<= 2 KB` L1 workspace brief with L1/L2/L3 progressive state, and zero-LLM `claude_handoff` packets.
- **One-command, non-intrusive drop-in:** `init-ai-team.sh` / `init-ai-team.ps1` initialize or upgrade any repository in seconds; wrappers stay in `.agents/scripts/`, and an idempotent `.gitignore` block keeps `.agents/` and `GEMINI.md` out of project commits.
- **Works with any MCP client:** The same zero-dependency `mcp_server.py` runs under Antigravity IDE, Claude Code CLI, Cursor, Windsurf, and generic stdio clients — see [docs/universal-mcp.md](docs/universal-mcp.md).
## Architecture Overview
```mermaid
flowchart LR
U["Operator (macOS / Linux / WSL2)"] --> A["Desktop App Account A (Neon Planner & Coordinator)"]
A -->|Native Plan Save| P[".agents/plans/*.md"]
A --> M["MCP Server (mcp_server.py, 11 Tools)"]
M -->|Worker Threads + RWLock| CR["Claude Runner (claude_runner.py)"]
M -->|Worker Threads + RWLock| AR["Agy Runner (agy_runner.py)"]
CR -->|Exclusive Write Lock| SC["Claude CLI (claude_execute, Warm --resume)"]
AR -->|Exclusive Write Lock, Tier-2 Fallback| AE["agy CLI Account B (agy_execute: hydrogen-xhigh)"]
AR -->|Shared Read Lock| AV["agy CLI Account B (agy_verify Primary: carbon-high)"]
CR -->|Shared Read Lock| OC["Claude CLI (claude_verify Secondary: opus)"]
AR -.->|Shared Read Lock, On-Demand| AP["agy CLI Account B (agy_plan Offload)"]
AR -.->|STATUS READY Confined Write| P
A -.->|UI / Dual-CLI Outage| CV["Carbon / Hydrogen (Desktop Tier-3 Fallbacks)"]
CR <-->|Temp GIT_INDEX_FILE Trees| G["Workspace & Git Trees (No .git/index Mutated)"]
CR <-->|L1/L2/L3 + last_error + session-index| L[".agents/state/ (Gitignored)"]
AR <-->|agy:workspace + planner:workspace + verify| L
```
- **Account A — Desktop App (`Gemini 4 Neon`):** Native codebase planning (direct chat or `/plan` writing `.agents/plans/*.md`), human-in-the-loop alignment, MCP orchestration, double-blind deduplication, and final summaries.
- **Local `claude` CLI (`claude_execute*` / `claude_verify`):** Primary unattended executor (`sonnet` -> Sonnet 5.5) on a warm `"workspace"` session, plus parallel read-only `claude_verify` (`opus` -> Opus 5.5) on major/high-risk changes and automatic primary-audit fallback if `agy` is unavailable.
- **Account B — `agy` CLI (`agy_*` MCP tools):** Primary cross-vendor blind auditor via `agy_verify` (`gemini-4-carbon-high`), Tier-2 fallback executor via `agy_execute` (`gemini-4-hydrogen-xhigh`), and optional on-demand `agy_plan` offload for huge repository scans.
Deep dive into concurrency, blind-review isolation, and state handling: **[docs/architecture.md](docs/architecture.md)**.
### How a Task Flows
1. **Plan (Account A):** Antigravity Neon clarifies requirements and produces a delta plan or `.agents/plans/<nn>-<topic>.md`; huge scans can be offloaded with `agy_plan`.
2. **Execute (Claude):** `claude_execute` / `claude_execute_start` implements the plan unattended on the warm `"workspace"` session with external-drift injection.
3. **Audit (Gemini, optionally + Opus):** `agy_verify` audits every incremental diff read-only; milestones add a parallel, mutually blind `claude_verify`.
4. **Recover & iterate:** On Claude rate limits, `agy_execute` finishes from partial disk edits; failed audits loop back through `claude_execute` with at most 3 fix rounds.
## 30-Second Quick Start
**Prerequisites:**
- **Python 3.9+** and **Git**
- **Claude Code CLI** (`claude`) on `PATH`
- **Google Antigravity Desktop App** + **`agy` CLI** (native on macOS / Linux / WSL2; **no WSL2 needed on macOS or Linux**)
- **Windows PowerShell** supports the full Claude workflow; standalone wrappers under `.agents/scripts/` also run directly from any terminal
| Platform | Installer | Claude workflow (`claude_execute*`, `claude_verify`, `claude_handoff`, `--rollback`) | Account B (`agy_plan`, `agy_verify`, `agy_execute`) |
| :--- | :--- | :--- | :--- |
| **macOS / Linux / WSL2 (native shell)** | `scripts/init-ai-team.sh` | `.agents/scripts/claude-exec.sh` | `.agents/scripts/agy-exec.sh` |
| **Windows PowerShell** | `scripts/init-ai-team.ps1` | `.agents/scripts/claude-exec.ps1` | Via MCP tools (no PowerShell `agy-exec.ps1` yet) |
```bash
# macOS / Linux / WSL2 — clone the kit, deploy into your project, switch into it, then run zero-cost preflight checks
git clone https://github.com/risingsunabc-byte/ai-teams.git
./ai-teams/scripts/init-ai-team.sh /path/to/your-project
cd /path/to/your-project
./.agents/scripts/claude-exec.sh --healthcheck --workspace .
./.agents/scripts/agy-exec.sh --healthcheck --workspace .
```
```powershell
# Windows PowerShell — clone the kit, deploy into your project, switch into it, then run the Claude preflight check
git clone https://github.com/risingsunabc-byte/ai-teams.git
.\ai-teams\scripts\init-ai-team.ps1 -TargetDir "C:\path\to\your-project"
cd "C:\path\to\your-project"
.\.agents\scripts\claude-exec.ps1 -Healthcheck -Workspace .
```
For `--force` in-place upgrades, `--no-git-init`, standalone CLI usage, exit codes, and the startup checklist, see **[docs/mcp-tools.md](docs/mcp-tools.md)**.
> **Prefer the terminal only?** Every capability has a standalone CLI entrypoint under `.agents/scripts/`; the Desktop App is optional for audits, execution, and plan offload.
## Universal MCP Server (Any Client)
`.agents/plugins/claude-executor/mcp_server.py` is a **newline-delimited JSON-RPC 2.0 MCP stdio server** on the Python 3 standard library — no `pip` installs and no platform lock-in. The key difference from Antigravity's `${PLUGIN_ROOT}` config: universal clients point directly at the absolute path of `mcp_server.py`.
| Client | Setup |
| :--- | :--- |
| **Antigravity IDE** | Drop-in plugin via `scripts/init-ai-team.*` (see [docs/mcp-tools.md](docs/mcp-tools.md)) |
| **Claude Code CLI** | `claude mcp add ai-teams -- python3 -B /abs/path/to/mcp_server.py` (project `.mcp.json` also supported) |
| **Cursor** | `.cursor/mcp.json` -> standard `mcpServers` entry |
| **Windsurf / generic MCP clients** | Same `mcpServers` JSON, `command` + `args` + `env` |
| **Plain terminal** | `.agents/scripts/claude-exec.sh` / `agy-exec.sh`, no MCP client at all |
Full copy-paste configs, low-friction setup combinations (you do **not** need two Antigravity accounts or WSL2 on macOS/Linux), and the `CLAUDE_STRICT_MCP_CONFIG=1` recursion guard: **[docs/universal-mcp.md](docs/universal-mcp.md)**.
## 11 MCP Tools at a Glance
| Tool | Purpose |
| :--- | :--- |
| `claude_healthcheck` | Zero-cost Claude preflight: binary, version, `~/.claude`, strict MCP, active jobs & workspace state |
| `claude_execute` | Sync small/medium edits (`150s` default, `165s` cap) on the warm `"workspace"` session with external drift injection |
| `claude_execute_start` | Asynchronous heavy edits (`900s` default, `1800s` max), returns a `job_id` |
| `claude_execute_status` | Polls any async job from `claude_execute_start`, `agy_plan`, `agy_execute`, or `agy_verify` (`async_mode=true`) |
| `claude_execute_cancel` | Cancels any Claude or Agy job, kills the full child process tree, releases the RWLock |
| `claude_verify` | Shared read lock; fresh read-only Opus secondary audit (`diff_scope`: `last_run` / `workspace`), source `claude` |
| `claude_handoff` | Zero-LLM read-only UTF-8 Markdown packet (`continue` incl. `Interrupted Run Recovery`, `fix_review`, `new_plan`) + L1/L2/L3 search |
| `agy_healthcheck` | Zero-cost Agy preflight: binary, version, `~/.gemini/antigravity-cli/settings.json`, verify/execute/plan defaults |
| `agy_plan` | On-demand Account B plan offload: shared read lock, warm `planner:workspace`, safe `.agents/plans/` save on `STATUS: READY` |
| `agy_verify` | Primary cross-vendor blind audit: fresh read-only `agy --mode plan` (`gemini-4-carbon-high`, no `--resume`), source `agy` |
| `agy_execute` | Tier-2 fallback on Claude quota/outage: exclusive write lock, `gemini-4-hydrogen-xhigh`, incremental resume from `last_error` |
Full schemas, defaults, environment overrides, and CLI flags: **[docs/mcp-tools.md](docs/mcp-tools.md)**.
## Documentation Map
| Document | What you'll find |
| :--- | :--- |
| [docs/architecture.md](docs/architecture.md) | Runtime concurrency, core mechanisms, routing matrix, relay sequence, Swarm/Teamwork playbooks, guardrails |
| [docs/mcp-tools.md](docs/mcp-tools.md) | Model routing, all 11 MCP tools, `mcp_config.json` defaults, standalone CLI, init/upgrade, startup checklist |
| [docs/universal-mcp.md](docs/universal-mcp.md) | Universal MCP setup for Claude Code, Cursor, Windsurf, and any stdio client |
| [CHANGELOG.md](CHANGELOG.md) | Every delivered milestone from v2.0 through v2.5.2 and the planned v2.6+ roadmap |
| [CONTRIBUTING.md](CONTRIBUTING.md) | Repository layout, design principles, local verification, and high-impact contribution areas |
| [README_zh.md](README_zh.md) | 简体中文 landing page (this page mirrored) |
| [docs/architecture_zh.md](docs/architecture_zh.md) | 架构与内部机制(中文) |
| [docs/mcp-tools_zh.md](docs/mcp-tools_zh.md) | MCP 工具、CLI、初始化与验证清单(中文) |
| [docs/universal-mcp_zh.md](docs/universal-mcp_zh.md) | 任意 MCP 客户端接入指南(中文) |
## Roadmap & Contributing
With the automated installer builder (`scripts/build_installers.py`) and cross-platform CI now in place, the **#1 open contribution** is:
- **Pluggable external CLI adapters** — Codex CLI, Gemini CLI, Aider, or OpenCode runners that consume zero-LLM `claude_handoff` packets natively. **If you already use those tools or subscriptions, you are exactly who we are looking for.**
- **Windows `agy-exec.ps1` parity** for Account B workflows beyond the POSIX wrappers.
- **Token/cost summaries** across `claude` and `agy` rendered into `workspace-brief.md`.
- **Pure CLI / single-account examples** for running without the Antigravity Desktop App (see [docs/universal-mcp.md](docs/universal-mcp.md) for the current combinations).
Start with [CONTRIBUTING.md](CONTRIBUTING.md), then open an issue at [github.com/risingsunabc-byte/ai-teams/issues](https://github.com/risingsunabc-byte/ai-teams/issues).
## License
Licensed under the **Apache License 2.0** — see [LICENSE](LICENSE).
**Topics:** `Google Antigravity` · `Antigravity CLI (agy)` · `Claude Code CLI` · `Model Context Protocol (MCP Server)` · `GEMINI.md` · `Multi-Agent Coding` · `Cross-Vendor Code Review` · `Double-Blind AI Verification` · `Anthropic Claude (Sonnet / Opus)` · `Google Gemini` · `Quota Failover` · `Universal MCP` · `macOS / Linux / WSL2 / Windows PowerShell`
TDQS
Scored across 11 tools
The claude_ vs agy_ prefixes cleanly separate the two backends, and within each backend the verbs (healthcheck, execute, verify, plan, handoff) are distinct. The only soft overlaps are claude_execute vs claude_execute_start (sync vs async, explicitly disambiguated by latency guidance) and claude_verify vs agy_verify (intentionally parallel double-blind auditors, per descriptions).
Names consistently use snake_case with a backend prefix (claude_/agy_), producing a readable two-family convention. The minor deviation is structural rather than lexical: Claude exposes an explicit execute_start/execute_status/execute_cancel trio while agy_* folds async into an async_mode flag, and claude_handoff has no agy counterpart.
Eleven tools sit squarely in the well-scoped range, and each maps to a genuine lifecycle stage (healthcheck, plan, execute, poll, cancel, verify, handoff). No tool looks redundant or like padding for the orchestration domain.
The lifecycle is largely covered: readiness checks, execution (sync + async with polling/cancel), independent verification, and a zero-cost handoff packet, with claude_execute_cancel explicitly handling agy jobs too. Minor gaps exist — no planning tool on the Claude side and no job-listing/introspection tool beyond status for a single job_id.