ANTIGRAVITY LABJP
Articles/Antigravity Basics
Antigravity Basics/2026-05-22Intermediate

Why Antigravity's Workspace Indexing Stalls on Large Repositories — and How to Fix It

A walk-through of why Antigravity's indexer can spin forever on a monorepo, with the diagnostic steps and fixes I use on my own 12 GB repository.

antigravity429indexing2monorepo6performance12troubleshooting105

As an indie developer (Hirokawa, running the Dolice apps), my iOS / Android codebase has been growing since 2014. It now weighs in at over 12 GB and roughly 3.8 million files even after I exclude node_modules, and the apps that ship out of it have crossed 50 million combined downloads on the App Store and Google Play. The first few times I opened this monorepo in Antigravity, the workspace indexer spinner in the bottom right kept turning for forty minutes, and any attempt to ask the agent to read ./apps/wallpapers/src/store/category.ts came back with "still indexing workspace."

I want to share the reasoning I use to triage Antigravity's workspace indexing when it stalls, and the order in which I try fixes that have actually worked. Setup at the time of writing is macOS 15.4, Antigravity v0.34, M2 Pro 32 GB.

Telling the symptoms apart

The first thing is to decide whether the indexer is slow, blocked, or looping. The three look identical from the sidebar, but their fixes are completely different.

Slow: CPU is sustained at 200–400%, memory is flat, disk IO is constant. This will finish if you wait.

Blocked: CPU is near idle, the antigravity-helper (Renderer) thread shows Wait in Activity Monitor, and Console.app is full of EAGAIN or EMFILE. Something external is starving the indexer.

Looping: CPU is pegged, but the file count refuses to advance. The output log shows the same paths over and over. That points to a symlink cycle or a fight between the file watcher and the re-indexer.

The sidebar spinner alone cannot tell you which case you are in. Always open Antigravity → View → Output → Antigravity Indexer and read the last few dozen lines.

Cause 1: caches that aren't excluded

Antigravity respects .antigravityignore and .gitignore, but only when they live at the workspace root. In my repo, I had ./build/DerivedData set up as a symlink to ~/Library/Developer/Xcode/DerivedData, holding 4.2 GB and around 900k files. None of it was excluded, so the indexer was patiently reading every byte.

The fix is to drop a root-level .antigravityignore that takes out the usual suspects:

cat << 'IGNORE' > .antigravityignore
# Build artifacts
build/
dist/
out/
.next/
.turbo/
.cache/
 
# Native build outputs
DerivedData/
.gradle/
.cxx/
Pods/
android/.cxx/
android/app/build/
ios/build/
ios/Pods/
 
# Dependency caches
node_modules/
.pnpm-store/
.yarn/cache/
.yarn/install-state.gz
vendor/
.bundle/
 
# Media that won't help the agent
assets/raw/
assets/originals/
*.psd
*.sketch
*.fig
*.mp4
*.mov
 
# Database & coverage
*.sqlite
*.duckdb
coverage/
playwright-report/
test-results/
IGNORE

After saving the file, restart Antigravity or run Antigravity: Reindex Workspace from the command palette (⌘⇧P). Without a restart, the in-memory index may stay live and mask the improvement.

Cause 2: symlink cycles

If you have hand-rolled symlinks to share node_modules across projects, or a pnpm workspace configuration that points at unexpected paths, the indexer can walk the same directory tree forever.

The fastest check is find at the workspace root:

# List every symlink
find . -type l -not -path "./node_modules/*" -not -path "./.git/*" \
  -exec ls -la {} \; 2>/dev/null
 
# Surface ones that look cyclic
find . -type l -not -path "./node_modules/*" \
  -exec sh -c 'realpath "$1" 2>/dev/null | head -c 200; echo " <- $1"' _ {} \;

Delete the unnecessary ones, or add them to .antigravityignore. In my case I dropped a ./shared -> ../shared-lib link and reconfigured pnpm's workspaceRoot instead. The indexer's progress became predictable, and as a bonus the agent's reasoning on import statements got noticeably better.

Cause 3: file descriptor limits

EMFILE: too many open files is a common failure mode for Antigravity's indexer on macOS. The default ulimit -n is 256, which is nowhere near enough for a monorepo.

ulimit -n
# → 256 means you'll hit EMFILE

The permanent solution is ~/Library/LaunchAgents/limit.maxfiles.plist followed by a reboot, but I usually start with a per-shell override to validate the hypothesis:

# Bump it for this shell
ulimit -n 65536
 
# Launch Antigravity from this shell
open -a "Antigravity" .

On my machine that single change cut the indexer from 24 minutes to 3 minutes. As a side effect, the agent's read_file tool stopped hanging too — both symptoms shared the same root cause.

Cause 4: backup and anti-malware software competing for the same files

If Time Machine, Backblaze, or a corporate EDR agent is sweeping the same directory tree, files get locked the moment the indexer finishes reading them, the indexer notices the change and re-reads, and CPU burns without progress.

The fix is to add the repository root to the exclude list of whichever tool is running. For Time Machine that's System Settings → General → Time Machine → Options → Exclude these locations. Whether you can safely exclude the entire project root depends on your company policy, but development directories that change every few minutes are usually a poor fit for hourly backups anyway.

Cause 5: GPU embedding failing to initialize

Since v0.32, Antigravity generates local embeddings for whole-workspace semantic search. When Metal initialization fails, it silently falls back to CPU, which is excruciatingly slow. Look for a line like Failed to acquire Metal device, falling back to CPU in Output → Antigravity Indexer.

The workaround is to flip Settings → Antigravity → Indexer: Embedding Provider from Local (Metal) to Remote (Google), or to Disabled if you'd rather skip semantic search entirely. I run with Disabled when I'm on a flaky connection, which forces me to point the agent at files explicitly (read this file: <path>). Search recall goes down, but latency becomes predictable, and total wall-clock time for a session usually comes out shorter.

A staged recovery routine

Distilled to a checklist, here is the order I work through:

  1. Run Antigravity: Reindex Workspace once (clears transient inconsistencies).
  2. Open Output → Antigravity Indexer and read the last 50 lines.
  3. Check that .antigravityignore exists at the repo root; drop the template above if not.
  4. Enumerate symlinks with find -type l and exclude any that look cyclic.
  5. Check ulimit -n; if it's still 256, raise to 65536 and relaunch Antigravity from that shell.
  6. Add the repository root to Time Machine / backup tool exclusions.
  7. Switch Embedding Provider to Remote or Disabled.
  8. As a last resort, delete ~/Library/Application Support/Antigravity/Indexes/<workspace-hash> and let it rebuild from scratch.

Step 8 means waiting tens of minutes for a fresh build, so I save it for nights or before stepping away from the desk.

Preventive habits

The single thing that helps me most is dropping the .antigravityignore template into every new project before I let Antigravity touch it. Build artifacts don't need to be read by a human or an agent, and excluding them often cuts indexing time by an order of magnitude.

The second is, when I'm working on a corporate-issued Mac with an EDR running, I switch the Embedding Provider to Remote immediately. Watching the indexer burn CPU on a Metal fallback because the device isn't allowed to acquire the GPU is a mistake I've made more than once.

Further reading

I revisit this checklist whenever the same shape of problem comes up. If even one step here saves you some time, that makes me happy.

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 →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

Antigravity2026-05-31
Why Your Antigravity Agent Stops Mid-Task with 429 RESOURCE_EXHAUSTED, and How to Fix It
When you hand a long task to an Antigravity agent, it sometimes halts halfway with a red 429 RESOURCE_EXHAUSTED. That is a rate-limit or quota signal, not a bug. Here is how I diagnose the three flavors of 429 in production, and how to keep your agent from stalling on the same wall twice.
Antigravity2026-05-28
Fixing Antigravity Google Sign-in That Won't Return From the Browser
When you press Sign in with Google in Antigravity and the browser just hangs without returning to the editor, the cause is rarely a single thing. Here is how I narrow it down across four layers — callback port, third-party cookies, stale session files, and network path — using only commands I keep close on every machine.
Antigravity2026-05-25
Why Antigravity Agents Hang on ssh, sudo, and git rebase -i — Diagnosing and Permanently Fixing the Missing TTY Problem
When you ask an Antigravity agent to deploy, the terminal panel stops on 'password:' and never moves. The agent isn't broken — the shell behind it has no PTY, so interactive prompts have no one to answer them. Here's how to diagnose and remove every interactive command from your agent workflow.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →