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 CLI21Sandbox2Git8Agent 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-07-19
The Morning It Wrote Outside the Working Folder: Vetting Every Write Path in One Function
Antigravity CLI 1.1.3 closed a bug where always-proceed mode silently auto-approved writes outside the workspace. Here is a small guard that vets every write path with nothing but path canonicalization and a containment check, plus an escape-attempt test suite.
Agents & Manager2026-07-18
Treating Code Search as a Contract: Measuring the /codesearch Regex Default
Antigravity CLI 1.1.3 interprets /codesearch queries as regular expressions by default. I measured the gap between regex and literal matching across a 979-article repository and turned the results into three query rules and a drift harness.
Agents & Manager2026-07-15
When Your Agent Commits a .bak File: Why Fix-Tool Artifacts End Up in Git
Backup files like .bak and .orig slip into commits after an agent runs a --fix tool. Here are the reproduction conditions, the real root cause, and three fixes: narrowing the staged scope, wrapping the fixer, and adding a pre-commit extension gate.
📚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 →