# AI use cases for Layerfs (Ephemeral-AI-Lab/layerfs)

Repo: [Ephemeral-AI-Lab/layerfs](https://github.com/Ephemeral-AI-Lab/layerfs) | Use cases: 3 | Page: https://dedupedai.com/use-cases/ephemeral-ai-lab-layerfs/

LayerFS is a Rust filesystem layer that gives each AI agent a complete, writable Workspace over shared committed history, saving work as deduplicated Commits that can be branched, rewound and merged.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Run parallel agents on separate Branches of one project: https://dedupedai.com/use-cases/ephemeral-ai-lab-layerfs/parallel-agent-branches-in-dsh/
- Rewind a project to an earlier Commit and branch from it: https://dedupedai.com/use-cases/ephemeral-ai-lab-layerfs/rewind-and-branch-agent-history/
- Let the newest agent edit win on chosen files: https://dedupedai.com/use-cases/ephemeral-ai-lab-layerfs/resolve-conflicts-with-lww-rules/

## How to run parallel agents on separate Branches of one project with Layerfs

Repo: [Ephemeral-AI-Lab/layerfs](https://github.com/Ephemeral-AI-Lab/layerfs) | Difficulty: Intermediate | Time: 1 hour | Basis: From the README

Fork a Branch per agent, test in Sandboxes, then merge and publish to main.

**Who it is for:** A developer using DeepSeek Harness who wants several agents to change the same project at once without overwriting each other.

**The problem:** Agents editing one working copy step on each other's files, and it is hard to see which agent changed what.

**The outcome:** Each agent works in its own Branch and Workspace, the History and Work tabs show every Branch live, and accepted Branches are merged and published to main.

### Steps

1. Install the dsh-layerfs plugin for DeepSeek Harness by following the LayerFS × DSH guide in dsh/README.md.
2. Start a dsh session on your project and have each agent fork its own Branch.
3. Let each agent test its Branch in a Sandbox and commit what it changed.
4. Open the Work and History tabs to check each Branch as it grows.
5. Merge the Branches you accept and publish them to main.

### Prompt to paste into your agent

```text
Using the LayerFS repo at https://github.com/Ephemeral-AI-Lab/layerfs, set up the dsh-layerfs plugin for <project path> and fork one Branch per agent. Report the Branch names and confirm the Work and History tabs list each one. Verify that the agents' Commits do not appear on main until a Branch is merged.
```

### Caveat

The README describes this flow through the LayerFS × DSH plugin, so you need a DeepSeek Harness setup first, and the Store has no crash or power-loss durability.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/ephemeral-ai-lab-layerfs/parallel-agent-branches-in-dsh/

## How to rewind a project to an earlier Commit and branch from it with Layerfs

Repo: [Ephemeral-AI-Lab/layerfs](https://github.com/Ephemeral-AI-Lab/layerfs) | Difficulty: Intermediate | Time: 45 minutes | Basis: From the README

Keep every agent step as a Commit, then fork a new Branch from any earlier point.

**Who it is for:** A developer whose agent made a bad change several steps ago and who wants to return to a known good state without losing later work.

**The problem:** Undoing agent edits by hand is slow and risky, and a plain copy of the project for each step takes a lot of space.

**The outcome:** The project is restored to a chosen Commit on a new Branch, and the earlier Commits stay in the Store for comparison.

### Steps

1. Set up LayerFS on your project using the LayerFS × DSH guide in dsh/README.md.
2. Review the Commits on the Branch in the History tab to find the last good state.
3. Fork a new Branch from that Commit, since any Commit can be forked at any depth.
4. Have the agent continue its work on the new Branch.
5. Merge the new Branch into main only after you have checked its result.

### Prompt to paste into your agent

```text
Using the LayerFS repo at https://github.com/Ephemeral-AI-Lab/layerfs, find the last good Commit on <branch name> and fork a new Branch from it. Report the Commit ID you chose and confirm the original Branch still exists. Verify that the new Branch starts with the files from that Commit.
```

### Caveat

Rewinding works through Branches and Commits, and nothing is deleted from the Store, but unmounting removes only the Workspace overlay, and the Store has no crash or power-loss durability.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/ephemeral-ai-lab-layerfs/rewind-and-branch-agent-history/

## How to let the newest agent edit win on chosen files with Layerfs

Repo: [Ephemeral-AI-Lab/layerfs](https://github.com/Ephemeral-AI-Lab/layerfs) | Difficulty: Advanced | Time: 1 hour | Basis: From the README

Name files in a .lww rule so concurrent edits do not stop a merge.

**Who it is for:** A team whose agents regularly touch the same generated or config files and keep hitting Conflict errors on merges.

**The problem:** Two Commits that change the same file are refused with Conflict, which blocks merges on files where any version is acceptable.

**The outcome:** Files named in a .lww rule never conflict, and the newest edit is kept, while other files still get the normal conflict check.

### Steps

1. Find the files that agents keep editing at the same time and that you are happy to overwrite with the newest version.
2. Add those files to a .lww conflict rule in the project, following the Core ideas page at Layerfs.ai/docs/core-ideas/.
3. Run the parallel agents on separate Branches as usual.
4. Merge the Branches and check that the named files hold the newest edit.
5. Check that files not named in the rule still stop with Conflict when two Commits change them.

### Prompt to paste into your agent

```text
Using the LayerFS repo at https://github.com/Ephemeral-AI-Lab/layerfs, add a .lww rule for <file list> in <project path>, then merge two Branches that both edit those files. Report which edit was kept. Verify that an unnamed file changed on both Branches still produces a Conflict.
```

### Caveat

The README describes .lww only at a high level, so check the Core ideas page for the exact rule syntax before you rely on it.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/ephemeral-ai-lab-layerfs/resolve-conflicts-with-lww-rules/
