◉ANTIGRAVITY LABJP
Articles/Agents & Manager
◈ Agents & Manager/2026-10-25Intermediate

An Unattended Job Stopped With 11MB Free. du Counted Only 59MB; the Other 9GB Was Somewhere I Couldn't See

Two bash scripts that measure free space on the filesystem you are about to write to and stop an unattended agent run before it starts. Includes why du and df disagreed and how to spot a shortage you cannot fix.

Antigravity399unattended runs7disk spacebash4indie developer18preflight4

✦ Premium Article

I run unattended agent work at fixed times, morning and evening. One day it stopped at the same early step twice in a row.

The first log said "free: 70MB" and the second said "free: 178MB". Both were aborted by the environment check before the repository was fetched, so nothing was changed in the articles or the repository.

After reading the logs, I suspected my own working directory first. Running du on my home directory gave 3.5GB, and for a moment I thought I had found the culprit.

Here is the conclusion up front. What an unattended job should measure is not the size of your home directory but the free space of the filesystem you are about to write to. And before it stops, it should record whether any of the shortage is something you can clean up yourself.

This article keeps the full text of the two bash scripts I use for that check, along with the numbers they actually printed.

The numbers from the day it stopped twice

First, the logs and the values I measured afterwards.

WhenFree on the write targetWhat happened
First run (morning)70MBBelow the 800MB standard and below the 300MB floor. Ended without fetching or changing anything
Second run (evening)178MB175MB even after clearing caches. Aborted for being under 300MB
While writing this article11MB9,441MB of a 9,980MB partition used. Inodes at 64%

Free space had been shrinking little by little through the day. Both times the guard worked and stopped without leaving a half-written file. That "stop without writing" behavior is something I built on purpose into the entry-point script described later.

du said 3.5GB while df said 100%

Running du -sm on my home directory returned 3,501MB. The partition showed 9,441MB used, so I assumed the rest was elsewhere and looked at the breakdown. That is where the numbers explained themselves.

How I measuredValueWhat it told me
du on the whole home directory3,501MB3,443MB of it was the contents of a mounted shared folder
df on the mount309,758MB freeA different filesystem with about 300GB free. The shortage was not there
du limited to the same partition (-x)60MBWhat I actually keep there is the 59MB repository fetched for this article, plus a little
df on the partition9,441MB usedEven after subtracting my 60MB, about 9,382MB cannot be explained

Most of the 3.5GB belonged to another filesystem. The du on my home directory was not measuring consumption on the partition that was running out.

So who was using the remaining 9GB? Looking at the top of the partition, I found about 290 per-session directories. Most belong to other runs. Permissions keep me from opening them, so du cannot count them either.

On this partition, then, no matter how much of my own directory I clean up, free space barely moves. I needed to know that before sending any instruction to clean up.

✦

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
✦You'll be able to measure free space on the write target with one command before an unattended job starts, and stop without writing anything when it is short
✦You'll be able to tell, within minutes, how much of a full disk you can clean up yourself and how much you cannot, when du is small but df shows 100%
✦You'll be able to separate 'did not start' from 'failed' with an exit code, so the next morning's log tells you the cause the moment you open it
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-10-24
I Added pipefail and a Passing Check Turned Red: The False Failure That Starts Once Output Passes 8 KB
Adding pipefail can turn a passing check red. I reproduced the false failure that appears once output passes 8 KB on 1,122 files, then built a file-based runner and a canary.
◈ Agents & Manager2026-10-22
17 Dead References in My Handover Docs Turned Out to Be 2 Files, and the Real Risk Was a Different Site's Playbook Mixed In
The full Python script I use to check the root .md files an agent reads. My naive version counted 17 dead references; fixed, it was 7 across 2 files. Then it missed the real problem. Here is how I found it.
◈ Agents & Manager2026-10-16
Before Handing an Agent a .zip: Dropping .git Cut 29 MB to 15 MB, and 28 Secret Warnings Turned Out to Be Noise
Antigravity app v2.23.0 lets you attach a .zip. I packed my own repository to count what .git weighs and how many secret-scan warnings are false alarms, and I leave the full Python script that excludes, scans, and writes a manifest.