◉ANTIGRAVITY LABJP
Articles/Agents & Manager
◈ Agents & Manager/2026-08-05Advanced

Reading the Same History in 38 Seconds — or 0.4: Handing a Read-Only .git to Your Agent

Antigravity CLI 1.1.10 lets the sandbox read .git without write access. I built a per-session history summary two ways, measured a roughly 100x speed gap, traced it to process spawn cost, and added a guard for shallow clones that silently corrupt the numbers.

Antigravity CLI42SandboxGit13Agent Design8Performance Measurement

✦ Premium Article

This morning I ran git log --oneline on a local copy of a repository and got exactly one line back.

I froze for a few seconds, convinced the history was gone. Nothing was broken. The copy had been cloned with --depth 1 for automated work, and one commit was all the history it had ever contained.

That small stumble collided with a design I had been sketching. Antigravity CLI 1.1.10 allows the sandbox to read .git without write access — history-aware work no longer requires handing over write permissions. I was about to build on exactly that: a small history summary handed to the agent at the start of every session.

Before building it, I wanted real numbers. I wrote the summary builder two different ways and measured both across increasing commit counts. The two produce identical output, but one takes 38.4 seconds where the other takes 0.38. The cause of the gap was not the amount of data.

Passing History Without Passing Write Access

The Antigravity changelog for 1.1.10 lists read-only sandbox access to .git as a single line item. From a permissions-design perspective, I think it changes more than its length suggests.

I have wanted agents to see history for a long time. When I ask for a review, it matters whether the touched files sit in a part of the codebase that has been breaking recently. When I ask for test reinforcement, knowing which files tend to change together lets the agent flag the sibling file I forgot to update.

None of that justifies opening .git for writing. A process that can rewrite refs and objects holds far more power than "read the history" requires. Pass the information, withhold the authority. Read-only .git implements that separation directly, with no workaround.

When I think about access control, I try to decide what I am not passing first. Here, the answer was: no write access, and no raw full history. The reason for the second exclusion comes with numbers in the next section.

What to Extract: a 1.7KB Context Pack

Anything handed over every session has to be small, or the habit dies. I narrowed the summary to three ingredients.

First, churn hotspots — the files that change most often. Recent bugs overwhelmingly live where recent edits happen. Second, co-change pairs — files that appear in the same commit together, a workable approximation of "if you touch this, look at that." Third, per-author commit counts. Even for an indie developer working alone, seeing the ratio of automated to manual commits changes how you read a log.

I call the resulting JSON a history context pack. Measured sizes:

CommitsPack size.git size
5001,679 bytes—
2,0001,702 bytes2.0 MB
8,0001,734 bytes7.2 MB

Multiplying the history by 16 grows the pack by 55 bytes. The pack stores only top-N aggregates, so history length barely moves the output size. If 7.2 MB of history folds into 1.7 KB, handing it over at every session start is entirely reasonable.

✦

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
✦Two implementations producing identical history summaries — one takes 38.4 seconds, the other 0.38 — and the spawn-cost analysis that explains the gap
✦A history context pack design that compresses 8,000 commits into about 1.7KB (hotspots, co-change pairs, author distribution)
✦A reproduction of how depth-1 clones silently corrupt the aggregation, plus a rev-list --count startup guard that fails closed
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-09-29
Stopping One Sub-Agent Without Taking the Other Seven Down With It
One of eight parallel sub-agents went wrong and I wanted to stop only that one. Here is how Antigravity, Claude Code, and Gemini CLI differ in what a stop actually stops, and the per-child output layout plus merge script that keeps a halted child's partial files out of the rest.
◈ Agents & Manager2026-09-24
A Small Guard Script That Catches an Unattended Agent Rewriting Its Own Settings
After reading a report of an agent widening its own read-only limits by editing settings.json, I wrapped my overnight headless runs in an outside guard. Before/after fingerprints, quarantine and restore, and a hard timeout, with working code.
✦ Tips2026-08-06
Seven Characters Don't Only Point at Commits — Measuring When Your Agent's Recorded Hashes Stop Resolving
Short commit hashes recorded by an agent quietly stop resolving as a repository grows. Measuring where ambiguity begins, fixing the recording side, and building a batch verification gate.