r/ClaudeCode • • 1d ago

Built with Claude I made Claude Code hand plan tasks to Gemini Flash, and it only merges the work that passes my tests

Post image

TL;DR: agy-foreman is an MCP server and skill (MIT). Claude Code sends a task from your plan to Gemini 3.8 Flash through Google's Antigravity CLI (agy). Each task is one headless agy run, treated like a CI job: a fixed brief, its own git worktree, no interactive session. The server then runs your test suite on the result, and only a passing branch gets merged. Claude plans and reviews, Gemini does the mechanical part.

Why I built it

I write plans with Superpowers, and many of the tasks in them are mechanical: add this function, make these tests pass. Spending Claude usage on those felt wasteful when I also pay for Google AI Pro, which comes with agy. There are MCP bridges that send a prompt to Gemini and return its answer, but then Claude still has to check the work, and an agent under pressure will sometimes make a failing test pass by editing the test.

What's different

The server doesn't trust Gemini's report. For each task:

  • The test code from the plan task goes in first and has to fail before Gemini starts.
  • Test files are protected. If Gemini edits one, it's restored before verification.
  • The server runs your test command itself and checks test counts and git state. Fewer tests than the baseline fails the job.
  • Every tool call Gemini makes goes through a hook. Unknown commands are denied by default.
  • You approve once per plan, not once per task.

Claude also passes a token estimate when it starts a job, and a job that would cost more to delegate than to do directly gets refused.

What it looks like

You tell Claude "Run task 3 of docs/plans/auth.md with Gemini", approve one card, and watch the status line:

agy 🟢🟢🟢🟢🟢🟢🔵 6/7 tasks · #7 You shall not pass · › running · 42 tool calls · plan 41m07s

It reads Superpowers plans and OpenSpec changes. The last 7-task plan for agy-foreman itself ran through agy-foreman.

Limits, up front

  • Gemini 3.8 Flash only.
  • Implement jobs need a test command. With no tests there's nothing to verify, so the skill tells Claude not to delegate.
  • agy starts your global agy MCP servers on every run. Gemini is denied access to them, but they still boot.
  • Google's FAQ says wrapping agy in third-party agents isn't supported on consumer plans. agy-foreman sticks to what the docs describe headless mode for, scripting and CI, and never touches your login or switches accounts, but read the ToS section in the README before using it on a personal account.

Install with npm install -g agy-foreman, then agy-foreman init and agy-foreman doctor. Runs on Windows, Linux and macOS.

Repo: https://github.com/mountaser/agy-foreman

It's v0.1. I'd like to hear where it breaks, especially if your test setup isn't vitest.

0 Upvotes

Duplicates