Version control that snapshots folders, not files.
Every line of work is a real folder. Every save is an instant, read-only copy of it.
Every step, by a person, a script or an AI agent, can be undone.
$ layr line new fix # a new working folder, ready in milliseconds
$ cd ../fix && vim src/parser.rs
$ layr save -am "Fix the parser" # freeze the folder as a state
$ rm -rf src # a mistake: yours, or an AI agent's
$ layr restore . # and it is backGit was built for one person, one working copy, and files that change by hand. Today a project has a dozen agents working at once, each with its own folder, its own build cache, and shell commands that change files behind the editor's back. Layr is built for that.
- Parallel work is cheap. A new line is a file system snapshot: constant time, no copy. Build caches are bound to their absolute workspace and target location by default; a new line starts cold. Explicitly portable caches can share blocks across lines (cache contract).
- Nothing gets lost. Layr snapshots the folder itself, so it sees what
rm -rf,sed -ior a code generator did. Every operation is a signed record, andlayr undoreverses it. - You ship what you checked. Checks, approvals and deploys name one exact state. Change one
byte and the approval no longer applies. A merge queue keeps
maingreen. - Secrets are versioned and pushed securely.
.envfiles and keys live in private overlays: their own history, their own readers, their own encryption key. They travel with every push, and only the people and machines you allow can open them. Layr refuses any save or push that would copy a secret's value into shared files. - Copies are encrypted and yours. Push to a peer, a folder, your own S3 bucket or Layr Cloud.
Data is encrypted end to end with
agebefore it leaves the machine: storage and cloud see ciphertext only. - Sharing is per person. One person key opens every project that person may read. Grant it with one command; nobody else, the cloud included, ever holds the key.
Real commands and their real output, recorded on Linux with btrfs.
A mistake is one command away from undone. Delete a folder, then bring it back:
Sixteen agents, sixteen folders, a fraction of a second.
Production takes only what passed. The ref refuses until the exact state has a passing check:
Secrets stay private, and still travel. The token lives in an overlay. Copying its value into shared code is refused, and the push stores the overlay encrypted:
Layr has five ideas. Everything else is built from them.
line main/ a real folder you work in
│ save
▼
state 7d3e a frozen, read-only copy of that folder
▲ ▲
│ └─ attestation a signed note about one state: "tests passed", "approved"
└────────── ref a name for a state: env/prod, release/1.4.2
remote another place with the same states: a peer, a folder, S3, Layr Cloud
Lines and states are btrfs subvolumes and snapshots, so creating one costs the same for ten files or ten million. Changes between states come from file system metadata in time proportional to the change, not to the project. A root service performs every operation, checks who asks, and signs a record for it. The design document explains each choice.
curl -fsSL https://cloud.layr.ws/p/layr/install.sh | sh| Platform | Store on | Notes |
|---|---|---|
| Linux | btrfs (a loop file works) | Needs btrfs-progs, git, zstd. Run the service with systemd (Linux service) |
| macOS | any APFS folder, also on the default volume | Set LAYR_ROOT to a folder, for example ~/Projects/layr-store. Commands run as you; the root service is optional (details) |
| Linux | ext4 or XFS, through OverlayFS | Build with --features overlayfs; needs root mount permission (details) |
On macOS 27 and later (Apple silicon), the installer layr-<version>.pkg also brings LayrFS,
the file system of fast lines (fast lines). It puts layr in /usr/local/bin, brings an
older layr in ~/.local/bin (from install.sh) to the same version, and restarts the daemon job.
All three keep the same store and record formats, so machines on different platforms sync with each other.
Install the root service unit (it runs layr daemon as root):
sudo install -m 0755 "$(command -v layr)" /usr/local/bin/layr
sudo install -m 0644 packaging/systemd/layr.service /etc/systemd/system/layr.service
sudo systemctl daemon-reload
sudo systemctl enable --now layrThe unit has RequiresMountsFor=/var/lib/layr. Keep it when the store is a separate mount: systemd
then waits for that mount before it starts layr.
layr refuses a store that sits in the root subvolume, because a system snapshot rollback would empty it. Put the store in its own subvolume: Btrfs root snapshots.
The daemon also runs layr follow passes on its tick: every followed line is kept at its remote
branch (layr follow).
layr follow passes run in a LaunchAgent as your user. It needs no root:
# The store your layr commands use. Empty means the default store:
export LAYR_ROOT="${LAYR_ROOT:-$HOME/Library/Application Support/layr}"
cp packaging/launchd/ws.layr.daemon.plist ~/Library/LaunchAgents/
plutil -replace EnvironmentVariables.LAYR_ROOT -string "$LAYR_ROOT" ~/Library/LaunchAgents/ws.layr.daemon.plist
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ws.layr.daemon.plistThe daemon must see the same store as your commands (LAYR_ROOT). After an earlier install, stop
the agent first: launchctl bootout gui/$(id -u)/ws.layr.daemon.
Logs go to ~/Library/Logs/layr-daemon.log. Details: layr follow.
sudo layr init app --from ~/src/app --owner alice # import a folder; main is protected
cd /var/lib/layr/projects/app/lines/main
layr line new topic # a new line next to main
cd ../topic && $EDITOR src/lib.rs
layr status && layr diff
layr save -am "Fix the parser" # a new state
cd ../main
layr merge topic --expect "$(layr rev-parse topic)" # exactly the state you reviewed
layr git push origin main # mirror to GitHub when you want| Git | Layr | Difference |
|---|---|---|
| branch + worktree | line | One thing: a line is its own folder, with its own caches |
| commit | state (layr save -m) |
A snapshot of the whole folder, signed by the machine |
HEAD |
head |
|
git stash |
layr park |
|
cherry-pick, rebase, revert |
pick, replay, invert |
Conflicts never stop the operation; they are part of the new state |
| tag | ref | Moves only with compare-and-swap (--expect), keeps its history (env/prod@{1}) |
| CI status, PR approval | attestation | Signed, stored with the state, bound to its exact content |
| reflog | layr op log, layr undo |
Covers every operation, not only branch moves |
diff, status --porcelain, show and log --format print Git's formats byte for byte, so
editors and tools that read Git output keep working.
| Undo what an agent did | layr op log, layr undo, layr restore --source <state> . (review) |
| Run many agents at once | layr line new agent main --count 16: separate folders, location-bound caches (portable sharing is opt-in) |
| See conflicts before merging | layr status lists files that other live lines change too |
| Merge lockfiles by rebuilding them | package-lock.json derive=npm in .layrattributes (merge) |
| Find the step that broke it | layr bisect run --auto -- cargo test searches every saved step, not only states with messages |
| Review versions of one change | layr change show, layr change diff --from v2 --to v3: a change keeps its id through amends and replays |
| Review behavior | layr probe run, layr probe diff compare API answers, metrics and files between exact states |
| Sign what happened | layr attest, layr approve, layr try: signed checks and approvals bound to exact states |
Keep main green |
layr queue add, layr queue run: merges only after checks pass on the exact result |
| Protect production | layr protect env/prod --check unit --approvals 1, layr ref set env/prod … --expect, rollback with env/prod@{1} |
| Run any ref as a container | images and Helm charts from layr.toml, served by the daemon: docker pull <host>/shop/app:prod (OCI) |
| Version secrets | private overlays with their own readers and keys; a detector stops secret values in shared files (overlays) |
| Stack layers into views | layr view: shared files plus overlays as one addressable stack, views/<id> |
| Keep encrypted copies | layr remote add vault s3://bucket/app, layr push vault, layr clone, layr mount vault (remotes) |
| Share with people | layr person keys, layr remote grant vault --person alice --recipient age1… |
| Sync your own machines | layr remote add laptop ssh://laptop/app, layr sync laptop |
| Move from Layr Desk | layr clone s3://desk-bucket/project imports a Desk vault with its signatures checked |
| Mirror to Git | layr git push origin main: every state becomes a Git commit with the same parents |
Layr is alpha. The btrfs backend is the supported one and has an integration suite of more than a thousand checks that runs on real btrfs file systems; the core commands also run on APFS. The store format and command names may still change. There has been no external security audit. See what this version does not do.
Layr Cloud runs Layr in your own AWS account:
- an end-to-end encrypted S3 store per project, in an account you own;
- a gateway, so machines and people reach stores without AWS credentials (
layr+https://); - person keys, invites and pins, so one key opens every project a person may read;
- an executor host that runs the merge queue, the checks and the container registry;
- CloudFormation templates and a runbook; no operator ever holds your keys.
Layr talks to it as an ordinary remote.
Commands · JSON output · Volumes · Btrfs root snapshots · Review and delivery · Merging · Remotes · Containers · Overlays · Virtual lines (experimental) · Security · Performance · Design
The toolchain is pinned to the exact latest stable Rust release; bump rust-toolchain.toml and rust-version together on each release.
cargo test --workspace # unit tests
sudo tests/run.sh # integration tests: each file gets a fresh btrfs on a loop fileUnsafe code is limited to src/sys.rs. Commit messages say what changed and why, in plain words.
Code adapts to its machine: limits such as thread counts come from the system, not developer-tuned constants.
Work that a user or a running build waits on comes first. Background jobs, scans and reports run at lowered CPU and I/O priority.



