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

# Manage Workspaces

> Inspect, reattach, clean up, diff, and restore Git-backed file system workspaces.

Workspaces survive unmounts and sandbox restarts. Use these commands to inspect a workspace, reattach it, delete it, diff it, or restore an earlier snapshot.

## Check Status

```bash theme={null}
$ tl fs status /work
file system: agent-outputs
workspace: 3f9a2b7e1c4d (created 12m ago)
daemon: mounted at 8b21f6a9c3d5e7f1a2b4c6d8e0f3a5b7c9d1e3f5
local: clean
```

With unsnapshotted changes, status lists dirty paths:

```bash theme={null}
local: 2 change(s):
  M src/parser.py
  D src/old_parser.py
```

Add `--json` for machine-readable output.

## List Workspaces

```bash theme={null}
$ tl fs ls
Workspace      File system      Base   Snapshots   Mode        Mounted   Age
3f9a2b7e1c4d   agent-outputs    main   2           workspace   yes       12m

Mount: tl fs mount <workspace> <path>
Delete: tl fs rm <workspace>
```

## Reattach a Workspace

Unmounting keeps the workspace by default:

```bash theme={null}
$ tl fs unmount /work
Unmounted /work. Workspace 3f9a2b7e1c4d kept. Mount it again with: tl fs mount 3f9a2b7e1c4d /work
```

Reattach it later from the same sandbox, another sandbox, or another machine:

```bash theme={null}
$ tl fs mount 3f9a2b7e1c4d /work2
Mounted workspace 3f9a2b7e1c4d (agent-outputs) at /work2, resumed at its last snapshot
```

<Note>
  A workspace already mounted elsewhere defaults to read-only if you mount it again. Pass `--mode rw` to force it writable.
</Note>

## Delete a Workspace

```bash theme={null}
$ tl fs rm 3f9a2b7e1c4d
Deleted workspace 3f9a2b7e1c4d (file system agent-outputs).
```

Or delete it while unmounting:

```bash theme={null}
$ tl fs unmount /work --delete
Unmounted /work (workspace 3f9a2b7e1c4d deleted).
```

## Diff

Diff the mount against its last snapshot:

```bash theme={null}
tl fs diff /work
```

Diff any two snapshots or commits:

```bash theme={null}
tl fs diff /work 4a1f9c2d8b3e 8b21f6a9c3d5
```

## Restore

Restore the mount contents to an earlier snapshot:

```bash theme={null}
$ tl fs restore /work 8b21f6a9c3d5e7f1a2b4c6d8e0f3a5b7c9d1e3f5
Restored /work to 8b21f6a9c3d5 (12 file(s) refreshed, 1 removed).
```

Restore does not rewrite history. It changes the working directory, and the next snapshot records the restored state.
