◉ANTIGRAVITY LABJP
Articles/Editor View
⟐ Editor View/2026-07-01Advanced

Faster Substring Search Changes How You Should Let Agents Explore Code

The 6/26 update made substring search noticeably faster. Rather than treating it as a comfort improvement, here is how to redesign the way agents explore code, budget context, and verify their targets, with measurements from indie development.

Antigravity416code explorationagent design12context management3search3

✦ Premium Article

The 6/26 update made Antigravity's substring search visibly faster. On a monorepo of roughly 20,000 files, a search that used to make me wait a few breaths now returns almost instantly.

But what mattered to me was not the speed itself. It was what came after. While search was slow, we quietly designed around it by having agents search as little as possible. Once search is cheap, that assumption deserves to be rebuilt. This article is about turning the substring-search speedup into an actual redesign of how agents explore code, measured against my own indie development work.

What we quietly gave up when search was slow

When you let an agent work in a codebase, exploration splits into two broad styles: raw substring search (grep-style) to pin down a lead, and semantic search that surfaces candidates by conceptual closeness.

Slow search makes each grep expensive. Designs then drift toward "search rarely, load a large context up front." I used to have the agent read entire likely directories before starting. That looks efficient, but it fills the context with irrelevant files and blurs the judgment that actually matters.

Fast substring search tips the scale back. A design closer to how humans actually navigate — search narrowly first, read only what you need — becomes practical again.

Measure the change before trusting the feel

Before talking about feel, I turn exploration cost into numbers. I use a thin wrapper that records searches, total tokens read, and round-trips per task.

#!/usr/bin/env bash
# agy-probe.sh — record per-task cost of an agent run
# usage: ./agy-probe.sh "investigate the AdMob consent flow, scoped to the consent module"
set -euo pipefail
 
TASK="$1"
LOG="probe_$(date +%Y%m%d_%H%M%S).jsonl"
 
agy run --json-events --prompt "$TASK" | while IFS= read -r line; do
  echo "$line" >> "$LOG"
done
 
python3 - "$LOG" << 'PY'
import json, sys
searches = reads = tokens = turns = 0
for ln in open(sys.argv[1]):
    ev = json.loads(ln)
    t = ev.get("type")
    if t == "tool_call" and ev.get("name") in ("search", "grep"):
        searches += 1
    if t == "file_read":
        reads += 1
        tokens += ev.get("tokens", 0)
    if t == "assistant_turn":
        turns += 1
print(f"searches={searches} file_reads={reads} read_tokens={tokens} turns={turns}")
PY

Running the same investigation task ten times each on pinned before/after versions produced this trend in my environment. These figures are one sample from my own monorepo.

Metric (avg of 10)Old design (read broadly)New design (search narrowly)
Search calls3.211.4
Tokens read~48,000~16,500
Assistant round-trips6.15.4
Edits to the wrong file20

Search calls actually went up. That is not the point. The point is that tokens read dropped to a third while wrong-file edits went to zero. Because search got cheap, there was room to narrow down before reading.

✦

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 concrete rule for rebalancing grep-first versus semantic search now that substring search is fast
✦A measurement script that tracks exploration cost per task in tokens and round-trips
✦How to build a scoping step so agents don't trust the first search hit blindly
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

⟐ Editor View2026-11-01
Can't Find the Conversation History Page? Three Ways Back to Past Chats After Antigravity 2.28.2
If the Antigravity app no longer shows a conversation history page after an update, here is where to look instead: the search button, the conversation navigator, and a full-text search of the brain folder, plus one habit that makes chats findable later.
⟐ Editor View2026-10-28
Antigravity IDE Freezes After Opening a Folder on Linux + Nvidia: A Triage Order
A Linux + Nvidia report says the IDE stops responding seconds after a folder opens. What the thread already ruled out, and the order I'd try next. Cause unconfirmed.
⟐ Editor View2026-10-21
I Wondered Whether to Sort My Diffs by Machine, So I Ran It on 106 Commits. It Mattered for 8, and for One 1,776-File Change
I wrote a small script that orders a git diff by reading priority and ran it on 106 recent commits. It earned its place in 8 of them and one bulk change. Rules, full code, and the silent misclassification traps.