Retention and archive
Keep the spaces you care about for as long as you want, and let Marshal clean up the rest on a schedule your admin controls. A stopped space you own stays until you act on it, unless your admin sets Stopped Space Archive (days) to have Marshal archive it for you. Archived spaces and finished run spaces follow clear timers, so disks and backups never pile up.
What you can do with it
- Clear your list without losing work. Archive a space you finished last sprint. It leaves your Spaces list, keeps its saved workspace, and you can restore it any time before its countdown ends.
- Keep a workspace after the space is gone. Delete a space but tick Retain workspace. The saved files stay as a named volume, and you can fork a new space from them next month.
- Pay only for the disk you use. An admin sets how long a finished run keeps its disk. A short window frees the disk soon after each run, while the backup stays, so the run can still be continued with its files.
See it end to end: Run a fleet of agents in parallel.
How it works
| Space | What happens to it |
|---|---|
| Your space, stopped | Kept with its saved workspace until you archive or delete it. When your admin sets Stopped Space Archive (days), it is archived automatically after that many days stopped. With the default of 0, it is kept until you act. |
| Your space, archived | Deleted after Archived Space Retention (days). |
| A run’s space, finished | Archived after Finished Run Disk Retention (hours), then deleted after Archived Space Retention (days). |
Archiving and deleting do different things:
- Archive frees the space’s disk and keeps its workspace backup in your org’s storage. Restore brings the space back to
stopped, ready to resume. The first resume after a restore downloads the backup, so it takes longer than a usual resume. To fork an archived space, restore it first. - Delete removes the space and its workspace backup, unless you retained the workspace.
A stopped space, with automatic archive on
When your admin sets Stopped Space Archive (days) above 0, a stopped space you own moves through the full lifecycle on its own:
The total life of an untouched stopped space is Stopped Space Archive (days) plus Archived Space Retention (days). Resume the space, or restore it from the Archive page, any time before it is deleted.
A space with no workspace backup is never archived this way, so the work in it is never at risk. Marshal archives a space only once its workspace is safely saved.
A run’s space, step by step
With the default settings, a finished run’s space goes through this timeline:
About 2 hours after the run ends, its space is archived: the disk is freed and the backup is kept. 7 days later, the space is deleted and the backup is removed.
What this means for Continue on a finished run:
- The conversation is kept for 30 days after the run ends.
- The files are kept until the run’s space is deleted, 7 days after it is archived by default.
- Inside both windows, Continue brings back the conversation and the files. After the space is deleted and before the 30 days pass, Continue brings back the conversation and starts with an empty working tree.
See The run page.
A disk kept for safety
When a space stops, Marshal saves its workspace to storage. If that last save did not finish, for example because the machine was preempted, Marshal keeps the space’s disk after you archive it, so the newest work stays safe. Once the space is deleted, the disk goes with it.
Spaces with a complete backup are unaffected. For a space that keeps its disk:
- The archive, delete and restore confirmations show when the space was last saved, for example “Last saved 5 hours ago”, or “never saved”. Archive and delete still go ahead when you confirm.
- Restoring asks you to confirm first. Spaces with a complete backup restore in one click.
- Your org’s admins get an alert, so they know the disk is kept.
Archive, restore and delete
You can archive a space that is ready, running or stopped. A running space is stopped first. Archived spaces are on the Archive page, each with a countdown such as “3d left”.
marshal spaces archive <id>
marshal spaces restore <id>
marshal spaces resume <id>
marshal spaces delete <id>restore moves the space to stopped. Run resume after it to start the space. delete asks you to confirm unless you pass --yes.
To keep the files when you delete, use Delete in the web and tick Retain workspace. The checkbox shows when the space has a saved volume. The volume gets a name and stays after the delete. Automatic deletion never removes a retained volume. Manage retained volumes under Settings > Space Storage.
Configure it
These settings are under Settings > Configuration, in the Spaces group. Org owners and admins can change them.
| Setting | Default | Range | What it controls |
|---|---|---|---|
| Finished Run Disk Retention (hours) | 2 | 1 to 720 | How long a finished run’s space keeps its disk before Marshal archives it. Archiving frees the disk within about a minute and keeps the backup. |
| Stopped Space Archive (days) | 0 (never) | 0 to 365 | How many days an interactive space may stay stopped before it is archived automatically. 0 means never. A space with no workspace backup is never archived this way. The first time you turn it on, every existing stopped space that has been stopped longer than the number is archived on the next hourly pass. |
| Archived Space Retention (days) | 7 | 1 to 365 | How long an archived space is kept before it is deleted. Deleting removes the workspace backup. This applies to your spaces and to run spaces. |
Lower the disk window when every compute class uses a persistent disk, because each finished run holds its full disk for that long. Raise the archive window when people continue runs days later and need the files.
Edge cases
- Turning Stopped Space Archive (days) on for the first time archives every existing stopped space that has been stopped longer than the number, on the next hourly pass.
- The retention check runs every hour. A window can end up to an hour later than its value.
- The disk timer starts only when the run has finished. A parked run, which waits for an answer, keeps its space.
- A run’s space that ends in
errormoves tostoppedafter 1 hour, then follows the same timeline. - A run started with
marshal run --keep-on-failurekeeps its space up for 24 hours after a failed run, so you can attach and look around. - You can delete an archived space at once. You do not have to wait for its countdown.
Try it
Open Archive in the sidebar to see your archived spaces and how long each has left. Or archive one now:
marshal spaces archive <id>