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

# Record & Replay

> Record workspace file changes during agent execution and inspect them after a trial.

Add `--record` to a local job or trial, or set `environment.record_workspace: true` in its config.

```bash theme={"system"}
harbor run -t terminal-bench/build-cython-ext \
  -a claude-code -m anthropic/claude-sonnet-5 -e docker --record
```

Run `harbor view jobs`, open the trial, and select **Replay**. Move the slider to
inspect the workspace at an earlier point, even after the sandbox has been deleted.
Recording works with the viewer closed. Add [`--stream`](https://docs.harborframework.com/jobs/stream) to the
same run if you also want to open the live editor.

The recorder starts in the agent's working directory. If the task starts in `/`,
set `[environment].workdir` in `task.toml` to the directory the agent should use.
Recording requires a Linux sandbox with Python 3 and a provider that supports SSH.
Harbor saves the history under the trial or step's `workspace/` directory.

The history includes regular files and captures UTF-8 text up to 5 MiB per version.
In Replay, select **Load file** for recorded text of 128 KiB or more. Select
**Load diff** if either recorded text version in a comparison is 1 MiB or larger.
The recorder skips symlinks and the `.git`, `.venv`, `__pycache__`, and
`node_modules` directories. Rapid writes to one file can be observed together.

**Steps** follows the agent trajectory. Select a step to see the workspace at the
end of its recorded interval. **Diff** shows the net changes observed from that
step's timestamp up to the next step's timestamp. The final step ends when recording
finishes. Select the step's batch count to inspect individual writes. A background
command can keep writing during a later step.

**Batches** shows the complete recording, including the initial workspace, recovery
events, and the final scan. Replay opens with **Batches** and **Diff** selected.
Each batch compares with the previous batch.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.