Omniscio

Worktree Reaper (finished work areas removed automatically)

The one background job that removes finished agent work areas. Every five minutes it finds folders whose session ended or whose work landed, saves any unsaved work, moves the folder to the trash and deletes it gently in the background. There is no separate cleanup tool: the older Windows worktree cleanup, the abandoned-work-area archive and the landed-folder drain were removed, and this job is the only thing that removes work-area folders.

On this page

What it does

  • Finds finished work areas with one quick database lookup — nothing is scanned when there is nothing to do.
  • Leaves a work area alone while its session is running, waiting on you, paused or starting.
  • Leaves kept work areas alone. The four checkouts the scheduled test-baseline jobs reuse on every run are created kept, so they are re-pointed at the latest code each time instead of being removed and rebuilt from scratch.
  • Saves unsaved work before anything moves. Passwords and keys go to the encrypted store, never into git. Your branch is never deleted.
  • Moves the folder to the trash on the same drive (instant), then deletes it in a low-priority background program a couple of folders at a time, waiting for nothing, so your computer is not slowed down and the trash keeps getting smaller.
  • Also finds work-area folders the app lost track of, once a day.

When a folder is held back

A folder that cannot be removed yet (in use, a save that could not be proven, an unreadable drive) is retried after 5 minutes, 30 minutes, 2 hours, 8 hours, then daily. Folders still held after that are listed on the status page and raise one combined inbox note.

A folder whose save fails three times in a row is not held for ever: it is moved whole, with a note saying why, into the .amc-husk-rescue folder next to it, where nothing is ever deleted. Its branch and files stay exactly as they were, and the status page lists where it went.

Where to find it

  • Switch: Settings → Performance → Remove finished work areas automatically (worktreeReaperEnabled, on by default). Off means nothing is moved or deleted.
  • Status: GET /worktree-reaper — the last pass, saved work it recorded, and every folder it is holding with the reason.

Rules it keeps

The worktree reaper contract.

Last verified 2026-11-20