LayerFS gives AI coding agents ephemeral workspaces with shared history

a computer chip with the letter a on top of it

If you’re building multi-agent systems on Linux, you’ve probably hit the same wall: each agent needs its own writable view of the codebase, but duplicating the entire filesystem for every tool call wastes storage and slows everything down. LayerFS is an open-source answer to that problem.

What It Does

LayerFS is an MIT-licensed filesystem designed specifically for AI coding agents. Each tool call mounts a complete, writable workspace on top of shared committed history. When the call finishes, the agent commits its changes and the workspace disappears. The shared history stays.

The project ships three core behaviors that matter for agent infrastructure:

  • Ephemeral workspaces: Each Bash tool call mounts a sandbox, executes, commits the diff, and unmounts. Compute exists only while a command runs.
  • Decentralized agents: Multiple agents on different computers share one serverless store with no database server required.
  • Instant bootstrap: Dependencies like node_modules are committed once and included in every mount. Mount time is measured at 5 to 20 ms, compared to roughly 5 minutes for a typical clone-plus-install cycle.

The Storage Math

Storage efficiency is one of the more interesting technical claims. According to the project, 10 copies of the same workspace compress down to the equivalent of 0.31 copies after deduplication and compression. Content chunks are stored once by hash, then compressed further. The project describes the ratio as: 10 copies to 1.05 after dedup, then to 0.31 after compression.

Forks are zero-cost in the traditional sense: forking a commit copies no files, only metadata. That makes recursive forking practical for reinforcement learning training runs or any workflow that needs to explore many branches from a single checkpoint.

Multiagent Coordination

Every tool call is a commit on its own branch. If two agents write to the same file at the same time, LayerFS refuses the operation with a conflict rather than silently merging. A .lww file at the root can mark specific paths (lockfiles, build output, caches) as last-write-wins instead, so those never block.

The project also tracks per-line blame across commits, so you can see exactly which agent step wrote any given line.

Stack and Availability

LayerFS is written in Rust and TypeScript. It runs on Linux. The code is on GitHub under the MIT license, published at v1.0.0 by Ephemeral AI Lab.

Stay on top of AI & Automation with BizStack Newsletter
BizStack  —  Entrepreneur’s Business Stack
Logo