Skip to content

Reclaim disk left by removed worktree snapshots ($DATA/snapshot, storage/session_diff) #186

Open

Description

@byapparov

Context

#181 (PR #184) removes the worktree snapshot, revert and session-diff subsystem. Versions before it left two kinds of data on disk that nothing reads anymore:

  • $XDG_DATA_HOME/aictrl/snapshot/<projectId>: shadow git repos that staged the whole worktree of every git project the CLI ran in. On large repos these can be multi-GB (see the timings in perf(run): skip per-step worktree snapshots in headless runs (#146) #172). The hourly snapshot.cleanup job (git gc --prune=7.days) was removed with the subsystem, so they no longer shrink either.
  • $XDG_DATA_HOME/aictrl/storage/session_diff/*.json: per-session diff blobs written by the deleted SessionSummary. storage/json-migration.ts does not read them.

After #184 nothing reads, migrates or deletes either path. The only way to reclaim the space is aictrl uninstall or deleting the files by hand.

Decision needed

Should the CLI delete these on its own? Two options:

  1. A one-shot cleanup that removes snapshot/ and storage/session_diff/ on startup, gated by a marker so it runs once. One risk: an older CLI version running at the same time may still use its shadow repo.
  2. Documentation only: a release-notes line saying both dirs are safe to delete.

Acceptance

  • One of the two options is chosen and implemented.
  • If option 1: a test proves the dirs are removed exactly once and that session data in aictrl.db is untouched.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Could have - Mediumtech-debtTechnical debt cleanup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions