> ## Documentation Index
> Fetch the complete documentation index at: https://docs.amulet.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Persist a disposable job

> Keep inputs and outputs when an agent sandbox or batch host disappears.

Use a named snapshot as a stable input and give each job its own branch. The
compute environment can disappear without taking the branch data with it.

This workflow assumes `corpus` contains the shared input data.

<Steps>
  <Step title="Save the input state">
    ```bash theme={null}
    amulet snapshot corpus --name baseline
    ```
  </Step>

  <Step title="Create a branch for the job">
    Use a unique branch name for each run:

    ```bash theme={null}
    amulet mount corpus@run-001 ./workspace --from-snapshot baseline
    ```

    Run the mount as a long-lived process in the sandbox or job environment.
  </Step>

  <Step title="Point the job at the mount">
    From another process in the same environment:

    ```bash theme={null}
    mkdir -p ./workspace/results
    ./run-job --input ./workspace/input --output ./workspace/results
    ```

    Replace `./run-job` with your workload command. The program does not need an
    Amulet-specific storage adapter; it reads and writes the mounted paths.
  </Step>

  <Step title="Save and unmount the result">
    ```bash theme={null}
    amulet snapshot corpus@run-001 --name complete
    amulet unmount ./workspace
    ```

    Wait for the mount process to exit before terminating the environment.
  </Step>
</Steps>

## Inspect the result later

Mount the saved result from another machine:

```bash theme={null}
amulet mount corpus@run-001 ./result --snapshot complete
```

The snapshot is read-only. Mount `corpus@run-001` without `--snapshot` if the
next job must continue writing to the branch.

<Note>
  Do not send multiple independent jobs to the same writable branch. Give each
  job a branch and preserve selected results as snapshots.
</Note>
