Stackness
Sign up
LayerFS for AI coding agents: what the agent filesystem adds over git worktrees, and what v1.0.0 ships

LayerFS for AI coding agents: what the agent filesystem adds over git worktrees, and what v1.0.0 ships

LayerFS is an open-source filesystem for coding agents that records every change an agent's tool calls make as a commit in one shared store, and gives each shell command its own writable workspace over that history. Ephemeral AI Lab tagged v1.0.0 on 21 October 2026, and by 23 October the repository had 1,966 stars. Version 1.0.0 runs its store only on Linux, keeps no crash-safe history, and has one official agent integration so far, a preview plugin for DeepSeek Harness.

What is LayerFS?

LayerFS is an MIT-licensed Rust project from Ephemeral AI Lab, a small lab whose founder, GitHub user yifanxuaaa, wrote 3,988 of the 4,025 commits at the v1.0.0 tag. It keeps a project's whole tree in one SQLite file, which the docs call the Store, and lets many agents work on branches of it at once. The tagline is "Ephemeral Workspaces. Durable Shared History."

The first import takes everything: "source, .git and its index, node_modules, build caches, symlinks and every ignored file. Git ignore rules don't filter LayerFS state" (concepts). That is the pitch against a git worktree, which starts with tracked files only and needs an install before tests run. It also means local .env files go into the Store, which the docs do not warn about.

LayerFS does not replace Git. The FAQ says .git "is part of the tree like any other file, so Git works inside a Workspace as usual."

LayerFS turns every change an agent makes into a commit

LayerFS handles two kinds of tool call. File tools call the SDK in process: each write or edit lands in the Store as one commit, and reads record nothing. A shell command mounts a FUSE workspace over a branch inside a Docker container, runs, commits whatever changed (sources, lockfiles, node_modules, build output) and unmounts. Mounting copies no files; content loads from the Store as it is read.

Diagram of LayerFS's two routes for agent tool calls. One agent's file call, an rm, goes straight to the Store as an atomic write. Another agent's bash command, python train.py, runs in a sandbox workspace through the steps mount, exec, commit and unmount, and its result also lands in the Store as a commit

One frame of the animated "Ephemeral Computing" card from the LayerFS README. Image: Ephemeral-AI-Lab/layerfs by Ephemeral AI Lab, MIT.

The JavaScript SDK at the v1.0.0 tag shows the cycle (SDK README):

import { LayerFS } from "@layerfs/sdk";
const layerfs = new LayerFS("website", { storePath: "/layerfs-store/global/store.sqlite" });
await layerfs.project.init("./website");
await layerfs.branch.fork("feature");
await layerfs.fs.write("feature", "/README.md", "Hello\n", "Update introduction");
const page = await layerfs.branch.list_commits("feature", 20, 0);
const text = await layerfs.fs.read("feature", "/README.md", 1, 20);
const ws = await layerfs.workspace.mount("feature"); // { sandbox: "1", path: "/workspaces/1" }
await layerfs.workspace.exec(ws, "npm test", "Run tests");
await layerfs.workspace.commit(ws, "Save changes");
await layerfs.workspace.unmount(ws);

The docs site still shows the pre-1.0 sandbox.* calls that workspace.* replaced. Each container holds up to 16 workspaces and stops after two idle minutes, though an open issue reports an abandoned workspace keeping one "running forever". Commits hold files only, not processes or command output. And branch.publish "overwrites. It doesn't merge with Layers published since the Branch forked", so merge main into a branch before publishing it.

Two agents editing the same lines get a Conflict, not a race

LayerFS takes no file locks. Each commit runs a three-way merge against the branch head as it lands: changes to different files go through, edits to different lines of one text file merge, and overlapping edits are refused as Conflict, with nothing half-committed. In a workspace the refused commit writes <<<<<<< workspace marker blocks into the file, and LayerFS refuses to commit again until the agent resolves them.

The exception is a /.lww file of gitignore-style patterns, where "the side with the newer modification time wins (ours on a tie), with no conflict." The docs reserve it for regenerated files such as dist/: "never for code people write." Rust tests at the tag cover the cases: four workspaces writing four files all publish, edits to lines 1 and 5 of one file merge, and two edits to the same line conflict.

The README describes the rule more strictly than the code applies it: "Two Commits that change the same file are refused with Conflict, unless a .lww rule says the newest edit wins." The merge table in concepts and the merge code at the tag both line-merge text. Git worktrees, by contrast, give no warning at all until someone merges the branches.

LayerFS sits under the agent, beside git worktrees and the container

LayerFS fills the file-isolation slot that git worktrees fill in most parallel-agent setups: what each agent sees as its checkout. It also starts a Docker container per pool of workspaces, but it is not a security product. Its own benchmark table lists the container as needing /dev/fuse and CAP_SYS_ADMIN, and the file calls run in the agent's own process on the host.

Git worktree per agent LayerFS workspace Container or VM sandbox
What it isolates Files on a branch Files on a branch, plus ignored files and dependencies Processes, network, filesystem
Cost of one more agent A checkout, then install and build A mount and a small overlay database A container or VM start
History Only what you commit A commit per tool call that changes files None
Same file changed twice Found at merge time Separate lines merge, overlapping edits refused as Conflict Not its job
Platforms Every OS Git runs on Linux store, Docker required Depends on the runtime
Agents that ship it Claude Code, Codex in the ChatGPT desktop app, Cursor DeepSeek Harness plugin, preview Many

Sources: LayerFS compare page, git-worktree, Claude Code worktrees, read 23 October 2026.

Claude Code runs claude --worktree and copies ignored files listed in .worktreeinclude; Cursor cleans up worktrees beyond 25 per machine by default. LayerFS has no official integration for any of them. Two third-party projects created on 22 October, a WSL setup that runs Claude Code on LayerFS and an MCP server for any MCP client, had no stars a day later. The comparison of multi-agent workspaces and the sandbox comparison cover the layers on either side.

gitai changes the Git server, where LayerFS changes the checkout

gitai (feder-cr/git-ai) is a fork of GitLab's Gitaly server by Federico Elia, first released on 15 October 2026 and at v0.3.1 a week later. It works where LayerFS does not: on the host side, where agents' changes land on a shared branch. It lands each change by compare-and-swap instead of a merge queue, can hand a conflict to an LLM or a fixed rule, and runs across machines.

gitai borrows ideas from Anthropic's post on Scion, the internal source control system covered in the Scion explainer. Its README says it "is not affiliated with or endorsed by Anthropic", and its limitations file says "Not a Scion implementation."

LayerFS is what one agent mounts on one Linux host, and gitai is where many agents' work lands, so the two sit at different layers rather than competing. An older, unrelated project called Git AI tracks AI-written lines in a repository.

What LayerFS v1.0.0 ships and what the landing page only claims

The landing page lists ten ideas, and the docs say of their figures: "Their numbers and timings illustrate each idea; they are not measurements." Checked against the code, tests and docs at the v1.0.0 tag on 23 October 2026, the mechanisms ship and several headline numbers do not.

Claim Status at v1.0.0
Commit per change, forking from any commit, Conflict on overlapping edits, .lww rules Shipped, with code, tests and docs
"Every step an agent takes is a checkpoint" Shipped for files, if the harness calls commit after each shell step
"Agents on different computers share one serverless Store" Not shipped. The FAQ answers "Not today"
"~80% thinking, ~10% in Bash", "0.05 s to mount", "10 copies compress into 0.31" No published method
Recursive exploration for RL training No example or test in the repository
"The Store only grows" True, since there is no garbage collection yet

The measured benchmarks are the author's, one sample each, on Docker Desktop on an arm64 Mac, and they ran on a commit from 19 October, 202 commits before the tag. On 157 snapshots of the DeepSeek Harness repository, LayerFS stored 100.1 MB against 1,994.6 MB for Btrfs with zstd, from a separate September run, and 55.1 MB for a Git pack, which the README headline and the benchmarks overview chart leave out (dsh-dedup).

Durability is the larger gap. The release notes say "there is no crash or power-loss durability": the store runs SQLite with synchronous=OFF. The docs suggest pushing to Git from inside a workspace to keep work safe.

The Hacker News thread of 21 October (75 points, 47 comments) asked why Btrfs snapshots would not do and how a 1.0 has an architecture page marked "coming soon". The author did not reply.

When is a git worktree per agent still the better choice?

A git worktree per agent is the better choice for most setups as of October 2026: a handful of parallel agents, any OS, an agent that already ships worktree support, and work that has to end as Git commits anyway. Worktrees keep history in Git, which survives a crash, and need no new storage engine.

LayerFS suits a narrower case: many agents on one Linux host, where reinstalling node_modules or rebuilding target/ for every checkout is the slow part, and a commit trail per tool call is worth a young dependency. Its own run had eight DeepSeek agents build a SQL database in Rust in 4 hours 16 minutes over 913 commits.

Skip it for now if you work on macOS or Windows without a Linux container for the store, run agents on several machines, cannot afford to lose recent history, or use Claude Code, Codex or Cursor and want a drop-in. Native macOS support is an open pull request. I run four worktrees side by side, each with its own Postgres database, Redis database and ports, the setup in the move git worktrees for parallel task execution. As of 23 October 2026 no Stackness stack lists LayerFS, and five list Git (data sources).

Where to start with LayerFS

Read the platform page first: the store must sit on a local ext4, xfs or btrfs disk under one Linux kernel, and anything else is refused before any write. The SDK is not on npm; you link it from a checkout with npm install "file:$LAYERFS_REPO/sdk/js" and build the native addon on the Linux host. The DeepSeek Harness route is the one wired end to end, with step-by-step build commands on the integration page.

For parallel agents without a new filesystem, start with the worktree move above and Claude Code's .worktreeinclude, or browse the AI coding tools developers list in their stacks for what else sits in this layer.

LayerFS in brief

  • Licence and price: MIT, free. No hosted version.
  • Platforms: store calls need Linux and Docker Engine; macOS works only by running the store inside a Linux container.
  • Install: source only at v1.0.0: no npm package, binary or image.
  • Compatibility: stores made by v0.1.7 or earlier are refused, and the semver promise from 1.0.0 covers the JavaScript SDK only.

New posts by email

About one email a week with what we published. No account needed.

One email to confirm first. Every email has a one-click unsubscribe.

Which of these do you use?

Nobody on Stackness runs LayerFS yet. Tick what you use and be the first.

Lonny skating the lakeside path, kickflipping onto a bench, grinding it and flipping offStackness gamesPlay Lonny Eagle Amateur Skater 4A pixel art skateboarding game. Signing up opens it straight away.+2 secret games you unlock as you goSign up to play