> ## 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.

# Concurrent Writes

> How several mounts writing to one file system reconcile — disjoint paths merge automatically, same-path writes are last-writer-wins.

Several mounts can write to the same file system at once. Autosave sends each mount's settled work through its session WAL. Before acknowledging a checkpoint, the server orders that update and applies its changed paths to the file system's single shared timeline. A file system is a shared drive, not a branching repository — so reconciliation is simple and automatic, with one rule for the rare overlap.

## Disjoint changes merge automatically

Replicated updates that touch different paths — or different files in the same directory — reconcile cleanly and never notice each other. The server rebases each update's changed paths onto the current state of the timeline, so two agents writing to `sessions/a/` and `sessions/b/` both land, in full, with no coordination and no conflict.

This is the common case, and it's the case worth designing for: **partition writers by directory or file** and concurrent access is effortless. It's exactly how one file system per user, mounted across many sandboxes, is meant to work — each session owns its own subtree.

## Same-path writes are last-writer-wins

If two mounts change the *same* file concurrently, the later server-ordered checkpoint wins. The file on the timeline becomes the later writer's version; the earlier writer's change to that file is overwritten. There are no conflict markers, no merge to resolve, and no manual step — a file system behaves like a shared disk, where the last published update to a path is the one that sticks.

<Note>
  This is deliberate. A file system is a single linear timeline, not a set of branches that diverge and merge — so there is nothing to three-way merge, and binary files can't carry text conflict markers anyway. If you need private work with an explicit publication step — review before landing, or long-lived divergence with conflict resolution — use a [Git repository workspace](/git/workspace-mounts) instead, where branches genuinely diverge and merges surface conflicts.
</Note>

## Making concurrency safe

Because same-path overwrites are silent, the way to keep concurrent agents from stepping on each other is to keep their writes disjoint:

* **Give each agent or task its own subtree** (`sessions/<id>/`, `users/<id>/`). This is the natural shape for agent workloads and eliminates same-path contention entirely.
* **Treat shared files as append-only or single-owner.** If one file must be written by many agents, funnel writes through one of them, or have each agent write its own file and merge at read time.
* **Wait for settled-write replication, not an explicit snapshot.** A small quiet edit normally reaches the shared head in about a second plus upload time; continuous writers flush at least every 5 seconds. Following mounts refresh after that checkpoint commits. They do not see bytes that are still in another mount's open local batch.

## Next Steps

<CardGroup cols={2}>
  <Card title="Manage Sessions" icon="arrows-rotate" href="/filesystems/manage-sessions">
    Status, history, resume, and restore.
  </Card>

  <Card title="Architecture" icon="cubes" href="/filesystems/architecture">
    How checkpoints are ordered and reconciled internally.
  </Card>
</CardGroup>
