# Run concurrent AI coding sessions without clobbering

> Atlas runs concurrent coding sessions safely: each session gets its own per-directory runtime instance, and shared writes are guarded by in-process and cross-process locks.

Atlas is built to run more than one coding session at the same time without the sessions overwriting each other's work or state. Each session runs as its own runtime instance keyed to the directory it works in, and any state that sessions share is protected by locks so two sessions can never half-write the same record. That means you can keep several agents or terminals going at once, including across different git worktrees of the same repository, and each one stays consistent. Atlas runs as a single self-contained binary.

## Key takeaways

- Atlas runs multiple concurrent sessions in one server process, each isolated by working directory.
- Shared state is protected by in-process reentrant locks and a cross-process file lock.
- Two sessions cannot half-write the same record, so concurrent work does not corrupt state.
- This holds across different git worktrees of the same repo, and on native Windows.

## The problem with concurrent AI sessions

Many terminal agents assume one active session per project. Open a second session and they can contend for the same files and state, so one session's action overwrites another's. Atlas is designed for concurrency from the start.

When two sessions share a single project directory, an action in one, such as writing history, saving config, or removing a working copy, can silently overwrite or invalidate what the other is doing. The failure shows up as lost edits, corrupted session state, or a crash. Atlas treats concurrent sessions as the normal case rather than an edge case, so parallel work is safe by construction.

## Per-directory runtime isolation

Atlas keys each live session to the working directory it operates in and gives that directory its own runtime instance. Multiple instances coexist in one process, each with its own language servers, snapshots, and permission boundary.

Because each directory, including each git worktree checkout, gets its own isolated instance, two sessions running in different places do not share the live runtime state that would otherwise collide. Concurrent loads of the same instance are deduplicated rather than raced, so starting several sessions at once is deterministic instead of a scramble.

## Locking that prevents state bleed

For the durable state that sessions genuinely share, Atlas serializes access with locks. In-process reentrant read and write locks guard each storage record, and a cross-process file lock coordinates work across separate Atlas processes.

The cross-process lock is a careful directory-based lock with heartbeats, stale-owner recovery, and process metadata, used for config writes, plugin installs, and other shared operations. The combination means concurrent sessions in different worktrees still write into shared repo state safely: the locks make that contention correct rather than destructive. Each instance also keeps its own permission boundary, so isolation holds for what an agent is allowed to do, not just for the files it writes.

## FAQ

### Can I run multiple Atlas sessions at the same time?

Yes. Atlas is built for concurrency: it runs multiple sessions in one process, each isolated by working directory, and guards shared state with locks.

### Will one session overwrite another session's work?

No. Each session runs as its own per-directory instance, and shared writes are serialized by in-process and cross-process locks, so sessions do not clobber each other.

### Does this work across git worktrees of the same repo?

Yes. Sessions in different worktrees get separate runtime instances, and any state they share in the repo is lock-protected, so concurrent worktree sessions stay consistent.

### Is the concurrency safe on Windows?

Yes. Atlas runs natively on Windows, and its locking and per-directory isolation apply the same way as on macOS and Linux.

---

Canonical HTML: https://runatlas.sh/resources/features/concurrent-coding-sessions
Source of truth: aeo_pages row `/resources/features/concurrent-coding-sessions` (segment: Platform) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
