I only realized my saved conversations had been quietly eating disk space on Saturday evening, while reading the release notes for Antigravity CLI 1.5.19. That version added agy conversations list, which shows how much space each conversation takes, and clean, which deletes old ones in bulk.
That night I decided "old conversations go through clean" and started writing the steps down. The next morning 1.5.20 shipped with compact, a command that shrinks conversations instead of deleting them. My half-written notes were out of date before I'd finished them.
Here's where I landed: compact first, and clean only what is still too heavy afterward. I no longer delete anything from the config folder by hand. Below is how the three approaches compare, and the small script I now run before any cleanup.
What each approach removes, and what you can get back
I'll stick to what the official release notes say. Deleting by hand isn't an official procedure, so that row describes what I used to do.
| Approach | What happens | Reversible? | Subagents and backups |
|---|---|---|---|
agy conversations compact (1.5.20+) | Shrinks idle saved conversations by deduplicating repeated turn metadata | Yes. The original files are kept as backups, and --undo restores them | Backups still take space until you run --delete-backups |
agy conversations clean (1.5.19+) | Deletes old or oversized conversations, selected with --older-than, --keep-recent, --min-size, or explicit IDs | No | Subagent conversations go with them. Since 1.5.20, compact backups are removed too |
| Deleting files in the config folder by hand | Whatever you select disappears | No, unless you made your own backup | Hard to tell from the outside which files belong to which parent |
Laying it out like this, I found three questions were enough: can I undo it, does it handle subagents in one pass, and will it take out a conversation I still want to resume?
Why I stopped deleting by hand
Before 1.5.19, whenever disk space bothered me, I'd sort the config folder by date and remove whatever looked old. Looking back, I couldn't have explained exactly what I was deleting.
The release note for clean goes out of its way to say it deletes conversations "together with their subagents." My reading is that parents and subagents are stored separately. Delete only the parent by hand and the subagent files may linger with no owner. Delete only a subagent and I honestly don't know what happens when the parent is reopened.
The storage layout can also change between versions — 1.5.20 added compact backups, a new kind of file, the very next day. Only the CLI knows how it stores things, so the CLI should do the cleanup. That's the line I drew.
Why compact comes before clean
compact keeps the originals as backups while it shrinks the conversation. You can preview with --dry-run, skip the prompt with --yes, and roll back with --undo. In other words, a mistake is recoverable.
clean is not. And since 1.5.20, cleaning a conversation also removes its compact backups. Run clean first and you may delete conversations that would have been fine with a shrink.
So my order is:
- Record current usage with
agy conversations list - Check the estimate with
compact --dry-run, then run compact - Use the CLI normally for a few days; if nothing breaks, remove backups with
--delete-backups - Only then, check
clean --dry-runand delete what is still too heavy
Step 3 is the part that matters most. I only close the way back after I've resumed a few compacted conversations and confirmed nothing is off.
Keeping clean away from conversations your scripts resume
One more thing deserves care if you resume a fixed conversation from a script with --conversation. The 1.5.20 notes say that headless runs (-p or --input-format stream-json) given an unknown conversation ID used to start a fresh conversation silently and exit with code 0. Since 1.5.20 they stop immediately with a non-zero conversation "<id>" not found error.
Put the other way around: on an older version, cleaning that conversation would have left your scheduled job "succeeding" every day with no context at all. On 1.5.20 the job stops — but by then the conversation is already gone.
So I keep a file listing the conversation IDs I want to protect, one per line, and the script refuses to run clean if any of them appear in the dry-run output. It also saves a dated snapshot of the list before and after.
#!/usr/bin/env bash
# agy-conv-tidy.sh — record, shrink, preview, then delete, in that order
# Usage: ./agy-conv-tidy.sh compact … shrink only (reversible)
# ./agy-conv-tidy.sh clean <clean options> … preview, check pins, then delete
set -euo pipefail
MODE="${1:-compact}"; shift || true
LOG_DIR="$HOME/agy-tidy-log" # where cleanup records are kept
PINNED="$HOME/.agy-pinned-conversations" # conversation IDs to protect, one per line
STAMP="$(date +%Y%m%d-%H%M%S)"
mkdir -p "$LOG_DIR"
agy --version > "$LOG_DIR/$STAMP-version.txt" 2>&1 || true
agy conversations list > "$LOG_DIR/$STAMP-before.txt"
case "$MODE" in
compact)
agy conversations compact --dry-run | tee "$LOG_DIR/$STAMP-compact-plan.txt"
read -r -p "Shrink these conversations? [y/N] " ans
[ "$ans" = "y" ] || { echo "Cancelled"; exit 0; }
agy conversations compact --yes
;;
clean)
[ "$#" -gt 0 ] || { echo "Pass clean options (see: agy conversations clean --help)"; exit 1; }
agy conversations clean --dry-run "$@" | tee "$LOG_DIR/$STAMP-clean-plan.txt"
if [ -s "$PINNED" ]; then
while IFS= read -r id; do
[ -z "$id" ] && continue
if grep -qF "$id" "$LOG_DIR/$STAMP-clean-plan.txt"; then
echo "Pinned conversation $id is scheduled for deletion. Aborting."; exit 2
fi
done < "$PINNED"
fi
read -r -p "This cannot be undone. Delete these? [y/N] " ans
[ "$ans" = "y" ] || { echo "Cancelled"; exit 0; }
agy conversations clean "$@"
;;
*) echo "Specify compact or clean"; exit 1 ;;
esac
agy conversations list > "$LOG_DIR/$STAMP-after.txt"
diff "$LOG_DIR/$STAMP-before.txt" "$LOG_DIR/$STAMP-after.txt" || trueI deliberately didn't hard-code values for --older-than or --min-size. The release notes don't spell out the unit format, so the script just passes through whatever you've confirmed with agy conversations clean --help.
The pin check uses a plain grep -qF because the dry-run output format isn't documented. If the ID string shows up anywhere, it trips — the simplest check that survives a format change. It isn't airtight, so I still read the preview myself before pressing y.
What I haven't confirmed yet
I should be upfront: I haven't verified whether conversations saved by the desktop app fall within clean's reach. 1.5.20 fixed agy acp listing conversations saved by other apps, such as the Antigravity desktop app. That tells me conversations from different apps can sit side by side.
If you use the desktop app and the CLI together, I'd suggest scanning the --dry-run list for anything you don't recognize before passing --older-than. Adding --keep-recent so your latest conversations always survive is another reasonable guard.
If you'd like to keep the content of a conversation before removing it, I wrote up the options in three ways to keep a chat record when the Export button does nothing.
What to try next
Run agy conversations list once and just look at which conversations are heavy. Deciding what to delete can wait until after that.
Tonight I'm only running the compact half of the script and watching it for a few days. clean waits until I've resumed some compacted conversations and nothing has gone wrong.
If you resume the same conversation from scheduled jobs, it's worth designing how those jobs fail before you clean up. My notes on building runs that stop reliably when something unexpected happens are in the premium article Guarding the Turn Boundary in Non-Interactive Runs. As an indie developer running things on a small scale, I'm usually the only one who would notice a cleanup gone wrong, so keeping a way back is the one habit I don't want to give up.