◉ANTIGRAVITY LABJP
Articles/Editor View
⟐ Editor View/2026-11-29Intermediate

Delete or Shrink? Comparing agy conversations clean, compact, and Manual Cleanup, and the Order I Settled On

A comparison of agy conversations clean (CLI 1.5.19), the new compact command (1.5.20), and deleting files by hand — judged by reversibility, how subagents and backups are handled, and the risk to conversations your scripts resume — plus a pre-flight script for safe cleanup.

Antigravity CLI51agy conversationscleancompactdisk usage

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.

ApproachWhat happensReversible?Subagents and backups
agy conversations compact (1.5.20+)Shrinks idle saved conversations by deduplicating repeated turn metadataYes. The original files are kept as backups, and --undo restores themBackups 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 IDsNoSubagent conversations go with them. Since 1.5.20, compact backups are removed too
Deleting files in the config folder by handWhatever you select disappearsNo, unless you made your own backupHard 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:

  1. Record current usage with agy conversations list
  2. Check the estimate with compact --dry-run, then run compact
  3. Use the CLI normally for a few days; if nothing breaks, remove backups with --delete-backups
  4. Only then, check clean --dry-run and 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" || true

I 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.

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 →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

⟐ Editor View2026-11-27
Writing long prompts in my editor with Ctrl+G, after code closed instantly and came back empty
Why the editor opened by Ctrl+G in Antigravity CLI can return an empty prompt, how to fix it with a wait flag, a tiny wrapper that keeps your drafts, and how writing in an editor changed the shape of my instructions.
⟐ Editor View2026-11-17
Antigravity Sign-In Never Comes Back in Zed over SSH — Log In on the Remote Machine First
When Antigravity (agy acp) stalls at 'Launching browser login flow...' in a remote Zed session, here is how to tell auth from startup failures, cache credentials with agy acp --login, find the logs, and what to try next.
◉ Antigravity2026-10-26
When the Agent Stops Answering From Your Attachment After /compact, One Canary File Tells You Why
After /compact in Antigravity CLI, replies stopped reflecting the file you attached. Canary files tell you whether it never arrived, was dropped by compaction, or only lost detail, with the 1.4.6 change and how /compact, /btw, and /rewind differ, checked against the official docs.