◉ANTIGRAVITY LABJP
Articles/Agents & Manager
◈ Agents & Manager/2026-06-30Advanced

When the Agent Hands You 1,400 Replacements in One Commit, Ask for Batches Instead

Ask Antigravity to run a large codemod and you can get back one unreviewable commit. Here is a small design — ast-grep rules plus a verified batch driver — that splits a mechanical replacement into the machine's job and the human's check, with working code.

Antigravity419codemodast-greprefactoring8ai-agent18code-review11indie-developer5

✦ Premium Article

The morning a codemod came back as one giant commit

One morning I set out to move event tracking across my four indie apps onto a consent-aware wrapper. The old Analytics.logEvent("name", props) calls needed to become track("name", props), which checks consent state before sending. A plain mechanical job.

I asked Antigravity to "move everything onto track." It returned a single commit that rewrote 1,400 call sites across 230 files. The diff was endless, and I could not tell which parts were safe and which were risky.

The replacement itself was correct. The problem was that it arrived in a shape no human could verify. A change you cannot review does not ship, even when it happens to be right.

So rather than restate the recipe up front, let me walk through why I sent it back. What I landed on was a small design that re-splits the work into the machine's job and the human's check.

Why "one commit for everything" becomes unreviewable

A huge mechanical diff mixes changes of different natures.

Most of it is purely formulaic. Argument order and meaning are unchanged, and there is nothing worth reading. But buried inside are a few sites where meaning shifts — for example, calls that used to fire before consent now behave differently once the wrapper gates them.

Finding the dozen meaning-changing sites among 1,400 by eye is not realistic. The reviewer loses focus and waves it through with "probably fine." That was the real trap.

What the machine can safely fix should not need review; only what a human must judge should be carved out small. Without that separation, volume drowns quality.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦A verification gate that slices 1,400 replacements into 25-file batches, each commit passing typecheck and tests
✦How to write ast-grep rules that separate what the machine can safely fix from what a human must judge
✦How to cap files-per-batch so the agent cannot pile up a giant diff
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◈ Agents & Manager2026-04-13
Building a Coding Agent System with Gemma 4 × Antigravity — A Complete Implementation Guide for Code Review, Test Generation, and Refactoring
A hands-on guide to building a 3-agent collaborative system using Gemma 4 and Antigravity AgentKit 2.0, covering code review, automated test generation, and refactoring suggestions. Covers code, Cloudflare Workers deployment, one month of production numbers, and five pitfalls.
◈ Agents & Manager2026-11-19
Before an Agent Reads Your Issues: Splitting GitHub Actions Into a Reader Job and a Writer Job
Anyone can write an issue body. When an agent reads it inside GitHub Actions, split the workflow into a reader job with no write access and a writer job that never runs the agent, keep the body out of the shell, and check the agent's proposal with a small Python script. Working code included.
◈ Agents & Manager2026-11-14
The Agent PR I Approved Was Rewritten a Week Later: Counting Which Lines Survive 14 Days with git blame
Agent PRs often sail through review, yet the same lines get rewritten soon after merge. Here is a small script that uses git blame to count how many of a commit's added lines are still there 14 days later, the date-ordering trap that skewed my numbers, and how I decide where to look next.