# Rift (AI)
Rift is an experimental, [[Rust]]-based workspace manager that creates isolated copies of a project almost instantly using **copy-on-write** filesystem snapshots. It's a faster, far more space-efficient alternative to [[Git Worktree|git worktrees]]. Despite the `(AI)` disambiguator in this note's title, Rift is **not** an AI tool ; it's filesystem infrastructure. Its relevance to AI is indirect but real: parallel AI-agent workflows need many isolated, throwaway working copies, and that's exactly what Rift makes cheap.
> < 0.1s to clone a 10 GB folder.
## The problem it solves
A git worktree (or a plain `cp -r`) duplicates the whole tree on disk. Spin up several and you pay in both time and storage. Rift sidesteps that by leaning on filesystem-native copy-on-write: blocks are shared until written, so a new workspace is near-instant and costs almost no extra space until you actually change files.
## How it works
- **CoW snapshots** via native filesystem features: APFS `clonefile` on macOS, btrfs snapshots / reflinks on Linux (Windows planned)
- Each managed workspace carries a `.rift` marker; a [[SQLite]] registry tracks parent-child relationships and trashed entries
- **Smart excludes** by default ; regenerable artifacts like `node_modules` and `target/` aren't copied
- **Postcreate hooks** configurable via `.rift.toml` for per-workspace automation
## Interfaces
- A CLI
- A JavaScript FFI library for [[Node.js]] / [[Bun]], so you can drive workspace creation programmatically
## Install
```bash
npm install -g rift-snapshot
```
Release archives are also published on GitHub. MIT-licensed.
## Where it fits
- **vs [[Git Worktree|git worktrees]]**: same goal (multiple isolated checkouts), but Rift is dramatically faster and lighter because it never full-copies. Complementary, not a git replacement ; it manages workspaces, not history
- **In AI agent workflows**: harnesses like [[GitHub Copilot App]], [[Claude Code]], and parallel-session orchestrators isolate each agent run in its own worktree. Rift is the infrastructure layer that makes spinning up dozens of those isolated workspaces practically free ; the same pain point [[GitHub Copilot App]]'s worktree-per-session model addresses, attacked at the filesystem level
## References
- GitHub: https://github.com/anomalyco/rift
## Related
- [[Git Worktree]]
- [[Rust]]
- [[SQLite]]
- [[Bun]]
- [[Node.js]]
- [[GitHub Copilot App]]
- [[Claude Code]]
- [[Cursor CLI]]